sql-migrate: Cannot go get from a fresh machine

This is a machine which has no golang code on it, like a fresh install

OUTPUT

mau@mbp15:~$ go get -v github.com/rubenv/sql-migrate/...
github.com/rubenv/sql-migrate (download)
get "gopkg.in/gorp.v1": found meta tag get.metaImport{Prefix:"gopkg.in/gorp.v1", VCS:"git", RepoRoot:"https://gopkg.in/gorp.v1"} at //gopkg.in/gorp.v1?go-get=1
gopkg.in/gorp.v1 (download)
github.com/denisenkom/go-mssqldb (download)
github.com/golang-sql/civil (download)
get "golang.org/x/crypto/md4": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/md4?go-get=1
get "golang.org/x/crypto/md4": verifying non-authoritative meta tag
golang.org/x/crypto (download)
github.com/go-sql-driver/mysql (download)
github.com/lib/pq (download)
github.com/mattn/go-sqlite3 (download)
github.com/mitchellh/cli (download)
github.com/armon/go-radix (download)
github.com/bgentry/speakeasy (download)
github.com/fatih/color (download)
github.com/mattn/go-isatty (download)
github.com/posener/complete (download)
github.com/hashicorp/go-multierror (download)
github.com/hashicorp/errwrap (download)
package github.com/rubenv/sql-migrate/sql-migrate
	imports github.com/posener/complete/cmd/install: cannot find package "github.com/posener/complete/cmd/install" in any of:
	/usr/local/Cellar/go/1.13.4/libexec/src/github.com/posener/complete/cmd/install (from $GOROOT)
	/Users/mau/go/src/github.com/posener/complete/cmd/install (from $GOPATH)
github.com/olekukonko/tablewriter (download)
github.com/mattn/go-runewidth (download)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1

ENVIRONMENT

mau@mbp15:~$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mau/Library/Caches/go-build"
GOENV="/Users/mau/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mau/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/82/3klc7kss6wgfrx9t54sdd8zw0000gn/T/go-build159606206=/tmp/go-build -gno-record-gcc-switches -fno-common"

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I think you can close this issue. If you are interesting on insights from this journey, I’ve written a blog post on it 😃 https://posener.github.io/branch-strategy/

Thanks for the help!

I updated the default branch. Looking for a solution if anyone has one.

On Wed, Nov 20, 2019, 10:09 Ivan Skriabin notifications@github.com wrote:

@posener https://github.com/posener it turns out that go get uses default branch, not master 😕. You should change default branch to master. Sorry for misleading you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/155?email_source=notifications&email_token=AAHAN7V2UHPI6H4QK3KRRPLQUTWFHA5CNFSM4JON4BSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEERDBQQ#issuecomment-555888834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHAN7WXABHU755VTZV4FWTQUTWFHANCNFSM4JON4BSA .

I cannot seem to import this library anymore, it seems to be some dependency to https://github.com/mattn/go-sqlite3 which has a recently closed issue here but I don’t think it’s fixed properly

If i try to go get -u github.com/rubenv/sql-migrate

I see the following error

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

TL/DR: GO111MODULE=on GOPRIVATE=github.com/mattn/go-sqlite3 go get github.com/rubenv/sql-migrate/...

details: sql-migrate depends on github.com/mitchellh/cli, which in turn depends on github.com/posener/complete

This error happens because you try to go get github.com/rubenv/sql-migrate/... in no-module aware mode, but: posener/complete was upgraded to v2 while mitchellh/cli still relies on posener/complete v1

Since in your case go get does not know about modules, it will try to download latest posener/complete v2 from master branch, which does not work with mitchellh/cli.

You can fix this by installing sql-migrate in module-aware mode.

But, then you will bump into another unrelated error described here https://github.com/mattn/go-sqlite3/issues/755. To temporary work around it you should disable proxy cache for go-sqlite3:

GO111MODULE=on GOPRIVATE=github.com/mattn/go-sqlite3 go get github.com/rubenv/sql-migrate/...

@posener Yeah

ubuntu@server:~$ go get -v github.com/rubenv/sql-migrate/...
github.com/rubenv/sql-migrate (download)
created GOPATH=/home/ubuntu/go; see 'go help gopath'
get "gopkg.in/gorp.v1": found meta tag get.metaImport{Prefix:"gopkg.in/gorp.v1", VCS:"git", RepoRoot:"https://gopkg.in/gorp.v1"} at //gopkg.in/gorp.v1?go-get=1
gopkg.in/gorp.v1 (download)
github.com/denisenkom/go-mssqldb (download)
github.com/golang-sql/civil (download)
get "golang.org/x/crypto/md4": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/md4?go-get=1
get "golang.org/x/crypto/md4": verifying non-authoritative meta tag
golang.org/x/crypto (download)
github.com/go-sql-driver/mysql (download)
github.com/lib/pq (download)
github.com/mattn/go-sqlite3 (download)
github.com/mitchellh/cli (download)
github.com/armon/go-radix (download)
github.com/bgentry/speakeasy (download)
github.com/fatih/color (download)
github.com/mattn/go-isatty (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
github.com/posener/complete (download)
github.com/hashicorp/go-multierror (download)
github.com/hashicorp/errwrap (download)
package github.com/rubenv/sql-migrate/sql-migrate
	imports github.com/posener/complete/cmd/install: cannot find package "github.com/posener/complete/cmd/install" in any of:
	/usr/local/go/src/github.com/posener/complete/cmd/install (from $GOROOT)
	/home/ubuntu/go/src/github.com/posener/complete/cmd/install (from $GOPATH)
github.com/olekukonko/tablewriter (download)
github.com/mattn/go-runewidth (download)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
ubuntu@server:~$ which sql-migrate
ubuntu@server:~$ go version
go version go1.13.4 linux/amd64