postgres_scanner icon indicating copy to clipboard operation
postgres_scanner copied to clipboard

Build error: The file is not a DuckDB extension. The metadata at the end of the file is invalid

Open saul-data opened this issue 8 months ago • 0 comments

What happens?

I need to build v1.2.0 duckdb postgres extension because our environment is air tight and we need to install from source (cannot download the built binaries).

After following the build notes, I get the following error message.

root ➜ /workspace (main) $ ./build/release/duckdb -unsigned
v1.2.1-dev102 8d5079066c
Enter ".help" for usage hints.

D LOAD 'build/release/extension/postgres_scanner/postgres_scanner.duckdb_extension';

Invalid Input Error:
Failed to load 'build/release/extension/postgres_scanner/postgres_scanner.duckdb_extension', The file is not a DuckDB extension. The metadata at the end of the file is invalid
D LOAD './build/release/extension/postgres_scanner/postgres_scanner.duckdb_extension';
Invalid Input Error:

Failed to load './build/release/extension/postgres_scanner/postgres_scanner.duckdb_extension', The file is not a DuckDB extension. The metadata at the end of the file is invalid

To Reproduce

I followed the steps to build from source to v1.2.0 as follows:

Updated .gitmodules

[submodule "duckdb"]
	path = duckdb
	url = https://github.com/duckdb/duckdb.git
	branch = v1.2-histrionicus
[submodule "extension-ci-tools"]
	path = extension-ci-tools
	url = https://github.com/duckdb/extension-ci-tools.git
	branch = v1.2.0

Pull the correct version in the submodules

git submodule init
git pull --recurse-submodules

git submodule update --remote
git submodule status

Build the extension

make

To run, run the bundled duckdb shell:

 ./build/release/duckdb -unsigned  # allow unsigned extensions

Then, load the Postgres extension like so:

LOAD 'build/release/extension/postgres_scanner/postgres_scanner.duckdb_extension';

OS:

Debian Bullseye

PostgreSQL Version:

17.2

DuckDB Version:

1.2.0

DuckDB Client:

DuckDB CLI

Full Name:

Saul Frank

Affiliation:

Lloyds Banking Group

Have you tried this on the latest main branch?

  • [x] I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • [x] I agree

saul-data avatar Feb 19 '25 12:02 saul-data