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

cmd/go: go mod tidy installs unreleased and gone package #51888

Closed
vmihailenco opened this issue Mar 23, 2022 · 7 comments
Closed

cmd/go: go mod tidy installs unreleased and gone package #51888

vmihailenco opened this issue Mar 23, 2022 · 7 comments

Comments

@vmihailenco
Copy link
Contributor

Using Go 1.8 with this program:

// main.go
package main

import (
	"fmt"

	"github.com/uptrace/go-clickhouse/ch"
)

func main() {
	db := ch.Connect(
		// clickhouse://<user>:<password>@<host>:<port>/<database>?sslmode=disable
		ch.WithDSN("clickhouse://localhost:9000/default?sslmode=disable"),
	)
	fmt.Println(db.Ping())
}

Then I run:

go clean -modcache
go mod init example
go mod tidy

go: downloading github.com/uptrace/go-clickhouse/ch v0.0.0-20220308124651-82a5d8d72ef7
go: downloading github.com/uptrace/go-clickhouse v0.2.2

The problem is that Go installs github.com/uptrace/go-clickhouse/ch package that was never properly released but was installed once using Git revision. github.com/uptrace/go-clickhouse/ch/go.mod is long gone from the repository. I want github.com/uptrace/go-clickhouse v0.2.2 to be installed instead.

How can I completely remove github.com/uptrace/go-clickhouse/ch from the cache?

@seankhliao
Copy link
Member

uptrace/go-clickhouse will need to use retract to fix it.

@seankhliao
Copy link
Member

as an user, you can use exclude while they fix it

@vmihailenco
Copy link
Contributor Author

Please read the issue. There is no go.mod file and there is no version to retract. The package github.com/uptrace/go-clickhouse/ch is gone and replaced by github.com/uptrace/go-clickhouse.

@seankhliao
Copy link
Member

seankhliao commented Mar 23, 2022

There was publicly available commit and it is cached. It needs to be retracted.

https://proxy.golang.org/github.com/uptrace/go-clickhouse/ch/@v/v0.0.0-20220308124651-82a5d8d72ef7.mod

@vmihailenco
Copy link
Contributor Author

It needs to be retracted.

Or deleted. That is why I've created this issue.

To retract it, I need to update go.mod file for the package github.com/uptrace/go-clickhouse/ch. Such package does not exist any more and go.mod is gone. The package was replaced with github.com/uptrace/go-clickhouse.

I could restore go.mod for github.com/uptrace/go-clickhouse/ch to retract the old version. But then Go will cache a new version for that package and I will have the same problem. I want the package github.com/uptrace/go-clickhouse/ch to be completely gone.

Is there a way to manually remove https://proxy.golang.org/github.com/uptrace/go-clickhouse/ch/@v/v0.0.0-20220308124651-82a5d8d72ef7.mod?

@seankhliao
Copy link
Member

No, but your retraction can include the version it's published in, it also doesn't have to be on the main branch.
https://seankhliao.com/blog/12022-01-19-unpublishing-go-modules/

@vmihailenco
Copy link
Contributor Author

@seankhliao thanks, that worked.

@golang golang locked and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants