Comments (11)
The issue is that if I push a new version of a module and try to perform go get then it doesn't find the new version unless I perform a go mod download first.
That's because of the caching mechanism of the upstream proxy you are using.
then it say's downloading but then never completes.
What do you mean by "never"? Does your go get
operation get stuck?
I just tried the simplest program below and everything works fine for me.
package main
import (
"net/http"
"os"
"github.com/goproxy/goproxy"
)
func main() {
http.ListenAndServe("localhost:8080", &goproxy.Goproxy{
GoBinEnv: append(
os.Environ(),
"GOPROXY=direct",
"GOSUMDB=off",
),
})
}
from goproxy.
The issue is that if I push a new version of a module and try to perform go get then it doesn't find the new version unless I perform a go mod download first.
That's because of the caching mechanism of the upstream proxy you are using.
then it say's downloading but then never completes.
What do you mean by "never"? Does your
go get
operation get stuck?I just tried the simplest program below and everything works fine for me.
package main import ( "net/http" "os" "github.com/goproxy/goproxy" ) func main() { http.ListenAndServe("localhost:8080", &goproxy.Goproxy{ GoBinEnv: append( os.Environ(), "GOPROXY=direct", "GOSUMDB=off", ), }) }
Yes it get stuck, using what I have below but with GOPROXY set to direct.
I'll try with "GOSUMDB=off" that you have above.
from goproxy.
It should be noted that the direct
usually takes time (depending on your internet network connectivity). Maybe you should try go get
a smaller module, like go get rsc.io/sampler
.
from goproxy.
I tried this now and I'm getting odd results same code as I originally posted but using direct
"GOPROXY=direct"
Command I try: go list -m -versions github.com/blang/semver
Results:
github.com/blang/semver v1.0.0 v1.0.1 v1.0.2 v1.0.3 v1.0.4 v1.1.0 v2.0.0+incompatible v2.0.1+incompatible v2.0.2+incompatible v2.1.0+incompatible v2.2.0+incompatible
If I change to "GOPROXY=https://proxy.golang.org,direct"
Command I try: go list -m -versions github.com/blang/semver
Results:
github.com/blang/semver v1.0.0 v1.0.1 v1.0.2 v1.0.3 v1.0.4 v1.1.0 v2.0.0+incompatible v2.0.1+incompatible v2.0.2+incompatible v2.1.0+incompatible v2.2.0+incompatible v3.0.0+incompatible v3.0.1+incompatible v3.1.0+incompatible v3.2.0+incompatible v3.3.0+incompatible v3.4.0+incompatible v3.5.0+incompatible v3.5.1+incompatible
If I go to the project in Github I can see there are other tags that aren't shown either way, if I'm using direct shouldn't these show?
v3.6.0 v3.6.1 v3.7.0 v3.8.0 v4.0.0
from goproxy.
These are all correct results.
The reason your direct
result is different from the proxy.golang.org
is because that module's author has deleted some tags (after the proxy.golang.org
caches them) that existed before.
And you will never get v3.6.0 v3.6.1 v3.7.0 v3.8.0 v4.0.0
because of this.
from goproxy.
These are all correct results.
The reason your
direct
result is different from theproxy.golang.org
is because that module's author has deleted some tags (after theproxy.golang.org
caches them) that existed before.And you will never get
v3.6.0 v3.6.1 v3.7.0 v3.8.0 v4.0.0
because of this.
Ah, thank you
from goproxy.
Is there a way to get more verbose logging?
When I run go mod tidy
on a new project I see lines like this
go: finding module for package github.com/xxx/utils/file
go: finding module for package github.com/xxx/utils/lock
go: finding module for package github.com/xxx/utils/shutdown
...
Then it gets stuck on this line:
go: downloading github.com/xxx/utils v0.0.0-20210903160913-e621d09ede7b
Using
"GOPROXY=direct", "GOSUMDB=off",
from goproxy.
Ok I was attempting this on the Terminal inside of IntelliJ and it got stuck everytime.
I attempted to just try it from a regular command line using iTerm2 and it worked. Not sure what would cause it inside of the IntelliJ terminal but all environment variables are the same.
from goproxy.
What if you set Goproxy.GoBinMaxWorkers
to 1
?
from goproxy.
What if you set
Goproxy.GoBinMaxWorkers
to1
?
Not sure what happened, I can't duplicate it now after restarting IntelliJ.
Thanks anyway.
from goproxy.
Hi @gcstang!
It has been two years since the last contact. I have some news to share about this problem you're having, you know, in case you're still interested.
I believe this problem is caused by misuse of shared GOMODCACHE
, and the solution is to make your Goproxy process have its own GOMODCACHE
. Please see #44 (comment) for more details.
I'm going to close this issue now.
from goproxy.
Related Issues (20)
- 可以使用 goproxy 解决私有 GitLab 仓库问题吗? HOT 9
- goproxy 无法代理私有 GitLab多级子目录问题 HOT 4
- 请求某个资源时容易出现500错误 HOT 2
- 自建goproxy,私有包拉取不了 HOT 8
- failed to list module versions HOT 5
- 代理有时会产生http2: server sent GOAWAY and closed the connection错误 HOT 3
- 无法拉取gitlab中的私有包 HOT 18
- goproxy responds with HTTP/1.0 on response to CONNECT, some clients do not support this HOT 1
- Disable-Module-Fetch: true header support HOT 1
- server panic HOT 2
- is there a changelog? HOT 1
- goproxy redirect http proxy to transparent proxy cause some http quest 400 error HOT 1
- support /@latest endpoint HOT 4
- [BUG] go get stuck and server output git error HOT 6
- 拉取私有仓库问题 HOT 2
- 502了 HOT 1
- connections staying open HOT 1
- Dockerfile use nobody user, but git lfs install with root
- Dockerfile go version 需要更新 HOT 1
- MITM proxy option always uses HTTP/1.1 connection to client, can it use HTTP/2? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goproxy.