dial tcp: lookup proxy.golang.org [..] connection refused
HI! I'm trying to build a Go package on https://build.opensuse.org and it seems the Go modules are downloaded via proxy.golang.org. Some packages seem to download just fine but one fails: dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:58763->[::1]:53: read: connection refused I guess the DNS resolver trys to switch to TCP but this gets blocked. Never built a Go package before so I'm not sure whether it's correct [1]. Ciao, Michael. [1] https://build.opensuse.org/package/show/home:stroeder:network/galene
On Fri, Jan 15, 2021 at 2:09 PM Michael Ströder
HI!
I'm trying to build a Go package on https://build.opensuse.org and it seems the Go modules are downloaded via proxy.golang.org.
Some packages seem to download just fine but one fails:
dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:58763->[::1]:53: read: connection refused
I guess the DNS resolver trys to switch to TCP but this gets blocked.
Never built a Go package before so I'm not sure whether it's correct [1].
I guess the Go compiler in openSUSE is missing a patch to disable the mandatory proxy used for fetching dependencies from the internet. https://src.fedoraproject.org/rpms/golang/blob/master/f/0003-cmd-go-disable-... Without that, Go compiler builds that use modules (even vendored) can fail. -- 真実はいつも一つ!/ Always, there's only one truth!
On 1/15/21 8:14 PM, Neal Gompa wrote:
On Fri, Jan 15, 2021 at 2:09 PM Michael Ströder
wrote: I'm trying to build a Go package on https://build.opensuse.org and it seems the Go modules are downloaded via proxy.golang.org.
Some packages seem to download just fine but one fails:
dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:58763->[::1]:53: read: connection refused
I guess the DNS resolver trys to switch to TCP but this gets blocked.
Never built a Go package before so I'm not sure whether it's correct [1].
I guess the Go compiler in openSUSE is missing a patch to disable the mandatory proxy used for fetching dependencies from the internet.
https://src.fedoraproject.org/rpms/golang/blob/master/f/0003-cmd-go-disable-...
Without that, Go compiler builds that use modules (even vendored) can fail.
But how does OBS get the Go modules, if not via proxy? AFAIK OBS has only *very* limited access to the outside. Ciao, Michael.
On Fri, Jan 15, 2021 at 2:24 PM Michael Ströder
On 1/15/21 8:14 PM, Neal Gompa wrote:
On Fri, Jan 15, 2021 at 2:09 PM Michael Ströder
wrote: I'm trying to build a Go package on https://build.opensuse.org and it seems the Go modules are downloaded via proxy.golang.org.
Some packages seem to download just fine but one fails:
dial tcp: lookup proxy.golang.org on [::1]:53: read udp [::1]:58763->[::1]:53: read: connection refused
I guess the DNS resolver trys to switch to TCP but this gets blocked.
Never built a Go package before so I'm not sure whether it's correct [1].
I guess the Go compiler in openSUSE is missing a patch to disable the mandatory proxy used for fetching dependencies from the internet.
https://src.fedoraproject.org/rpms/golang/blob/master/f/0003-cmd-go-disable-...
Without that, Go compiler builds that use modules (even vendored) can fail.
But how does OBS get the Go modules, if not via proxy? AFAIK OBS has only *very* limited access to the outside.
It doesn't get them at all. There is no access to the outside in the OBS build environment. You need to generate a vendor tarball and add it as a source. Or package up the dependencies and add them as BuildRequires. -- 真実はいつも一つ!/ Always, there's only one truth!
On 1/15/21 8:40 PM, Neal Gompa wrote:
On Fri, Jan 15, 2021 at 2:24 PM Michael Ströder
wrote: But how does OBS get the Go modules, if not via proxy? AFAIK OBS has only *very* limited access to the outside.
It doesn't get them at all. There is no access to the outside in the OBS build environment.
You need to generate a vendor tarball and add it as a source. I fail to extract this info from Go packaging instructions [1].
Do you know a good example package? Ciao, Michael. [1] https://en.opensuse.org/openSUSE:Packaging_Go
________________________________________
From: Michael Ströder
On Fri, Jan 15, 2021 at 2:24 PM Michael Ströder
wrote: But how does OBS get the Go modules, if not via proxy? AFAIK OBS has only *very* limited access to the outside.
It doesn't get them at all. There is no access to the outside in the OBS build environment.
You need to generate a vendor tarball and add it as a source.
Hello Michael, Yes, OBS is a fully offline environment and go tools assume online access, defaulting to the community proxy. The OBS source service obs-service-go_modules [1] installed locally will automate the process for offline use. The hugo package [2] provides a _service and RPM .spec usage example. As of go1.14+, go build mode "-mod=vendor" is set automatically when directory /vendor is detected. Network access is not attempted in this mode. For additional control the GOPROXY=off environment variable is available [3] to ensure go commands in module mode are disallowed from using the network for dependencies. I would recommend not setting GOPROXY as the default behavior is sufficient, and please let me know if you do encounter network access attempts when using the defaults. Jeff [1] https://github.com/openSUSE/obs-service-go_modules [2] https://build.opensuse.org/package/show/devel:languages:go/hugo [3] https://github.com/thepudds/go-module-knobs/blob/master/README.md#list-of-go... -- Jeff Kowalczyk Software Engineer, Go Developer Experience SUSE Linux Email jkowalczyk@suse.com Timezone US/Pacific http://suse.com
On 1/15/21 10:58 PM, Jeff Kowalczyk wrote:
Yes, OBS is a fully offline environment and go tools assume online access, defaulting to the community proxy. The OBS source service obs-service-go_modules [1] installed locally will automate the process for offline use. The hugo package [2] provides a _service and RPM .spec usage example.> As of go1.14+, go build mode "-mod=vendor" is set automatically when directory /vendor is detected.
Many thanks for your response. I tried to adapt my package accordingly [1]. But using obs-service-go_modules does not work for me: $ osc service disabledrun merge: origin/galene-0.2 - not something we can merge Already up to date. 5f7455af5bf78c837008e80fe4b67809badce3c0 Identical target file galene-0.2.tar.xz already exists, skipping.. INFO:obs-service-go_modules:Autodetecting archive since no archive param provided in _service ERROR:obs-service-go_modules:Archive autodetection found no matching archive under /home/michael/Proj/obs/home:stroeder:network/galene Aborting: service call failed: /usr/lib/obs/service/go_modules --outdir /home/michael/Proj/obs/home:stroeder:network/galene/tmprbxt1c5s.go_modules.service Ciao, Michael. [1] https://build.opensuse.org/package/show/home:stroeder:network/galene
________________________________________
From: Michael Ströder
Many thanks for your response. I tried to adapt my package accordingly [1]. But using obs-service-go_modules does not work for me:
$ osc service disabledrun merge: origin/galene-0.2 - not something we can merge Already up to date. 5f7455af5bf78c837008e80fe4b67809badce3c0 Identical target file galene-0.2.tar.xz already exists, skipping.. INFO:obs-service-go_modules:Autodetecting archive since no archive param provided in _service ERROR:obs-service-go_modules:Archive autodetection found no matching archive under /home/michael/Proj/obs/home:stroeder:network/galene Aborting: service call failed: /usr/lib/obs/service/go_modules --outdir /home/michael/Proj/obs/home:stroeder:network/galene/tmprbxt1c5s.go_modules.service
Ciao, Michael.
[1] https://build.opensuse.org/package/show/home:stroeder:network/galene
Thanks for the link to your galene package (a videoconferencing server). The first obstacle we'll need to work around is upstream not tagging releases as compliant go module version strings: "galene-0.2' should be "v0.2.0" per https://golang.org/ref/mod#versions ("Each version starts with the letter v, followed by a semantic version."). It may be best to do this in _service tar_scm version_rewrite. I suggest we move this discussion of go module specifics to the https://lists.opensuse.org/archives/list/go@lists.opensuse.org/ , where I would welcome the list traffic and opportunity to work through galene issues in the open for the benefit of others. Tomorrow I'll start a thread there, file an issue with upstream re: versioning and next week work on an SR with a workaround for your package. Thanks for bringing this corner case to my attention. Jeff -- Jeff Kowalczyk Software Engineer, Go Developer Experience SUSE Linux Email jkowalczyk@suse.com Timezone US/Pacific http://suse.com
participants (3)
-
Jeff Kowalczyk
-
Michael Ströder
-
Neal Gompa