Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alsofr opened this issue Oct 11, 2021 · 15 comments

Comments

@alsofr
Copy link

alsofr commented Oct 11, 2021

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

#259

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

Is there a recommended smooth update path?

@bcmills
Copy link

bcmills commented Oct 11, 2021

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 golang/go#26904 and/or golang/go#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.

@alsofr
Copy link
Author

alsofr commented Oct 18, 2021

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.

ffilippopoulos added a commit to utilitywarehouse/semaphore-policy that referenced this issue Oct 27, 2021
Stumbled onto this: google/gnostic#262 when running
`go get -u .`, so updated packages with `go get` separately and tidy in the end
george-angel added a commit to utilitywarehouse/kube-applier that referenced this issue Oct 29, 2021
We cannot update all, because of the gnostic bug:
google/gnostic#262, but we can update the k8s
deps at least
george-angel added a commit to utilitywarehouse/kube-applier that referenced this issue Oct 29, 2021
We cannot update all, because of the gnostic bug:
google/gnostic#262, but we can update the k8s
deps at least
@thediveo
Copy link

thediveo commented Nov 5, 2021

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!

@alsofr
Copy link
Author

alsofr commented Nov 8, 2021

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

@thediveo
Copy link

thediveo commented Nov 8, 2021

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.

@alsofr
Copy link
Author

alsofr commented Nov 8, 2021

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 :(

@Bysmyyr
Copy link

Bysmyyr commented Nov 15, 2021

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

Not for me

@enjoyliu
Copy link

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 ?

@Bysmyyr
Copy link

Bysmyyr commented Nov 17, 2021

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

@enjoyliu
Copy link

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.

@simonxmh
Copy link

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```

@enjoyliu
Copy link

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.

@jonaz
Copy link

jonaz commented Nov 26, 2021

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 :)

djaglowski added a commit to djaglowski/opentelemetry-log-collection that referenced this issue Feb 21, 2022
- Add make targets to easily update dependencies
- Add replace directive to work around gnostic upgrade issue
  - See google/gnostic#262
djaglowski added a commit to open-telemetry/opentelemetry-log-collection that referenced this issue Feb 22, 2022
- Add make targets to easily update dependencies
- Add replace directive to work around gnostic upgrade issue
  - See google/gnostic#262
jsirianni pushed a commit to jsirianni/opentelemetry-log-collection that referenced this issue Mar 28, 2022
- Add make targets to easily update dependencies
- Add replace directive to work around gnostic upgrade issue
  - See google/gnostic#262
@mandeepsinghgill
Copy link

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.

aecay added a commit to sky-uk/feed that referenced this issue Aug 1, 2022
the background to this change is that we are preparing to update feed to the networking/v1 Ingress API (from the extensions/v1beta1 API that was previously used, and is now deprecated/removed from recent versions of k8s).  in order to accomplish this, we need to update the k8s api libraries to more recent versions.  this is a good opportunity to rebaseline our dependencies and shed support for a deprecated module (merlin) within feed.  the next version of feed (incorporating the API change) will need to be a major version update, so we can batch these changes with the upcoming ones as well.

- update go version to 1.18
  - compiler 1.18 is required to build the newest `sigs.k8s.io/yaml` module
  - go.mod format 1.17 is required because of google/gnostic#262
- use `go get -d -u ./...` to pull in the newest version of all dependencies
- delete the `merlin` module
  - its test suite relied on calling `proto.Clone` which does some reflect tricks with private fields that no longer work correctly
  - anyway, merlin is EOL so we don't need to keep supporting it
- update our usage of the k8s apis
  - pass a context to the functions that demand one
  - comply with the new update apis (passing a name of the field manager)
  - write some new deep-equal functions for a type (`LoadBalancerIngress`) that has fields (slices) in it now that are not comparable by simple `==`
- update the k8s test suite to match
  - use autogenerated mocks for the parts that were touched by this update, to make it easier to keep up with future updates
- update ginkgo to v2
  - this catches an issue in the gorb tests with a misplaced `Before/AfterSuite` invocation
@janisz
Copy link

janisz commented Sep 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants