Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Possible issue with Network Proxy settings #40

Open
C1aud3 opened this issue Jul 27, 2022 · 10 comments
Open

Possible issue with Network Proxy settings #40

C1aud3 opened this issue Jul 27, 2022 · 10 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request p1

Comments

@C1aud3
Copy link

C1aud3 commented Jul 27, 2022

The sudo gh net start command gives the following error:

choosing codespace: error getting codespaces: error making request: Get "https://api.github.com/user/codespaces?per_page=100": dial tcp 140.82.113.5:443: i/o timeout

Reproduce steps

  1. From my desktop, connect to my private enterprise network using a VPN client (Cisco AnyConnect 4.10.01075).
  2. Configure required enterprise proxy settings through the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.
  3. Optional: run gh codespace list to make sure proxy settings are configured properly.
  4. Run sudo gh net start. The command will fail with the error message provided above.

Expected behavior
The sudo gh net start command should display the list of codespaces to choose from successfully.

Desktop:

  • OS: macOS
  • Version 12.5
  • Platform architecture: Apple M1
  • gh version 2.14.3 (2022-07-26)

Additional context
The sudo gh net start command successfully displays the list of codespaces when NOT connected to VPN.

@C1aud3 C1aud3 added the bug Something isn't working label Jul 27, 2022
@legomushroom legomushroom self-assigned this Jul 29, 2022
@legomushroom
Copy link
Member

legomushroom commented Jul 29, 2022

@C1aud3 thanks for reporting this! Can you try connecting to the Codespace with SSH?

[sudo] gh codespace ssh

This should give us an idea if this is GH CLI issue or not.

Also mind trying the gh codespace list with sudo, e.g. sudo gh codespace list?

Thanks!

@C1aud3
Copy link
Author

C1aud3 commented Aug 1, 2022

@C1aud3 thanks for reporting this! Can you try connecting to the Codespace with SSH?

[sudo] gh codespace ssh

This should give us an idea if this is GH CLI issue or not.

Also mind trying the gh codespace list with sudo, e.g. sudo gh codespace list?

Thanks!

Hi @legomushroom ! The results are below. It looks like using sudo is causing issues.

  • gh codespace list: works fine ✅
  • sudo gh codespace list: ❌
    Fails with the following error:
- choosing codespace: error getting codespaces: error making request: Get "https://api.github.com/user/codespaces?per_page=100": dial tcp 140.82.113.5:443: i/o timeout
  • gh codespace ssh: works fine ✅
  • sudo gh codespace ssh: ❌
    Fails with the following error:
choosing codespace: error getting codespaces: error making request: Get "https://api.github.com/user/codespaces?per_page=100": dial tcp 140.82.112.6:443: i/o timeout

@legomushroom
Copy link
Member

@C1aud3 thanks for testing this!

Wondering if that is a credentials issue, mind trying this:

  1. gh auth status -t -> copy the token
  2. sudo gh auth logout
  3. echo {TOKEN} | sudo gh auth login --with-token
  4. Try connecting to a Codespace again(with sudo) 🤞

We will remove the sudo requirement in the next extension release 🚀

@C1aud3
Copy link
Author

C1aud3 commented Aug 4, 2022

Hi @legomushroom, unfortunately it didn't seem to solve the issue. Here's what I got:

  1. gh auth status -t -> copy the token : ✅
  2. sudo gh auth logout: ✅
    Note: The command works with sudo but takes over 30 seconds to execute. Running the command without sudo executes instantly.
  3. echo {TOKEN} | sudo gh auth login --with-token: ❌
  • Fails with: error validating token: Get "https://api.github.com/": dial tcp 140.82.114.6:443: i/o timeout
  • To proceed further, I had to login without using sudo
  1. Try connecting to a Codespace again(with sudo): ❌
  • Fails with the same dial tcp 140.82.112.5:443: i/o timeout error.

Hopefully the upcoming removal of the sudo requirement resolves this 🤞

@C1aud3
Copy link
Author

C1aud3 commented Aug 31, 2022

@legomushroom I confirm I'm still having the issue with the latest version of the plugin and running the gh net start command without sudo:

gh net start
Password:

choosing codespace: error getting codespaces: error making request: Get "https://api.github.com/user/codespaces?per_page=100": dial tcp 140.82.113.5:443: i/o timeout

Plugin version:

gh --version && gh extension list
gh version 2.14.7 (2022-08-25)
https://github.com/cli/cli/releases/tag/v2.14.7
gh net  github/gh-net  v0.12.2

@legomushroom
Copy link
Member

@C1aud3 mind trying this custom dev0.12.5-beta1 build? You can install it like this:

gh extension install legomushroom/gh-net

Thanks!

@C1aud3
Copy link
Author

C1aud3 commented Sep 19, 2022

@C1aud3 mind trying this custom dev0.12.5-beta1 build? You can install it like this:

gh extension install legomushroom/gh-net

Thanks!

I'll try to test this a little bit more extensively this week, but a quick test this morning allowed me to successfully list codespaces, select one and connect to it without any error messages. 🎉

@legomushroom
Copy link
Member

@C1aud3 thanks for trying it out! Looks like the issue was in missing some of the environment variables.

When we escalate to the root, we allow only few env variables to be inherited for the new escalated process. The custom build you've tried out is the same as released 0.12.4 but now allows for all env vars to be inherited by the new process.Do you know if your proxy setup use any env variables?

@C1aud3
Copy link
Author

C1aud3 commented Sep 21, 2022

Hi @legomushroom , thanks for the fix! Yes, my proxy setup uses env variables. As per my original posting:

Configure required enterprise proxy settings through the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.

@legomushroom legomushroom added enhancement New feature or request p1 labels Dec 5, 2022
@raphberube
Copy link

Hi @legomushroom,
I'm working with @C1aud3. Do you have any idea of when this fix will be officially released?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request p1
Projects
None yet
Development

No branches or pull requests

3 participants