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: "cannot find module providing package" with Go 1.12 and Git 2.21.0 #31143

Open
Phillip-Gabler opened this Issue Mar 29, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@Phillip-Gabler
Copy link

Phillip-Gabler commented Mar 29, 2019

What version of Go are you using (go version)?

go version go1.12.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GOARCH="amd64"
GOBIN="/home/pgable000/GoWorkspace/bin"
GOCACHE="/home/pgable000/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pgable000/GoWorkspace"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/pgable000/GoWorkspace/src/github.enterprise.com/pgable000/program/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build454419636=/tmp/go-build -gno-record-gcc-switches"

ALSO -- git version 2.21.0, and
GO111MODULE=on

What did you do?

"go build" an executable using modules in a private (enterprise) github repository.

Module included as:

package main

import (
"fmt"
ecs "github.enterprise.com/pgable000/"
"net/url"
)

Module and program using module exist in directory tree as

/home/pgable000/GoWorkspace/src/github.enterprise.com/pgable000/module_name
/home/pgable000/GoWorkspace/src/github.enterprise.com/pgable000/program_name

Both the module and program have go.mod files

Here is a simple test.go that demonstrates the problem I am having:

package main

import (
"fmt"
ecs "github.enterprise.com/pgable000/elasticCommonSchema"
)

func main() {
fmt.Println(ecs.DefaultMapping)
}

"go build" produces:

[pgable000@elk-es-wc-01 test]$ go build
build github.enterprise.com/pgable000/test: cannot load github.enterprise.com/pgable000/elasticCommonSchema: cannot find module providing package github.enterprise.com/pgable000/elasticCommonSchema

What did you expect to see?

I expected an error-free build.

What did you see instead?

build program_name: cannot load github.enterprise.com/pgable000/module_name: cannot find module providing package github.enterprise.com/pgable000/module_name

.gitconfig:

[user]
name = Phillip Gabler
email = phillip_gabler@enterprise.com

[url "ssh://git@github.enterprise.com"]
insteadOf = https://github.enterprise.com

@Phillip-Gabler

This comment has been minimized.

Copy link
Author

Phillip-Gabler commented Mar 29, 2019

The above omitted my <enterprise> where the ".."s are shown./ Sorry

(Fixed most of them.)

@dmitshur dmitshur changed the title Go Build: "cannot find module providing package" with Go 1.12 and Git 2.21.0 cmd/go: "cannot find module providing package" with Go 1.12 and Git 2.21.0 Mar 29, 2019

@bcmills

This comment has been minimized.

Copy link
Member

bcmills commented Mar 29, 2019

Were there other errors printed before the cannot load message?
What happens if you run curl -L https://github.enterprise.com/pgable000/module_name?go-get=1?

I suspect this is a duplicate of #26232, but without more detail it's hard to be certain.

@Phillip-Gabler

This comment has been minimized.

Copy link
Author

Phillip-Gabler commented Mar 29, 2019

This is the complete output of the "go build" command:

[pgable000@elk-es-wc-01 test]$ go build
build github.enterprise.com/pgable000/test: cannot load github.enterprise.com/pgable000/elasticCommonSchema: cannot find module providing package github.enterprise.com/pgable000/elasticCommonSchema

When I run:

curl -L https://github.enterprise.com/pgable000/elasticCommonSchema?go-get=1

I get HTML.

[pgable000@elk-es-wc-01 elasticCommonSchema]$ curl -L https://github.enterprise.com/pgable000/elasticCommonSchema?go-get=1

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

` <title>Go remote import path metadata</title>` ` <meta name="go-import" content="github.enterprise.com/pgable000/elasticCommonSchema git https://github.enterprise.com/pgable000/elasticCommonSchema.git">`

<link rel="mask-icon" href="https://github.enterprise.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://github.enterprise.com/favicon-ent.ico">
`<meta name="theme-color" content="#1e2327">`

<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
` </head>`
<body>
` <!-- Metadata for Go remote import path -->`
</body>
</html>

Is this what you expected?

@Phillip-Gabler

This comment has been minimized.

Copy link
Author

Phillip-Gabler commented Mar 29, 2019

FWIW, I can't build on Windows, either.

@bcmills

This comment has been minimized.

Copy link
Member

bcmills commented Apr 1, 2019

So does the repository hosted at https://github.enterprise.com/pgable000/elasticCommonSchema.git exist and contain .go source files at the root?

(What happens if you run:

git clone https://github.enterprise.com/pgable000/elasticCommonSchema.git && cd elasticCommonSchema && ls *.go

?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.