Unable to log in to docker hub

I have tried
- echo “$DOCKER_PASSWORD” | docker login -u “$DOCKER_USERNAME” --password-stdin
and
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
and both of them are giving the same error.

Link :- https://travis-ci.org/github/ChanManChan/multi-container

Try:
docker logout
Then pull again.

What is in your $DOCKER_PASSWORD? Does it contain bash-special characters that may be throwing off docker login?

One more possible reason. You specify the secret variables using repository settings. In this case, you need to paste the variable’s raw value into the settings, not an encoded string generated by travis encrypt. This is a mistake that new users sometimes make.

To double-check if a secret variable’s value is correct, you can print a small part of it and then delete the build’s log. E.g. this will print the first 3 characters:

echo "${VAR:0:3}"

Thanks man, really good catch.

Imprint