sourcegraph/src-cli

src login not working

ghirsch-reddit opened this issue · 4 comments

I installed src-cli via homebrew, generated an API token, and set the SRC_ENDPOINT and SRC_ACCESS_TOKEN variables. When I then try to run src login SOURCEGRAPH_URL with the URL of our private Sourcegraph instance, I get a response of

❌ Problem: Error communicating with <SOURCEGRAPH_URL>: invalid character '<' looking for beginning of value

When I try to recreate the request that happens here, I get a 303 HTML response, which explains the response from src login but seems unexpected.

Is there some further configuration that users need to do beyond the things mentioned at the top? Or is this likely a bug with Sourcegraph? If the former, it also seems worth updating the error messages to point others who run into the same thing in the right direction.

Just to be sure, you did replace <SOURCEGRAPH_URL> in the commands and env vars with the actual values, right?

Correct, I used the actual values for setting env vars and running commands.

Also perhaps of note is that the 303 redirects me to an OAuth flow.

Okay actually I found the problem, turns out I needed to connect to our VPN.

Let me know if I should just close this issue, or if I should leave it open since others with private instances may have similar problems, and a better error message could be valuable

We discussed this issue at our team sync this morning and are going to close it for now, since you have src-cli working, but we may revisit the exact error message at a later date. Thanks for opening the issue!