dennis-tra / nebula

🌌 A network agnostic DHT crawler, monitor, and measurement tool that exposes timely information about DHT networks.
Apache License 2.0
294 stars 30 forks source link

panic: open discvx/prefixmap.go: no such file or directory #60

Closed bayareaunicorn closed 3 months ago

bayareaunicorn commented 5 months ago

System: Apple M1 Silicon

panic: open discvx/prefixmap.go: no such file or directory

goroutine 1 [running]:
main.main()
    /home/runner/work/nebula/nebula/gen.go:64 +0x590

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

nebula_Darwin_arm64.tar.gz

dark982 commented 4 months ago

Also on ubuntu 23 Release 2.2.0

dennis-tra commented 4 months ago

Sorry for the late reply. I'm currently on vacation 👍

Are you actually trying to regenerate the prefix map? Unfortunately, I can't reproduce your issue. I'm also on an M1 Mac. I did a fresh clone and ran go run gen.go:

git clone https://github.com/dennis-tra/nebula
go run gen.go

If you're actually interested in running Nebula, then you would need to run the main package in ./cmd/nebula/.

To better be able to reproduce your issue, could you send me the command that you have tried to run?

cortze commented 4 months ago

Is there anything I should check here @dennis-tra ? More than happy to try things out on x86 arch, when more info is given :)

dennis-tra commented 4 months ago

I guess just a repro would be great. Do you run into the same issue?

cortze commented 4 months ago

I could reproduce the error downloading the latest release (v2.2.0):

./nebula --dry-run crawl --limit 100
breaking prefixes...
writing prefixes...
panic: open discvx/prefixmap.go: no such file or directory

goroutine 1 [running]:
main.main()
        /home/runner/work/nebula/nebula/gen.go:64 +0x625

However, building it manually, I could run both:

cortze commented 4 months ago

Just FYI, I could trace down the GitHub Actions of the 2.2.0 release. But I couldn't see any problem with the latest manual run of goreleaser.

However, it does look like the first time it ran, it had a similar problem with the GoReleaser@v5 step with the go generate command.

Could this be a problem related to that first failed release?

Should I try to generate a new v2.2.1 release, including updated Polkadot bootstrap nodes, to see if the problem persists?

bayareaunicorn commented 4 months ago

OS: Mac Air Silicon M1 Go Version: 1.22.2

git clone https://github.com/dennis-tra/nebula
cd nebula
make build
../../../go/pkg/mod/github.com/quic-go/quic-go@v0.33.1/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.21 yet. F...) as int value in variable declaration
make: *** [build] Error 1
cortze commented 4 months ago

Reopening the Issue as gorelease isn't happy yet, and it was automatically closed with #62

dennis-tra commented 4 months ago

@bayareaunicorn Nebula only works with Go Version 1.19. For more context see: https://github.com/dennis-tra/nebula?tab=readme-ov-file#from-source

bayareaunicorn commented 4 months ago

After switching to Go v 1.19.13 make build

fatal: No names found, cannot describe anything.
go build -ldflags "-X main.version= -X main.commit=68fa3bd -X main.date=2024-05-06T15:20:28Z -X main.builtBy=scott" -o dist/nebula github.com/dennis-tra/nebula-crawler/cmd/nebula
go: downloading github.com/quic-go/qtls-go1-19 v0.3.3
# github.com/dennis-tra/nebula-crawler/cmd/nebula
ld: warning: '/private/var/folders/sy/6jq7pfcs1b74qy7jbxqbc1rc0000gn/T/go-link-725967350/go.o' has malformed LC_DYSYMTAB, expected 125 undefined symbols to start at index 61364, found 257 undefined symbols starting at index 128
dennis-tra commented 4 months ago

Hi @bayareaunicorn, apologies for the surprisingly complicated build process. Thanks for bearing with us here.

The error fatal: No names found, cannot describe anything. comes from git describe --tags --abbrev=0 not finding any recent tags. The most recent tag is used as an ldflag when you build Nebula. In your case, the repository doesn't seem to contain any tags which is surprising.

May I ask how you have cloned the repo? Just a regular git clone ... would have pulled the tags.

Anyway, I'll fix the Makefile to cover the case where no tags are present. In the meantime, you can also run the command that's run by make build under the hood yourself (without all the ldflags):

go build -o dist/nebula github.com/dennis-tra/nebula-crawler/cmd/nebula
cortze commented 4 months ago

Finally made goreleaser to work Could any of you try out the darwin releases from the 2.2.1 tag ?

cortze commented 3 months ago

Closing this issue as #68 finally fixed the cross-compilation of binary at GitHub actions