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

Proxies with port 80 are stripped of their port #759

Closed
JasonLaquaTR opened this issue Oct 15, 2020 · 2 comments · Fixed by #760
Closed

Proxies with port 80 are stripped of their port #759

JasonLaquaTR opened this issue Oct 15, 2020 · 2 comments · Fixed by #760
Labels
bug Something isn't working

Comments

@JasonLaquaTR
Copy link
Contributor

JasonLaquaTR commented Oct 15, 2020

Describe the bug
Proxies are stripped of their port if it is 80. This causes anything that uses libcurl to fail because it's default proxy port is 1080.

To Reproduce
Steps to reproduce the behavior:

  1. Setup self-hosted runner
  2. Add https_proxy with port 80 in .env file (ex. https_proxy=http://proxy:80)
  3. Start runner
  4. Configure and run workflow to use something that uses libcurl (ex. checkout plugin)
  5. See operation timeout error with proxy port set to 1080
  6. You can also print the environment variables and see that port 80 has been stripped from https_proxy

Related Issue: actions/checkout#216

Expected behavior
Keep port 80 as a part of the proxy environment variable

Runner Version and Platform

Version of your runner?
2.273.5
OS of the machine running the runner? OSX/Windows/Linux/...
OSX and Linux

What's not working?

Environment variable is being stripped of proxy port
Expected

http_proxy=http://proxy:80
HTTP_PROXY=http://proxy:80
https_proxy=http://proxy:80
HTTPS_PROXY=http://proxy:80

Actual

http_proxy=http://proxy/
HTTP_PROXY=http://proxy/
https_proxy=http://proxy/
HTTPS_PROXY=http://proxy/

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

fatal: unable to access 'https://github.com/actions/runner.git/': Failed to connect to proxy port 1080: Operation timed out
The process '/usr/bin/git' failed with exit code 128

Code causing problem

RunnerWebProxy.cs:72-130

@JasonLaquaTR JasonLaquaTR added the bug Something isn't working label Oct 15, 2020
JasonLaquaTR added a commit to JasonLaquaTR/runner that referenced this issue Oct 15, 2020
TingluoHuang added a commit that referenced this issue Nov 3, 2020
* Fixes #759 doesn't change proxy environment variables

* Update RunnerWebProxy.cs

* Update RunnerWebProxyL0.cs

Co-authored-by: Tingluo Huang <tingluohuang@github.com>
AdamOlech pushed a commit to antmicro/runner that referenced this issue Jan 28, 2021
…#760)

* Fixes actions#759 doesn't change proxy environment variables

* Update RunnerWebProxy.cs

* Update RunnerWebProxyL0.cs

Co-authored-by: Tingluo Huang <tingluohuang@github.com>
TingluoHuang added a commit that referenced this issue Apr 21, 2021
* Fixes #759 doesn't change proxy environment variables

* Update RunnerWebProxy.cs

* Update RunnerWebProxyL0.cs

Co-authored-by: Tingluo Huang <tingluohuang@github.com>
@mayur-kumar1
Copy link

@JasonLaquaTR Looks like its still happening with v2.294.0. We have a few self-hosted runner pods running on GKE. We are behind a corporate proxy, but the proxy still changes to 1080.
the http_proxy variable is http://ep.threatpulse.net:80

Error: fatal: unable to access 'https://github.com/lbg-gcp-foundation/***-android-core/': Failed to connect to ep.threatpulse.net port 1080: Operation timed out

Do I need to do something at my end to resolve this?

@SCE-sotoodaa
Copy link

SCE-sotoodaa commented Aug 24, 2023

Also running into this same issue as of today with version v2.308.
@mayur-kumar1 were you able to find a workaround or resolution for this?

Logs when running --check:

2023-08-24T04:49:40.4791637Z Runner is behind http proxy 'http://myproxy/'
2023-08-24T04:49:40.4812906Z Run 'git -c http.proxy=http://myproxy/ ls-remote --exit-code https://...@github.com/actions/checkout HEAD'
2023-08-24T04:49:40.5141314Z trace: built-in: git 'ls-remote' '--exit-code' 'https://gh:.../actions/checkout' 'HEAD'
2023-08-24T04:49:40.5141355Z trace: run_command: 'git-remote-https' 'https://gh:...@github.com/actions/checkout' 'https://gh:...@github.com/actions/checkout'
2023-08-24T04:49:40.5154663Z * Couldn't find host github.com in the .netrc file; using defaults
2023-08-24T04:49:40.5198621Z * About to connect() to proxy myproxy on port 1080 (#0)
2023-08-24T04:49:40.5199057Z *   Trying X.X.X.X...
2023-08-24T04:51:47.6987648Z * Connection timed out
2023-08-24T04:51:47.6988288Z * Failed connect to myproxy:1080; Connection timed out
2023-08-24T04:51:47.6988328Z * Closing connection 0
2023-08-24T04:51:47.6988331Z fatal: unable to access 'https://gh:...@github.com/actions/checkout/': Failed connect to myproxy:1080; Connection timed out
2023-08-24T04:51:47.7023770Z ***************************************************************************************************************
2023-08-24T04:51:47.7023833Z ****                                                                                                       ****
2023-08-24T04:51:47.7023850Z ****     git ls-remote failed with error: GitHub.Runner.Sdk.ProcessExitCodeException: Exit code 128 returned from process: file name '/usr/bin/git', arguments '-c http.proxy=http://myproxy/ ls-remote --exit-code https://gh:...@github.com/actions/checkout HEAD'.
   at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
   at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
   at GitHub.Runner.Listener.Check.GitCheck.CheckGit(String url, String pat, Boolean extraCA)
2023-08-24T04:51:47.7125111Z ****                                                               

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

Successfully merging a pull request may close this issue.

3 participants