Giter VIP home page Giter VIP logo

Comments (11)

aofei avatar aofei commented on June 1, 2024

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.

gcstang avatar gcstang commented on June 1, 2024

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.

aofei avatar aofei commented on June 1, 2024

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.

gcstang avatar gcstang commented on June 1, 2024

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.

aofei avatar aofei commented on June 1, 2024

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.

gcstang avatar gcstang commented on June 1, 2024

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.

Ah, thank you

from goproxy.

gcstang avatar gcstang commented on June 1, 2024

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.

gcstang avatar gcstang commented on June 1, 2024

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.

aofei avatar aofei commented on June 1, 2024

What if you set Goproxy.GoBinMaxWorkers to 1?

from goproxy.

gcstang avatar gcstang commented on June 1, 2024

What if you set Goproxy.GoBinMaxWorkers to 1?

Not sure what happened, I can't duplicate it now after restarting IntelliJ.
Thanks anyway.

from goproxy.

aofei avatar aofei commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.