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

[BUG] Timeout in the GraphQL API in private organizations (many repositories, with SSO enabled) #242

Open
wnqueiroz opened this issue Mar 8, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@wnqueiroz
Copy link

wnqueiroz commented Mar 8, 2023

Describe the bug

Hello Folks!

I installed the extension (without doing much configuration) and when running the gh dash command I get the following error message:

Post "https://api.github.com/graphql": dial tcp: lookup api.github.com: i/o timeout

Analyzing the source, I found no way to configure authentication settings for the GraphQL API...

Looking at the library that is used to access the GitHub API (https://github.com/cli/shurcooL-graphql), there is a setting to define the API access token (in the GRAPHQL_TOKEN environment environment variable) but I believe that it is not used throughout the project and no GraphQL client is created...

Am I doing something wrong? Does anyone else have this problem?

To Reproduce

I don't know how to best describe my environment, but here it is:

  • Private organization (with private repositories);
  • SSO enabled.

I'm just running the gh dash command from a private project and getting the timeout...

💡 The organization has more than 3k repositories... I don't know if the timeout problem is related to the actual authentication or just due to a large data fetch.

Expected behavior

Be able to view the dashboard by accessing private organization data (which uses SSO as authorization).

Screenshots

image

Desktop (please complete the following information):

  • OS: MacOSX Ventura 13.0.1
@wnqueiroz wnqueiroz added the bug Something isn't working label Mar 8, 2023
@wnqueiroz
Copy link
Author

cc @diego3g

@dlvhdr
Copy link
Owner

dlvhdr commented Mar 8, 2023

Hello!

Maybe you need to run gh auth login

@wnqueiroz
Copy link
Author

Hello!

Maybe you need to run gh auth login

@dlvhdr I thought it was something with the gh CLI authentication but I'm already authenticated...

image

I have 2 signs of what might be going on:

  • Authentication required by GitHub's GraphQL server (as it is a private organization); or
  • Timeout by the amount of repositories in the organization (as I mentioned, it's +3k 😅)

This second case is more difficult to reproduce... Does it make sense for you? If it's in the way, I'll try to implement something to solve the problem.

@carlosV2
Copy link

carlosV2 commented May 30, 2024

I'm having the same issue. Did you find a solution?

In order to cast a bit more light, I've run gh dash on public repositories and my company's organisation (21 repos) with no luck. I always get the same message no matter what repository I try.

In addition to this, when I run gh pr list I am presented with the list of PRs (which means that I'm correctly logged in and authorised to access those repositories).

In my case, however, the message is:

Post "https://api.github.com/graphql": dial tcp: lookup api.github.com on [::1]:53: read udp [::1]:45726->[::1]:53: read: connection refused

@dlvhdr
Copy link
Owner

dlvhdr commented May 30, 2024

Hmm gh-dash uses the official go client gh.DefaultGraphQLClient() from github.com/cli/go-gh/v2/pkg/api. Maybe it's a matter of updating the package?

@carlosV2
Copy link

Hi @dlvhdr, thanks for reaching out.

I installed both components today (fresh new Arch install):

~ ❯ gh --version     
gh version 2.50.0 (2024-05-29)
https://github.com/cli/cli/releases/tag/v2.50.0
~ ❯ gh extension list
NAME     REPO            VERSION
gh dash  dlvhdr/gh-dash  v4.0.0

I believe both of them are the latest version.

I tried it again now (after a reboot -just in case-) and I got the same result with a bit more information (although it doesn't seem to me to be more useful):
image

Any idea of what I could try? Many thanks.

@dlvhdr
Copy link
Owner

dlvhdr commented May 30, 2024

I think we will need to update the go module to the latest version https://github.com/cli/go-gh of 2.9.0 using go get

@carlosV2
Copy link

Apologies, I'm not that versed in the go world. I attempted running that command both alone and inside of gh but to not avail.

Please, could you let me know how could I run it? Thank you.

@dlvhdr
Copy link
Owner

dlvhdr commented Jun 1, 2024

@carlosV2 I updated the library, can you test with the latest version?

@carlosV2
Copy link

carlosV2 commented Jun 1, 2024

Hi @dlvhdr. Many thanks for the upgrade.

I believe gh extension install can only install releases or branch tags so I should do a manual install, right?

I've removed the extension and proceed with the manual installation instructions on the README but, when I run go build (after installing the go package), this is the output I get:

❯ go build
go: downloading github.com/charmbracelet/log v0.3.1
go: downloading github.com/charmbracelet/bubbletea v0.25.0
go: downloading github.com/charmbracelet/lipgloss v0.10.1-0.20240413172830-d0be07ea6b9c
go: downloading github.com/muesli/termenv v0.15.2
go: downloading github.com/spf13/cobra v1.8.0
go: downloading github.com/atotto/clipboard v0.1.4
go: downloading github.com/charmbracelet/bubbles v0.18.0
go: downloading github.com/cli/go-gh/v2 v2.9.0
go: downloading github.com/charmbracelet/glamour v0.7.0
go: downloading github.com/go-playground/validator/v10 v10.18.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/cli/shurcooL-graphql v0.0.4
go: downloading github.com/shurcooL/githubv4 v0.0.0-20240120211514-18a1ae0e79dc
go: downloading github.com/gen2brain/beeep v0.0.0-20240112042604-c7bb2cd88fea
cmd/root.go:14:2: github.com/charmbracelet/bubbletea@v0.25.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbletea/@v/v0.25.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:48651->[::1]:53: read: connection refused
cmd/root.go:15:2: github.com/charmbracelet/lipgloss@v0.10.1-0.20240413172830-d0be07ea6b9c: Get "https://proxy.golang.org/github.com/charmbracelet/lipgloss/@v/v0.10.1-0.20240413172830-d0be07ea6b9c.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:48651->[::1]:53: read: connection refused
cmd/root.go:16:2: github.com/charmbracelet/log@v0.3.1: Get "https://proxy.golang.org/github.com/charmbracelet/log/@v/v0.3.1.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:48651->[::1]:53: read: connection refused
ui/ui.go:10:2: github.com/atotto/clipboard@v0.1.4: Get "https://proxy.golang.org/github.com/atotto/clipboard/@v/v0.1.4.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/ui.go:11:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/ui.go:12:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/ui.go:16:2: github.com/cli/go-gh/v2@v2.9.0: Get "https://proxy.golang.org/github.com/cli/go-gh/v2/@v/v2.9.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:39084->[::1]:53: read: connection refused
config/parser.go:12:2: github.com/go-playground/validator/v10@v10.18.0: Get "https://proxy.golang.org/github.com/go-playground/validator/v10/@v/v10.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:41688->[::1]:53: read: connection refused
config/parser.go:13:2: gopkg.in/yaml.v2@v2.4.0: Get "https://proxy.golang.org/gopkg.in/yaml.v2/@v/v2.4.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:41688->[::1]:53: read: connection refused
data/issueapi.go:8:2: github.com/cli/go-gh/v2@v2.9.0: Get "https://proxy.golang.org/github.com/cli/go-gh/v2/@v/v2.9.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:39084->[::1]:53: read: connection refused
data/issueapi.go:9:2: github.com/cli/shurcooL-graphql@v0.0.4: Get "https://proxy.golang.org/github.com/cli/shurcoo%21l-graphql/@v/v0.0.4.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:52515->[::1]:53: read: connection refused
data/prapi.go:11:2: github.com/shurcooL/githubv4@v0.0.0-20240120211514-18a1ae0e79dc: Get "https://proxy.golang.org/github.com/shurcoo%21l/githubv4/@v/v0.0.0-20240120211514-18a1ae0e79dc.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:52515->[::1]:53: read: connection refused
ui/components/footer/footer.go:6:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/components/issuesidebar/issuesidebar.go:8:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/components/issuesidebar/activity.go:8:2: github.com/charmbracelet/glamour@v0.7.0: Get "https://proxy.golang.org/github.com/charmbracelet/glamour/@v/v0.7.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:43683->[::1]:53: read: connection refused
ui/components/listviewport/listviewport.go:6:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/components/prompt/prompt.go:4:2: github.com/charmbracelet/bubbles@v0.18.0: Get "https://proxy.golang.org/github.com/charmbracelet/bubbles/@v/v0.18.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:51811->[::1]:53: read: connection refused
ui/markdown/markdownRenderer.go:5:2: github.com/charmbracelet/glamour@v0.7.0: Get "https://proxy.golang.org/github.com/charmbracelet/glamour/@v/v0.7.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:43683->[::1]:53: read: connection refused
ui/components/prssection/watchChecks.go:10:2: github.com/gen2brain/beeep@v0.0.0-20240112042604-c7bb2cd88fea: Get "https://proxy.golang.org/github.com/gen2brain/beeep/@v/v0.0.0-20240112042604-c7bb2cd88fea.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:40448->[::1]:53: read: connection refused
cmd/root.go:17:2: github.com/muesli/termenv@v0.15.2: Get "https://proxy.golang.org/github.com/muesli/termenv/@v/v0.15.2.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:48651->[::1]:53: read: connection refused
cmd/root.go:18:2: github.com/spf13/cobra@v1.8.0: Get "https://proxy.golang.org/github.com/spf13/cobra/@v/v1.8.0.zip": dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:41235->[::1]:53: read: connection refused

Some of those lines look an awful lot like the one I was getting inside gh dash.

As it seems to be network related, I tried to grab one of the failed links and pasted it in the browser and it successfully downloaded the file. I've also run the go build command from a different network (mobile 4G instead of WiFi) but got the same result.

Nevertheless, I tried to continue with the manual installation but (un)surprisingly, it fails to run gh dash.

Like I said, I'm not into the go world. Do you think there is something I am doing wrong?

Many thanks for all your help!

@carlosV2
Copy link

carlosV2 commented Jun 1, 2024

Here is another insight:

Not sure why, it just occurred to me that it could be a permissions issue so I've run Arch within docker and, surprise!, it seems to work.
I've also taken the opportunity to run the manual install in this root environment and the go build command also worked flawlessly.

Granted the difference could be on the gh login mechanism (I haven't used the same) so I re-logged in in my local machine using the same authentication method and parameters but I still can't get it working which means that the only difference with the docker environment was the root permissions.

Does any of this make any sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants