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

cannot find module providing package github.com/coreos/go-systemd/journal #11345

Closed
woshitang1990 opened this issue Nov 12, 2019 · 13 comments · Fixed by #11387
Closed

cannot find module providing package github.com/coreos/go-systemd/journal #11345

woshitang1990 opened this issue Nov 12, 2019 · 13 comments · Fixed by #11387

Comments

@woshitang1990
Copy link

when i use go get -v go.etcd.io/etcd/clientv3, it shows cannot find module providing package github.com/coreos/go-systemd/journal

who know how to fix it?

@lummie
Copy link

lummie commented Nov 15, 2019

@woshitang1990 did you find a fix?

@woshitang1990
Copy link
Author

@woshitang1990 did you find a fix?
first download github.com/go-systemd/journal to local, then use go module replace to make the package point to local path.
example:
replace github.com/coreos/go-systemd/journal => /Users/miketang/go/src/github.com/go-systemd/journal

@Clivern
Copy link
Contributor

Clivern commented Nov 21, 2019

i think this is related coreos/go-systemd#325

@dselans
Copy link

dselans commented Nov 28, 2019

@woshitang1990 did you find a fix?
first download github.com/go-systemd/journal to local, then use go module replace to make the package point to local path.
example:
replace github.com/coreos/go-systemd/journal => /Users/miketang/go/src/github.com/go-systemd/journal

Thanks for posting this @woshitang1990. This is what I did:

$ mkdir -p $GOPATH/src/github.com/coreos/go-systemd/
$ git clone [email protected]:coreos/go-systemd.git $GOPATH/src/github.com/coreos/go-systemd/
$ cd $myproject
$ go mod edit -replace github.com/coreos/go-systemd/=/Users/dselans/Code/go/src/github.com/coreos/go-systemd
$ go get go.etcd.io/etcd/clientv3

Followed by prompt vendoring...

@MilosSimic
Copy link

@woshitang1990 did you find a fix?
first download github.com/go-systemd/journal to local, then use go module replace to make the package point to local path.
example:
replace github.com/coreos/go-systemd/journal => /Users/miketang/go/src/github.com/go-systemd/journal

Thanks for posting @woshitang1990 and @dselans
i followed both of your answers and kinda combine them to work for me. so steps:

  1. download/clone github.com/coreos/go-systemd to your local go/src package
  2. inside that folder there should be journal folder, go inside and run go mod init
  3. goto your project and run go mod init as well
  4. open go.mod and below module line add this lie: replace github.com/coreos/go-systemd/journal => ../../coreos/go-systemd/journal or use absolute path as @dselans did.
  5. install other libs and run go build

mntky added a commit to mntky/woyendetsa that referenced this issue Dec 2, 2019
@gogrisohil
Copy link

I am still getting this error with the latest release version 3.3.18.

go get -v go.etcd.io/etcd/clientv3 
go: finding github.com/coreos/go-systemd/journal latest
go: finding github.com/coreos/go-systemd latest
../../pkg/mod/github.com/coreos/[email protected]+incompatible/pkg/logutil/zap_journal.go:29:2: no matching versions for query "latest"

@shaodan
Copy link

shaodan commented Dec 25, 2019

I fixed it by add this in my go.mod:

replace github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0

refer to coreos/go-systemd#321

@g00nix
Copy link

g00nix commented Feb 9, 2020

There are already multiple issues opened on github for this problem. Also, fixes written above don't work for me any more.

Are there any plans to commit a permanent fix?

@chrboe
Copy link

chrboe commented Feb 10, 2020

I cannot currently find any way to import the etcd client in a Go project, all suggestions above are broken at time of writing.
Why has there been no reaction to this whatsoever for several months?

@g00nix
Copy link

g00nix commented Feb 10, 2020

I cannot currently find any way to import the etcd client in a Go project, all suggestions above are broken at time of writing.
Why has there been no reaction to this whatsoever for several months?

try adding this to go.mod:

require google.golang.org/grpc v1.26.0
replace github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0

I was as triggered as you are. I guess they probably didn't have time to keep up with upgrades happening on all libraries. I also think we don't really have the right to QQ on github, since we are not fixing the issue either, though we are all go devs and we all have access to the source code. 🤣

@jingyih
Copy link
Contributor

jingyih commented Feb 13, 2020

FYI, dependency of "github.com/coreos/go-systemd/journal" is removed in etcd codebase as part of #11426 (the specific commit is 09304a4).

@faith2god
Copy link

require google.golang.org/grpc v1.26.0
replace github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0

thanks a lot! it works on my machine: ubuntu 14.04

@g00nix
Copy link

g00nix commented May 15, 2020

thanks a lot! it works on my machine: ubuntu 14.04

why don't you upgrade?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.