digitalocean / ceph_exporter

Prometheus exporter that scrapes meta information about a ceph cluster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go build failed v4.2.0 with go version go1.20.4 linux/amd6

bruce20319 opened this issue · comments

[root@ceph01 ceph_exporter-4.2.0]# go build .

github.com/digitalocean/ceph_exporter/rados

rados/rados.go:33:20: undefined: rados.Conn
rados/rados.go:65:21: undefined: rados.NewConnWithUser
rados/rados.go:98:22: undefined: rados.Conn

It seems like modules are not being retrieved for your build; I'm not seeing this with go1.20.3. What does go mod download do? Can you check $GOPATH/pkg/mod/github.com/ceph (I think ~/go/pkg/... by default)?

i has check ~/go/pkg/mod/github.com/ceph/go-ceph@v0.14.0/;it is good,go mod download show nothing?
root@ceph02 ceph_exporter]# uname -a
Linux ceph02 4.18.0-486.el8.x86_64 #1 SMP Thu Apr 13 17:32:54 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@ceph02 ceph_exporter]# git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
[root@ceph02 ceph_exporter]#

Hmm, sorry, I'm not quite sure how to help you - I just built this a couple of times in my environment without issues and haven't been able to reproduce the problem you're seeing.

I've seen this in teh past. Make sure you've librbd-dev and librados-dev installed and all the tools required to build (apt install build-essential on ubuntu should do the trick).

Closing due to inactivity