Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoCredentialProviders: no valid providers in chain. Deprecated. #12219

Closed
JonNeat opened this issue Feb 1, 2021 · 3 comments
Closed

NoCredentialProviders: no valid providers in chain. Deprecated. #12219

JonNeat opened this issue Feb 1, 2021 · 3 comments

Comments

@JonNeat
Copy link

JonNeat commented Feb 1, 2021

Problem description

I'm trying to send my docker logs to Aws Cloudwatch. Don't discard it for being "something I could look up", I've spent tons of hours searching through documentation and tutorials.

I've installed AWS-cli and configured it, so ~/.aws/config is filled with my credentials. I've also set temporarily the session-variables just to be safe:

EXPORT AWS_SECRET_ACCESS_KEY=...
EXPORT AWS_ACCESS_KEY_ID=...
EXPORT AWS_SESSION_TOKEN=...

I've verified I can connect to AWS using:
aws s3 ls

This is my run config:
docker run --log-driver=awslogs --log-opt awslogs-group=docker-logs --log-opt awslogs-region=eu-west-1 --log-opt awslogs-create-group=true alpine echo 'hi cloudwatch'

When tailing /var/log/daemon.log I see the following error:
Feb 1 01:12:07 XXXXXX dockerd[7389]: time="2021-02-01T01:12:07.670370559+01:00" level=error msg="Failed to create log stream" errorCode=NoCredentialProviders logGroupName=docker-logs logStreamName=61c82801d22d3db4c68cdc5b3d1dcba51f97c77dea5ce33e262b712c0e2a23a7 message="no valid providers in chain. Deprecated.\n\tFor verbose messaging see aws.Config.CredentialsChainVerboseErrors" origError=""

I've also tried giving docker run the session-variables as --ENV-parameters. Still doesn't work.
I've also tried insert the EXPORT'ed variables into /etc/default/docker. Still no luck.

Docker has no problem uploading to cloudwatch if I run with log-driver="json-file" and point to a file. So it's only awslogs giving problems.

Versions

$ aws --version
aws-cli/2.1.22 Python/3.7.3 Linux/4.19.57-v7l+ source/armv7l.raspbian.10 prompt/off

$ docker --version
Docker version 20.10.2, build 2291f61

Suggestions for a fix

Am I overlooking something? If not, please accept the given environmental variables.

@eichelkrauta
Copy link

+1 -- it seems as though from this post docker/compose#2329 asking about the same thing that the solution might be to configure the docker service's environment to have the variables?

@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants