Hi,
I reported a while ago that I could not get Golang proxy repository to work in Nexus. I have updated Sonatype Nexus to the latest released official Docker image from Sonatype but the problem remains. I am trying to do the very simple example given on here. My proxy repo configuration is shown in the screenshot.
The only differences from the screenshot in the linked example are that I have configured mine to use the Nexus repository truststore and I have set Maximum metadata age to -1. Also, I am running Go in the official Golang container.
When I follow the exact instructions given in the linked example, on a normal, internet-connected machine, after setting $GOPROXY environment variable to point to the Nexus Golang proxy repo, I have set up, everything works fine, as per the linked example.
However, our main use case for Nexus is as a proxy accessible from a non-internet connected network and that’s where the problem comes. I should say we already use this Nexus server for proxying apt, yum, PyPI and DockerHub repos and these all work fine from the non-interconnected network, but I have now been requested to add GoLang proxy.
When I follow the exact same instructions on the non-internet connected machine, this is what I see when I run GODEBUG=mod=1,gocacheverify=1 go mod tidy -v -x as per the example:
root@ddb1faf21e24:~# GODEBUG=mod=1,gocacheverify=1 go mod tidy -v -x
# get http://srv-uv-nexus.mac.local:8083/repository/mac-go-proxy/sumdb/sum.golang.org/supported
# get http://srv-uv-nexus.mac.local:8083/repository/mac-go-proxy/sumdb/sum.golang.org/supported: 404 Not Found (0.020s)
# get https://sum.golang.org/lookup/github.com/beego/beego/v2@v2.3.8
# get https://sum.golang.org/lookup/github.com/beego/beego/v2@v2.3.8: Get "https://sum.golang.org/lookup/github.com/beego/beego/v2@v2.3.8": dial tcp 142.251.30.141:443: connect: connection refused
github.com/beego/beego/v2@v2.3.8: verifying module: github.com/beego/beego/v2@v2.3.8: Get "https://sum.golang.org/lookup/github.com/beego/beego/v2@v2.3.8": dial tcp 142.251.30.141:443: connect: connection refused
root@ddb1faf21e24:~#
and the proxy repository remains empty.
Changing the Nexus repository truststore and Maximum metadata age configuration settings to exactly match those in the linked example does not make any difference, it still doesn’t work.
I’m not familiar with Go repositories/modules/packages etc., Go is not my primary programming language, but I was hoping by creating the repo in Nexus and setting $GOPROXY to point to it on my client VM/container, that would ‘just work’ like the example, and all dependencies would come down through the proxy.
Can anyone tell me what I might be doing wrong? For example, do I need some other environment variable set on the machine/container I’m running the Go example program on, in addition to GOPROXY? Or is it a bug in Nexus? Any help would be very much appreciated.
Tom
