bootstrapping-microservices/chapter-9

"Error Saving Credentials" on docker login in main.tf

Closed this issue · 8 comments

I keep running into this error whenever i run terraform apply, it repeats this error for every service except video-streaming which successfully builds first. It seems it only completes this script for that service and throws this error on the rest. Sadly I am not familiar enough with how docker is saving the credentials to bypass this issue.

Screen Shot 2021-08-19 at 12 50 16 AM

Can you run docker login successfully outside Terraform?

What platform are you on?

Can you run docker login successfully outside Terraform?

Yup, if i run the same command with the same credentials as the script within my command line I can log into my container registry without any issues, multiple times.

What platform are you on?

Azure

What operating system are you on?

Or are you running the docker login inside a CD pipeline?

I'm not running it in a pipeline yet, I am running terraform apply and it is failing at this step here:

https://github.com/bootstrapping-microservices/chapter-9/blob/master/example-1/scripts/modules/microservice/main.tf#L40

It works on this step for the first service, and then subsequent services it will fail.

What operating system are you running it on? (If you tell me I'll can try running it on that OS to see what happens).

Can you run docker login directly from the command line? You should try it without terraform to check that that your username and password for the container registry work.

What operating system are you running it on? (If you tell me I'll can try running it on that OS to see what happens).

Yup, my OS is macOS Big Sur version 11.5.2

Can you run docker login directly from the command line? You should try it without terraform to check that that your username and password for the container registry work.

Yup I verified that this is working correctly.

I'm just going to close this issue, my workaround was to just remove the repeated login step for every service. Still haven't been able to find out why it was giving me that error.

Hi @jordac67 thanks for letting me know. If you get any more understanding of the problem please add more here.

Thank you