401 when running coder

I followed the AWS quickstart guide to set-up coder, workspace-wise I'm using the aws-linux template. I'm now getting 401s when running git (through coder gitssh) within the workspace:
coder@coder-alex-alexcodermain:~$ git clone [email protected]:kelseyhightower/nocode.git
Cloning into 'nocode'...
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
coder@coder-alex-alexcodermain:~$ git clone [email protected]:kelseyhightower/nocode.git
Cloning into 'nocode'...
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
Weirdly I can run other coder commands fine & login doesn't resolve the gitssh 401s. Any ideas what might be happening here?
7 Replies
alexx
alexxOP3y ago
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
get agent git ssh token: GET https://<redacted>.try.coder.app/api/v2/workspaceagents/me/gitsshkey: unexpected status code 401: Cookie "coder_session_token" must be provided.: Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
get agent git ssh token: GET https://<redacted>.try.coder.app/api/v2/workspaceagents/me/gitsshkey: unexpected status code 401: Cookie "coder_session_token" must be provided.: Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
Running Coder v0.11.0+df89e2c
Phorcys
Phorcys3y ago
are you logged in ? try running coder login <url>
alexx
alexxOP3y ago
Yep, logging in doesn't kep in the gitssh case:
coder@coder-alex-alexcodermain:~$ coder login https://<redacted>.try.coder.app
> Welcome to Coder, alex! You're authenticated.
coder@coder-alex-alexcodermain:~$ git clone [email protected]:kelseyhightower/nocode.git
Cloning into 'nocode'...
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
coder@coder-alex-alexcodermain:~$ coder list
WORKSPACE TEMPLATE STATUS LAST BUILT OUTDATED STARTS AT STOPS AFTER
alex/AlexCoderMain puppeteer-linux Started 5m false - -
coder@coder-alex-alexcodermain:~$ coder login https://<redacted>.try.coder.app
> Welcome to Coder, alex! You're authenticated.
coder@coder-alex-alexcodermain:~$ git clone [email protected]:kelseyhightower/nocode.git
Cloning into 'nocode'...
Cookie "coder_session_token" must be provided. Try logging in using 'coder login <url>'.
Run 'coder gitssh --help' for usage.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
coder@coder-alex-alexcodermain:~$ coder list
WORKSPACE TEMPLATE STATUS LAST BUILT OUTDATED STARTS AT STOPS AFTER
alex/AlexCoderMain puppeteer-linux Started 5m false - -
Phorcys
Phorcys3y ago
sounds like a bug to me, I'll try on my side actually, I can't right now but you could try upgrading your CLI and server, because if it is a bug chances are it's already been fixed
alexx
alexxOP3y ago
Have tried --token or setting the env. variable directly, but it didn't help on my end
alexx
alexxOP3y ago
Fixed in v0.12.4. Cheers Kyle!

Did you find this page helpful?