Troubleshooting AWS IoT Greengrass in a Docker container
Use the following information to help you troubleshoot issues with running AWS IoT Greengrass in a Docker container and to debug issues with AWS IoT Greengrass in the Docker container.
Topics
Troubleshooting issues with running the Docker container
Use the following information to help troubleshoot issues with running AWS IoT Greengrass in a Docker container.
Topics
- Error: Cannot perform an interactive login from a non TTY device
- Error: Unknown options: -no-include-email
- Error: A firewall is blocking file Sharing between windows and the containers.
- Error: An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::account-id:user/<user-name> is not authorized to perform: ecr:GetAuthorizationToken on resource: *
- Error: You have reached your pull rate limit
Error: Cannot perform an interactive login from a non TTY device
This error can occur when you run the aws ecr get-login-password
command.
Make sure that you installed the latest AWS CLI version 2 or version 1. We recommend that you
use the AWS CLI version 2. For more information, see Installing the AWS CLI in the
AWS Command Line Interface User Guide.
Error: Unknown options: -no-include-email
This error can occur when you run the aws ecr get-login
command. Make sure
that you have the latest AWS CLI version installed (for example, Run: pip install awscli
--upgrade --user
).
For more information, see
Installing
the AWS Command Line Interface on Microsoft Windows in the
AWS Command Line Interface User Guide.
Error: A firewall is blocking file Sharing between windows and the containers.
You might receive this error or a Firewall Detected
message when running
Docker on a Windows computer. This can also occur if you are signed in on a virtual private
network (VPN) and your network settings are preventing the shared drive from being mounted.
In that situation, turn off VPN and re-run the Docker container.
Error: An error occurred
(AccessDeniedException) when calling the GetAuthorizationToken operation: User:
arn:aws:iam::account-id
:user/<user-name> is not authorized to
perform: ecr:GetAuthorizationToken on resource: *
You might receive this error when running the aws ecr get-login-password
command if you don't have sufficient permissions to access an Amazon ECR repository. For more
information, see Amazon ECR Repository Policy
Examples and Accessing One
Amazon ECR Repository in the Amazon ECR User Guide.
Error: You have reached your pull rate limit
Docker Hub limits the number of pull requests that anonymous and Free Docker Hub users can make. If you exceed the rate limits for anonymous or free user pull requests, then you receive one of the following errors:
-
ERROR: toomanyrequests: Too Many Requests.
-
You have reached your pull rate limit.
To resolve these errors, you can wait for a few hours before you try another pull
request. If you plan on consistently submitting a large number of pull requests, see the
Docker Hub website
Debugging AWS IoT Greengrass in a Docker container
To debug issues with a Docker container, you can persist the Greengrass runtime logs or attach an interactive shell to the Docker container.
Persist Greengrass logs outside of the Docker container
After you stop a AWS IoT Greengrass container, you can use the following docker cp
command to copy the Greengrass logs from the Docker container to a temporary logs directory.
docker cp
container-id
:/greengrass/v2/logs/tmp/logs
To persist logs even after a container exits or is removed, you must run the AWS IoT Greengrass Docker
container after bind-mounting the
directory.
/logs/greengrass/v2
To bind-mount the
directory, do one of the
following when you run a new AWS IoT Greengrass Docker container.
/logs/greengrass/v2
-
Include
-v
in your/tmp/logs
:
/logs:ro/greengrass/v2
docker run
command.Modify the
volumes
block in the Compose file to include the following line before you run yourdocker-compose up
command.volumes: -
/tmp/logs
:
/logs:ro/greengrass/v2
You can then check your logs at
on your host to see
Greengrass logs while AWS IoT Greengrass is running inside the Docker container./tmp/logs
For information about running Greengrass Docker containers, see Run AWS IoT Greengrass in Docker with manual provisioning and Run AWS IoT Greengrass in Docker with automatic provisioning
Attach an interactive shell to the Docker container
When you use docker exec
to run commands inside the Docker container, those
commands are not captured in the Docker logs. Logging your commands in the Docker logs can
help you investigate the state of the Greengrass Docker container. Do one of the following:
-
Run the following command in a separate terminal to attach your terminal's standard input, output, and error to the running container. This enables you to view and control the Docker container from your current terminal.
docker attach
container-id
-
Run the following command in a separate terminal. This enables you to run your commands in interactive mode, even if the container is not attached.
docker exec -it
container-id
sh -c "command
> /proc/1/fd/1"
For general AWS IoT Greengrass troubleshooting, see Troubleshooting AWS IoT Greengrass V2.