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

Example site, Go commands don't appear to be using proxy #992

Closed
jasonday opened this issue Apr 27, 2022 · 5 comments
Closed

Example site, Go commands don't appear to be using proxy #992

jasonday opened this issue Apr 27, 2022 · 5 comments

Comments

@jasonday
Copy link
Contributor

Running hugo server and getting the following errors:

hugo: downloading modules …
go: github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/a81254f0cf90f611158215d1cb50586eccc323b54ab825bb7e9c8b2580ac9fb3: exit status 128:
	fatal: unable to access 'https://github.com/FortAwesome/Font-Awesome/': Failed to connect to github.com port 443: Operation timed out
go: github.com/google/docsy@v0.2.0: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/98f59a39bbbc2d4de9185a32a3d8790111161ae9778e3e5e32a90c95f026ac9b: exit status 128:
	fatal: unable to access 'https://github.com/google/docsy/': Failed to connect to github.com port 443: Operation timed out
go: github.com/twbs/bootstrap@v4.6.1+incompatible: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/452026f8ece4b6e04adce745be52bb14c2f2b65baffde3e5ebfe0112a044536d: exit status 128:
	fatal: unable to access 'https://github.com/twbs/bootstrap/': Failed to connect to github.com port 443: Operation timed out
hugo: collected modules in 106159 ms
Error: failed to download modules: failed to execute 'go [mod download]': failed to execute binary "go" with args [mod download]: go: github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/a81254f0cf90f611158215d1cb50586eccc323b54ab825bb7e9c8b2580ac9fb3: exit status 128:
	fatal: unable to access 'https://github.com/FortAwesome/Font-Awesome/': Failed to connect to github.com port 443: Operation timed out
go: github.com/google/docsy@v0.2.0: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/98f59a39bbbc2d4de9185a32a3d8790111161ae9778e3e5e32a90c95f026ac9b: exit status 128:
	fatal: unable to access 'https://github.com/google/docsy/': Failed to connect to github.com port 443: Operation timed out
go: github.com/twbs/bootstrap@v4.6.1+incompatible: invalid version: git ls-remote -q origin in /var/folders/56/cm8gd_sj6vx5wwwl3x3wyc_cmskj1x/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/452026f8ece4b6e04adce745be52bb14c2f2b65baffde3e5ebfe0112a044536d: exit status 128:
	fatal: unable to access 'https://github.com/twbs/bootstrap/': Failed to connect to github.com port 443: Operation timed out
 *errors.errorString

I have a corporate proxy setup in my .gitconfig, which works otherwise except for when I run hugo server. Is ther e any workaround to install the modules manually?

@deining
Copy link
Collaborator

deining commented Apr 27, 2022

Haven't tested this by myself, but according to the hugo docs you can set a proxy in the top level module configuration:

[module]
  proxy = 'my.proxy.tld'
  ...

Alternatively, you can set the environmemt variable HUGO_MODULE_PROXY.

Does any of this solutions make your download error go away?

@jasonday
Copy link
Contributor Author

jasonday commented Apr 27, 2022

@deining unfortunately, my corporate proxy is http:, so using either method I am getting:

go: github.com/FortAwesome/Font-Awesome@v0.0.0-20210804190922-7d3d774145ac: refusing to pass credentials to insecure URL: http://:xxxxx@proxy.corp.com:8001/github.com/%21fort%21awesome/%21font-%21awesome/@v/v0.0.0-20210804190922-7d3d774145ac.info
...

@deining
Copy link
Collaborator

deining commented Apr 27, 2022

According to this issue, sending credentials to an insecure GOPROXY will never be supported.
As a workaround, they suggest that you set up a server at localhost with a valid HTTPS certificate that connects to your http proxy. Instructions on this can be found here and here.
Does this help to solve your issue eventually?

@deining
Copy link
Collaborator

deining commented May 16, 2022

With PR #994 merged now, the proxy setting is now mentioned the user guide.

@jasonday: can this ticket be closed now?

@jasonday
Copy link
Contributor Author

Not directly, but it appears this is additional documentation that may be helpful for others. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants