gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

Error parsing go.mod module declares its path as: github.com/google/gnostic but was required as: github.com/googleapis/gnostic

Open alsofr opened this issue 4 years ago • 15 comments

Hi, the recent change of the module name (from googleapis to google) causes the go get -u ./... command to fail in our project where gnostic is listed as an indirect dependency.

go get: github.com/googleapis/[email protected]: parsing go.mod:
	module declares its path as: github.com/google/gnostic
	        but was required as: github.com/googleapis/gnostic

https://github.com/google/gnostic/pull/259

Manually changing the name and version in the mod file doesn't help.

Is there a recommended smooth update path?

alsofr avatar Oct 11 '21 05:10 alsofr

There isn't a good workaround at the moment for renaming GitHub repositories without breaking Go module users.

I suggest rolling back the name change until https://github.com/golang/go/issues/26904 and/or https://github.com/golang/go/issues/30831 is fixed in the Go toolchain, or moving the repository back to its original name and starting a new (separate) repository for the github.com/google/gnostic path.

bcmills avatar Oct 11 '21 15:10 bcmills

Thanks for the answer and the link @bcmills, it's comforting to see that I'm not the only one struggling with this :) What is your preferred solution then? Rolling back the change is quite easier, I'm not sure how long it will take for one of the two PRs above to be merged.

alsofr avatar Oct 18 '21 08:10 alsofr

Any news about fixing this? I've got bitten when trying to upgrade the dependencies of a project and now this repo reshuffle blocks this as an indirect dependency stopping go get -u. Please undo this, please!

thediveo avatar Nov 05 '21 15:11 thediveo

The issue goes away when upgrading to go 1.17.3, at least for me.

alsofr avatar Nov 08 '21 07:11 alsofr

Depending on your product build requirements you cannot simply update go just because some module decided to break its import path, and this change has already propagated into other modules depending on it, so projects end up in a dependency hell. This is exactly I was warned of: go modules not being mature and go being not ripe for productivity with lots of complex dependencies. I have to admit: the critics are right on spot here.

thediveo avatar Nov 08 '21 08:11 thediveo

I just thought I would mention it in case someone has the opportunity to upgrade go. If you have to stay on the same golang version, then obviously that solution doesn't help you :(

alsofr avatar Nov 08 '21 08:11 alsofr

The issue goes away when upgrading to go 1.17.3, at least for me.

Not for me

Bysmyyr avatar Nov 15 '21 08:11 Bysmyyr

The issue goes away when upgrading to go 1.17.3, at least for me.

Not for me

Not for me too, is there any other solution ?

enjoyliu avatar Nov 17 '21 08:11 enjoyliu

The issue goes away when upgrading to go 1.17.3, at least for me.

Not for me

Not for me too, is there any other solution ?

Atleast error went away after adding this to replases: github.com/googleapis/gnostic => github.com/google/gnostic v0.5.7-0.20211028223514-b1b34ea319d3

Bysmyyr avatar Nov 17 '21 09:11 Bysmyyr

The issue goes away when upgrading to go 1.17.3, at least for me.

Not for me

Not for me too, is there any other solution ?

Atleast error went away after adding this to replases: github.com/googleapis/gnostic => github.com/google/gnostic v0.5.7-0.20211028223514-b1b34ea319d3

thanks, I add this to replaces : github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5. the error went away.

enjoyliu avatar Nov 17 '21 09:11 enjoyliu

The error goes away with the replace github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5

but I seem to reach other issues when I roll back the gnostic version

#22 48.70 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:79:12: undefined: logr.WithCallDepth```

simonxmh avatar Nov 18 '21 18:11 simonxmh

The error goes away with the replace github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5

but I seem to reach other issues when I roll back the gnostic version

#22 48.70 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:79:12: undefined: logr.WithCallDepth```

if you don't need latest k8s, maybe you can rollback its version too.

enjoyliu avatar Nov 19 '21 02:11 enjoyliu

The issue goes away when upgrading to go 1.17.3, at least for me.

Only works if you also change go.mod go be go 1.17 and after that does go mod tidy before upping whatever needs to be upgraded :)

jonaz avatar Nov 26 '21 13:11 jonaz

I had the same issue with the package name, after searching a lot I found golang cache coming from golang proxy server, after rewriting GOPROXY variable to GOPROXY="direct" everything starts working.

mandeepsinghgill avatar Apr 23 '22 16:04 mandeepsinghgill

Got following message from @dependabot

⚠️ Dependabot wasn't able to update downloading

The module path downloading found in your go.mod doesn't match the actual path github.com/google/gnostic found in the dependency's go.mod.

Updating the module path in your go.mod to github.com/google/gnostic should resolve this issue.

janisz avatar Sep 29 '22 16:09 janisz