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

Unable to import api / sdk go modules #234

Open
ollevche opened this issue Mar 26, 2024 · 9 comments
Open

Unable to import api / sdk go modules #234

ollevche opened this issue Mar 26, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ollevche
Copy link

Hey there!

Describe the bug
Running go get github.com/openbao/openbao/api results in the following error:

go: github.com/openbao/openbao/api@upgrade (v1.11.0) requires github.com/openbao/openbao/api@v1.11.0: parsing go.mod:
module declares its path as: github.com/hashicorp/vault/api
but was required as: github.com/openbao/openbao/api

To Reproduce
Steps to reproduce the behavior:

  1. Init a go module: go mod init example.test
  2. Run go get github.com/openbao/openbao/api
  3. See error

Expected behavior
OpenBao API go module has been added to project's go.mod as a dependency for further use.

Environment:
Clean go module.

Additional context
It's possible that Go module proxy server cached the old version of OpenBao API's go.mod (with github.com/hashicorp/vault/api specified). It can be resolved by publishing a new go mod version.

@ollevche ollevche added the bug Something isn't working label Mar 26, 2024
@ollevche
Copy link
Author

ollevche commented Mar 26, 2024

To ensure this is a cache problem, you can disable proxy by updating GOPROXY variable via the command: go env -w GOPROXY=direct. After that, it imports successfully.

@cipherboy
Copy link
Contributor

cipherboy commented Mar 26, 2024

@ollevche yes, sadly this is a cache issue. This is why I want @naphelps to tag the next alpha as above the past releases.

When forking, all tags were pushed over and subsequently tagged prior to removal, which has caused issues as we've not yet released. I think perhaps you can do what I did in https://github.com/cipherboy/devbao and pin to a hash in the interim.

Strictly, I think we'd need to retract all past tags as well?

@ollevche
Copy link
Author

ollevche commented Mar 26, 2024

Thanks for the reply @cipherboy!

Bypassing the go proxy worked for me, but I believe CI could fail later: GOPROXY="direct" go get github.com/openbao/openbao/api.

Ideally, you would want to retract older versions, yes. But I think it's fine to simply publish a new one.

BTW when do you plan to release? I'm working on OpenTofu <> OpenBao integration (opentofu/opentofu#1174) and this issue could affect our build process so that's why I'm curious.

@nerijus
Copy link

nerijus commented Mar 26, 2024

Please see #231 (comment) about the release.

@ollevche
Copy link
Author

@nerijus thanks!

@naphelps
Copy link
Member

@cipherboy I was going to tag the release v2.20240329.0-alpha. I am taking other suggestions as well.

@cipherboy
Copy link
Contributor

cipherboy commented Mar 26, 2024

@naphelps 2>1.14, so that works for me!

@naphelps
Copy link
Member

naphelps commented Apr 9, 2024

@ollevche I have hacked together a stop gap for today. I retagged most of the modules in OpenBao so you should be able to pull our changes. Most modules in openbao are now tagged either v1.1.0-development20240408 or v2.1.0-development20240408.

api: github.com/openbao/openbao/api@v1.100.0-development20240408
sdk: github.com/openbao/openbao/sdk@v1.100.0-development20240408

going forward we will likely have to go through and increment the major versions of the modules (v0 => v2, v1 => v2, and v2 => v3) to reset the version history and completely remove the prior tags.

@ollevche
Copy link
Author

ollevche commented Apr 9, 2024

@naphelps got you, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants