DEV Community

Discussion on: Deploying Django Application on AWS with Terraform. GitLab CI/CD

Collapse
 
antoine_beneteau_d2c0daeb profile image
Antoine • Edited

Hello, first thank you for your tutorial it's awesome !!

I encounter a blockage during the CI/CD on the build side. It fails by indicating this error:
An error occurred (IncompleteSignatureException) when calling the GetAuthorizationToken operation:.....
Error: Cannot perform an interactive login from a non TTY device

I searched everywhere to know where it came from but without success.

Collapse
 
eugen1j profile image
Yevhen Bondar Daiquiri Team

Hello, thank you!

I think this will solve your problem stackoverflow.com/a/61854312/8153147

So, instead of

aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY_URL

use

docker login -u AWS -p $(aws ecr get-login-password) $AWS_REGISTRY_URL

Collapse
 
antoine_beneteau_d2c0daeb profile image
Antoine

Thanks for your response.

I tried this but I get :
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password

Thread Thread
 
eugen1j profile image
Yevhen Bondar Daiquiri Team

I think you need to return to this code aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY_URL. It fails because aws ecr get-login-password command prints nothing to stdout.

Maybe, you have invalid credentials in Gitlab variables? Can you check aws ecr get-login-password command locally with AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID credentials you use in GitLab? You can set credentials locally in nano ~/.aws/credentials

Thread Thread
 
antoine_beneteau_d2c0daeb profile image
Antoine

I made it work by adding the creds directly in the project not in the group