cog icon indicating copy to clipboard operation
cog copied to clipboard

`cog login` fails silently if `pass` is uninitialized

Open cameronk opened this issue 3 years ago • 6 comments

Ran into an issue and thought I'd leave the solution here for incorporation into docs.

I had to spin up a machine on Google Cloud to build & test a Cog model. It's running Debian 10:

c0-deeplearning-common-cu110-v20221107-debian-10
Google, Debian 10 based Deep Learning VM with , M100, Base CUDA 11.0, Deep Learning VM Image with CUDA 11.0 preinstalled.
ck@cog-p4:~/cog-pyannote/speaker-diarization$ cog login
This command will authenticate Docker with Replicate's 'r8.im' Docker registry. You will need a Replicate account.

Hit enter to get started. A browser will open with an authentication token that you need to paste here.

If it didn't open automatically, open this URL in a web browser:
https://replicate.com/auth/token

Once you've signed in, copy the authentication token from that web page, paste it here, then hit enter:
SNIPPED_TOKEN
ⅹ Failed to run docker-credential-desktop: exit status 1
ck@cog-p4:~/cog-pyannote/speaker-diarization$ docker-credential-store store

I found the underlying issue by calling docker-credential-desktop directly with

docker-credential-desktop store
{"Username":"cameronk","Secret":"SNIPPED_TOKEN","ServerURL":"r8.im"}
error storing credentials - err: exit status 1, out: `pass not initialized: exit status 1`

Turns out this is because pass is not initialized. Solution:

  1. gpg --generate-key
  2. grab gpg id
  3. pass init [gpg_id]
  4. re-run cog login

Reference: https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452

cameronk avatar Dec 11 '22 05:12 cameronk

Thanks for taking the time to write this up!

zeke avatar Dec 14 '22 03:12 zeke

Not sure where this would go in the docs, to be honest. We don't really have a troubleshooting doc. Maybe just having this as an issue is a good start, so people can Google there way to this issue to get unblocked. What do you think?

zeke avatar Dec 14 '22 03:12 zeke

@zeke Agreed, thought it'd be helpful to have an issue that folks could stumble upon in the future. I'll close this now!

cameronk avatar Dec 15 '22 17:12 cameronk

More people have been running into this. It shouldn't be in documentation – we should detect it and fix it or print instructions.

bfirsh avatar Jan 25 '23 19:01 bfirsh

this is still not working and I am unable to log into cog to push my model.

mad-wizard avatar Aug 02 '23 01:08 mad-wizard

Thanks it worked with gpg and pass init :)

jawand avatar Jan 15 '24 19:01 jawand