Skip to content

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

@JonNeat

Description

@JonNeat

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions