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

Not a tty error while logging into Docker registry #1198

Open
kczpl opened this issue Nov 6, 2024 · 2 comments
Open

Not a tty error while logging into Docker registry #1198

kczpl opened this issue Nov 6, 2024 · 2 comments

Comments

@kczpl
Copy link

kczpl commented Nov 6, 2024

Hi!
I'm facing an annoying issue that I've spent 4 hours trying to solve.
I'm deploying my app from GitLab CI/CD using the kamal deploy command, but it fails on the first step, which is docker login. I tried to debug it with the kamal login command:

kamal registry login -L -d staging -c .kamal/deploy.yml -v
INFO [4cc56c39] Running docker login git.registry:5050/app -u [REDACTED] -p [REDACTED] on app.domain.com
[email protected]'s password:  ERROR (Errno::ENOTTY): Exception while executing on host app.domain.com: Not a tty

It looks like it's missing either the password or username, so I dug deeper.
Normally, I use GitLab-provided variables like this:

registry:
  server: git.registry:5050/app
  username:
    - CI_REGISTRY_USER
  password:
    - CI_REGISTRY_PASSWORD

Long story short, I created a fixed GitLab token to pass, and I even hardcoded it for testing. I passed variables explicitly and tried many approaches, but since nothing worked, I decided to create this issue. Here's what I tried:

registry:
  server: git.registry:5050/app
  username: deploy
  password: somehardcodedpassword

Using this exact same configuration on my local machine works just fine. However, on the GitLab CI pipeline, it always errors because of TTY, which makes sense if no value is passed, but I can't even see the [REDACTED] values.

How is it possible that even hardcoded variables don't work, let alone environmental values? The docker login command works on the server, and kamal login works on my local machine

@kczpl
Copy link
Author

kczpl commented Nov 7, 2024

Probably it is also not the matter of environment variables as logout command also fails:

kamal registry logout -d staging -c .kamal/deploy.yml -v
Command: docker logout git.registry:5050/app
[email protected] password:  ERROR (Errno::ENOTTY): Exception while executing on host app.domain.com: Not a tty

@kczpl
Copy link
Author

kczpl commented Nov 12, 2024

Finally fixed that issue. It turned out to be an SSH error rather than a Docker registry error.
While we can close this issue, I've noticed a potential improvement regarding where the error occurred in the log file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant