albinvass opened a new issue, #5502:
URL: https://github.com/apache/incubator-devlake/issues/5502

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   Devlake github connections for git and graphql data doesn't reach github 
when run behind a corporate http proxy. Instead the connection times out since 
direct connections are blocked by firewall rules:
   
   ```
   time="2023-06-13 16:20:24" level=error msg=" [pipeline service] [pipeline 
#6] [task #48] run task failed with panic
        caused by: run task failed with panic 
(github.com/apache/incubator-devlake/helpers/pluginhelper/api.CreateAsyncGraphqlClient:71)
        Wraps: (2) Post "https://api.github.com/graphql": dial tcp 
140.82.121.6:443: i/o timeout
        Wraps: (3) Post "https://api.github.com/graphql";
        Wraps: (4) dial tcp 140.82.121.6:443
        Wraps: (5) i/o timeout
        Error types: (1) *hintdetail.withDetail (2) *hintdetail.withDetail (3) 
*url.Error (4) *net.OpError (5) *net.timeoutError"
   ```
   The plugin fails when it tries to get it's remaining graphql quota:
   
https://github.com/apache/incubator-devlake/blob/main/backend/plugins/github_graphql/impl/impl.go#L172
   Which uses the oauth2 client created here:
   
https://github.com/apache/incubator-devlake/blob/main/backend/plugins/github_graphql/impl/impl.go#L163
   
   I tried to fix this by changing the contexts `http.Client` as explained here:
   https://go.googlesource.com/oauth2/+/refs/heads/master/oauth2.go#332
   However my experience with go is limited so I could never get it to work.
   
   
   As a workaround we set `HTTP_PROXY` environment variables to configure both 
git and graphql for now.
   
   ### What do you expect to happen
   
   Both github graphql and git should be able to reach github throught the 
proxy.
   
   ### How to reproduce
   
   Block direct traffic to github and force the application to go through an 
http_proxy and the graphql and git collector fail.
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   v0.17.0-beta5
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to