indexsupply / shovel

An Ethereum to Postgres indexer
https://indexsupply.com/shovel
MIT License
182 stars 23 forks source link

./shovel: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./shovel) when building on ubuntu 22 #245

Closed vmaark closed 8 months ago

vmaark commented 8 months ago

Trying to use the binary on ubuntu but I ran into the following issue:

~# ./shovel -version
./shovel: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./shovel)
./shovel: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./shovel)

After some googling seems like a solution could be building with CGO_ENABLED=0, see e.g. https://github.com/aws/aws-lambda-go/issues/340

ryandotsmith commented 8 months ago

OK. Let me try to reproduce. Here is what I'm seeing, can you share your OS details?

% uname -a
Linux janus 6.2.0-1017-aws #17~22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

% curl -LO https://indexsupply.net/bin/main/linux/amd64/shovel

% md5sum shovel 
57f968a22b8eac1f8bbedfacb74e269c  shovel

% chmod +x shovel
% ./shovel -version
vmain b274
vmaark commented 8 months ago

sure

uname -a
Linux racknerd-24549c 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

curl -LO https://indexsupply.net/bin/main/linux/amd64/shovel

md5sum shovel
57f968a22b8eac1f8bbedfacb74e269c  shovel

chmod +x shovel

./shovel -version
./shovel: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./shovel)
./shovel: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./shovel)
ryandotsmith commented 8 months ago

I bet if you updated the linux kernel or ubuntu version this problem would go away. Also, I did just build shovel with cgo disabled (we aren't using it anyways) using:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /tmp/shovel ./cmd/shovel

Want to give this: shovel.zip a try?

vmaark commented 8 months ago

the zip works as expected

 ./shovel -version
v b274-

./shovel -help
Usage of ./shovel:
  -config string
        task config file
  -l string
        dashboard server listen address (default "localhost:8546")
  -notx
        disable pg tx
  -pqxtest.d postgres -d
        postgres debug level (see postgres -d)
  -print-schema
        print schema and exit
  -profile string
        run profile after indexing
  -skip-migrate
        do not run db migrations on startup
  -v    verbose logging
  -version
        version
ryandotsmith commented 8 months ago

OK. I just added this to the automated build program. See my commit above.

Let me know if the new binaries work: https://indexsupply.net/bin/main/linux/amd64/shovel (once the aforementioned commit finishes its build process)

vmaark commented 8 months ago

thanks @ryandotsmith, it works!

~# curl -LO --silent https://indexsupply.net/bin/main/linux/amd64/shovel
~# chmod +x shovel
~# ./shovel -version
vmain 3e1c