Skip to content

cannot load github.com/mattn/go-sqlite3: module github.com/mattn/go-sqlite3@latest (v2.0.0+incompatible) found, but does not contain package github.com/mattn/go-sqlite3 #755

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

Closed
cjyar opened this issue Nov 13, 2019 · 29 comments

Comments

@cjyar
Copy link

cjyar commented Nov 13, 2019

This package doesn't seem to work with go modules. Here's a simple recipe in Docker, to make it easy to reproduce. Please tell me what I'm doing wrong:

$ docker run -it --rm golang:alpine
/go # apk add build-base
...
/go # mkdir /src
/go # cd /src
/src # cat - > main.go
package main
import (
        "fmt"
	_ "github.com/mattn/go-sqlite3"
)
func main() {
	fmt.Println("Hello world!")
}
/src # export CGO_ENABLED=1
/src # go mod init example.com
go: creating new go.mod: module example.com
/src # go get github.com/mattn/go-sqlite3
go: finding github.com/mattn/go-sqlite3 v2.0.0+incompatible
go: downloading github.com/mattn/go-sqlite3 v2.0.0+incompatible
go: extracting github.com/mattn/go-sqlite3 v2.0.0+incompatible
/src # go run .
build example.com: cannot load github.com/mattn/go-sqlite3: module github.com/mattn/go-sqlite3@latest (v2.0.0+incompatible) found, but does not contain package github.com/mattn/go-sqlite3
@mattn
Copy link
Owner

mattn commented Nov 14, 2019

Fixed.

@mattn mattn closed this as completed Nov 14, 2019
@snOm3ad
Copy link

snOm3ad commented Nov 14, 2019

I am having the same issue on osx. Here are my go environment variables:

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/olivertome/Library/Caches/go-build"
GOENV="/Users/olivertome/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/olivertome/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/n0/h862x6s55wdb9kz1qfsv0__80000gn/T/go-build897009201=/tmp/go-build -gno-record-gcc-switches -fno-common"

Running go install github.com/mattn/go-sqlite3 results in the same error.

@mattn
Copy link
Owner

mattn commented Nov 14, 2019

Please try -u

@pierrre
Copy link

pierrre commented Nov 15, 2019

What was the issue exactly ?
It still fails for me.
Is there a wrong version published in the official modules proxy ?

@pierrre
Copy link

pierrre commented Nov 15, 2019

https://proxy.golang.org/github.com/mattn/go-sqlite3/@v/list
it reports a version v2.0.0+incompatible

@mattn
Copy link
Owner

mattn commented Nov 15, 2019

The cause of this issue is that this repository had topic branch v2.0.0. So I removed it. Please remove local cache with -u.

@gdm85
Copy link

gdm85 commented Nov 16, 2019

Still happening.

@pierrre
Copy link

pierrre commented Nov 16, 2019

I guess that proxy.golang.org has cached the invalid version.

@gdm85
Copy link

gdm85 commented Nov 16, 2019

@pierrre I think so too. But it means new users will always get the error?

I worked it around by appending to go.mod:

replace github.com/mattn/go-sqlite3 => ./vendor/github.com/mattn/go-sqlite3

Then cloning the repository locally and adding a go.mod in there (it can be created with go mod init github.com/mattn/go-sqlite3):

module github.com/mattn/go-sqlite3

go 1.12

I suggest adding the go.mod file here on go-sqlite3 for a longer term solution; on a side node, the proxy should be more explicit about its operations when building, but it's not from what I can see.

@pierrre
Copy link

pierrre commented Nov 16, 2019

@gdm85 or maybe you can just add github.com/mattn/go-sqlite3 to GOPRIVATE

@jaimem88
Copy link

I believe this tag is breaking compatibility when imported by a Go module. I can see an issue trying to go get -u github.com/rubenv/sql-migrate/sql-migrate

build github.com/rubenv/sql-migrate/sql-migrate: cannot load github.com/mattn/go-sqlite3: module github.com/mattn/go-sqlite3@latest found (v2.0.0+incompatible), but does not contain package github.com/mattn/go-sqlite3

@mattn
Copy link
Owner

mattn commented Nov 18, 2019

Sorry, but I will NOT release v2.0.1 or higher just to fix this issue.

@jaimem88
Copy link

Sorry, but I will NOT release v2.0.1 or higher just to fix this issue.

It's a shame that you won't follow the Go modules convention 😞

@mattn
Copy link
Owner

mattn commented Nov 18, 2019

Because the broken tag was a topic branch (not git tag) created before the go module was supported. We don't have mistake. I don't understand the reason for vote down.

@pierrre
Copy link

pierrre commented Nov 18, 2019

Should we ask maintainers of proxy.golang.org to purge the cache ?

@mattn
Copy link
Owner

mattn commented Nov 18, 2019

I asked on this issue golang/go#33558 (comment)

@posener
Copy link

posener commented Nov 19, 2019

They say adding go.mod should fix this.

@mattn
Copy link
Owner

mattn commented Nov 19, 2019

I will keep this issue open until we will find a fundamental solution for this issue.

@mattn mattn reopened this Nov 19, 2019
@pierrre
Copy link

pierrre commented Nov 19, 2019

@posener it requires Go 1.14

@mattn
Copy link
Owner

mattn commented Nov 19, 2019

If you want to solve this issue immediately, please try to do in your repository (Do NOT run it outside of your repository)

go get -u github.com/mattn/[email protected]

@pierrre
Copy link

pierrre commented Nov 19, 2019

@mattn the problem is that I run go get -u all once a week in order to update all my dependencies.
I think it's doing a query to proxy.golang.org, and it will see the invalid version.

IMO the simplest fix is

add github.com/mattn/go-sqlite3 to GOPRIVATE

@brainiac04
Copy link

brainiac04 commented Nov 22, 2019

@pierrre I think so too. But it means new users will always get the error?

I worked it around by appending to go.mod:

replace github.com/mattn/go-sqlite3 => ./vendor/github.com/mattn/go-sqlite3

Then cloning the repository locally and adding a go.mod in there (it can be created with go mod init github.com/mattn/go-sqlite3):

module github.com/mattn/go-sqlite3

go 1.12

I suggest adding the go.mod file here on go-sqlite3 for a longer term solution; on a side node, the proxy should be more explicit about its operations when building, but it's not from what I can see.

I have question here, what is ./vendor directory?? can you give me detailed explanation of how this works?? I am new to go and cfssl. I just used the go get command provided. and it landed me on to this error. would appreciate it if you can help me a little

@snOm3ad
Copy link

snOm3ad commented Nov 22, 2019

@velurinavya the vendor directory is just a directory that contains the source code for all the dependencies in your project. The idea is that anyone who wants to use your code no longer has to manage dependencies because they are already included in the project.

The replace command in the go.mod file tells the go package manager to look for the dependency go-sqlite3 on the vendor directory as opposed of the proxy server maintained by Google, which is the default. To solve this problem you just have to clone this GitHub repo inside of your own vendor directory and tell the go package manager to look for this package inside that directory.

Or just do as @pierrre mentioned and add the url of this repo to your GOPRIVATE environment variable, this is quickest solution.

ccmtaylor added a commit to ccmtaylor/sqlhooks that referenced this issue Nov 25, 2019
fixes incompatibility with go1.13, see
mattn/go-sqlite3#755
@SonOfBytes
Copy link

Bypassing the proxy and going direct helped me resolve this issue with a binary install.

eg.

GOPROXY=direct go get -u github.com/volatiletech/sqlboiler-sqlite3

@elad
Copy link

elad commented Dec 4, 2019

@mattn this high profile package is currently broken:

$ mkdir foobar
$ cd foobar
$ go mod init
go: creating new go.mod: module foobar
$ cat <<EOF > main.go
> package main
> import (
>   "fmt"
>   "github.com/mattn/go-sqlite3"
> )
> 
> func main() {
>   fmt.Println("foobar")
> }
> EOF
$ go build
build foobar: cannot load github.com/mattn/go-sqlite3: module github.com/mattn/go-sqlite3@latest found (v2.0.0+incompatible), but does not contain package github.com/mattn/go-sqlite3
$ 

Could you please release a new version that fixes it?

@mattn
Copy link
Owner

mattn commented Dec 4, 2019

I asked on Go' issues, But no any replies for about fixing this issue. So I'll add new tag in later.

@mattn
Copy link
Owner

mattn commented Dec 4, 2019

Now tagged v2.0.1. Your issues will be fixed with go get -u github.com/mattn/go-sqlite3. However I don't close this issue until golang/go#35671 will be fixed.

@pierrre
Copy link

pierrre commented Dec 4, 2019

@mattn just a suggestion: maybe you should point this tag v2.0.x to an empty branch ?
=> people will never use it

PS: you could include a message to the readme pointing to this issue.

@mattn
Copy link
Owner

mattn commented Jun 18, 2020

I tagged v1.14.0 for latest release. If you are using v2.0.3 already, please use v1.14.0 instead.

See #812 (comment)

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

10 participants