ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 889 forks source link

Postgres driver not found in ARM64 and ARM32 Docker images #7649

Open Kexkey opened 2 weeks ago

Kexkey commented 2 weeks ago

Issue and Steps to Reproduce

Using CLN with PostgreSQL works with the AMD64 Docker image, but not with the ARM32 and ARM64 ones.

In the following outputs, we can see Unable to find DB driver for postgres://... for ARM32/ARM64 vs Error calling DB setup: Could not connect to postgres://... for AMD64.

Running the CLN Docker image using Postgres on ARM32 (on a RPi3):

docker run --rm -it --entrypoint bash elementsproject/lightningd:v24.08
root@56aea353d694:/# lightningd --wallet=postgres://whatever:CHANGEME@whatever:5432/whatever
2024-09-06T13:20:44.926Z INFO    lightningd: v24.08
2024-09-06T13:20:48.540Z INFO    lightningd: Creating configuration directory /root/.lightning/bitcoin
2024-09-06T13:20:54.470Z UNUSUAL plugin-bookkeeper: topic 'utxo_deposit' is not a known notification topic
2024-09-06T13:20:54.470Z UNUSUAL plugin-bookkeeper: topic 'utxo_spend' is not a known notification topic
2024-09-06T13:20:54.642Z **BROKEN** lightningd: Unable to find DB driver for postgres://whatever:CHANGEME@whatever:5432/whatever
Unable to find DB driver for postgres://whatever:CHANGEME@whatever:5432/whatever

Running the CLN Docker image using Postgres on ARM64 (on a Mac M1):

docker run --rm -it --entrypoint bash elementsproject/lightningd:v24.08
root@8e781ccf42ca:/# lightningd --wallet=postgres://whatever:CHANGEME@whatever:5432/whatever
2024-09-06T13:19:59.859Z INFO    lightningd: v24.08
2024-09-06T13:20:00.153Z INFO    lightningd: Creating configuration directory /root/.lightning/bitcoin
2024-09-06T13:20:00.458Z UNUSUAL plugin-bookkeeper: topic 'utxo_deposit' is not a known notification topic
2024-09-06T13:20:00.458Z UNUSUAL plugin-bookkeeper: topic 'utxo_spend' is not a known notification topic
2024-09-06T13:20:00.469Z **BROKEN** lightningd: Unable to find DB driver for postgres://whatever:CHANGEME@whatever:5432/whatever
Unable to find DB driver for postgres://whatever:CHANGEME@whatever:5432/whatever

Running the CLN Docker image using Postgres on AMD64 (on a PC):

docker run --rm -it --entrypoint bash elementsproject/lightningd:v24.08
root@6ae50e3bfb84:/# lightningd --wallet=postgres://whatever:CHANGEME@whatever:5432/whatever
2024-09-06T13:21:26.683Z INFO    lightningd: v24.08
2024-09-06T13:21:28.844Z INFO    lightningd: Creating configuration directory /root/.lightning/bitcoin
2024-09-06T13:21:35.513Z UNUSUAL plugin-bookkeeper: topic 'utxo_deposit' is not a known notification topic
2024-09-06T13:21:35.513Z UNUSUAL plugin-bookkeeper: topic 'utxo_spend' is not a known notification topic
2024-09-06T13:21:36.379Z **BROKEN** lightningd: Error calling DB setup: Could not connect to postgres://whatever:CHANGEME@whatever:5432/whatever: could not translate host name "whatever" to address: Name or service not known?
Error calling DB setup: Could not connect to postgres://whatever:CHANGEME@whatever:5432/whatever: could not translate host name "whatever" to address: Name or service not known

Version

Using the Docker hub's elementsproject/lightningd:v24.08 image. Same error happens with elementsproject/lightningd:v24.05.

More info

I also built from sources locally (on AMD64) and got the same results. I also tried adding postgresql package in the base-builder stage as well as postgresql and libpq-dev packages in the final stage, with the same results.

I noticed the problem first on a working setup with the Postgres server up and running, so the error above is not due to the pg server not running but the driver libraries not found.

ShahanaFarooqui commented 1 week ago

@Kexkey Can you please confirm your last working CLN version setup on arm64 with postgress?