postgres_scanner icon indicating copy to clipboard operation
postgres_scanner copied to clipboard

Error loading locally installed extension - incompatible metadata but metadata should be correct

Open luisdelatorre012 opened this issue 1 year ago • 2 comments

What happens?

I'm trying to download and install the extension locally. When I load the extension, I get an incompatible metadata error message, even though I think I used the correct file. I'm running duckdb 0.10.2 on linux, python 3.11.5.

I downloaded the file from https://extensions.duckdb.org/v0.10.2/linux_amd64_gcc4/postgres_scanner.duckdb_extension.gz.

Installing gives me no error message.

When I use load_extension("postgres") I get the error message

duckdb.duckdb.InvalidInputException: 
Invalid Input Error: 
Extension "/home/<myusername>/.duckdb/extensions/v0.10.2/linux_amd64_gcc4/postgres_scanner.duckdb_extension" 
do not have metadata compatible with DuckDB loading it (version v0.10.2, platform linux_amd64_gcc4)

Am I using the wrong file, or not loading the extension correctly?

To Reproduce

download file: wget https://extensions.duckdb.org/v0.10.2/linux_amd64_gcc4/postgres_scanner.duckdb_extension.gz

then in python:

import duckdb
con = duckdb.connect(config={"allow_unsigned_extensions": "true"})
con.install_extension("postgres_scanner.duckdb_extension.gz")
con.load_extension("postgres")

OS:

Red Hat Enterprise Linux 8.9

PostgreSQL Version:

15.6

DuckDB Version:

0.10.2

DuckDB Client:

Python

Full Name:

Luis de la Torre

Affiliation:

Expeditors

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

luisdelatorre012 avatar Apr 23 '24 14:04 luisdelatorre012

Try un-gzipping the extension before running .install_extension. Otherwise ensure that PRAGMA version and PRAGMA platform return output aligned with the extension you are downloading.

Mytherin avatar Apr 23 '24 14:04 Mytherin

Thank you! It's working now, but I'm not entirely sure what fixed it because I made too many changes.

I extracted the file, installed and loaded and got the same error. Then I noticed that in ~/.duckdb/extensions I had both v0.10.1 and v0.10.2 folders with postgres_scanner. I deleted both folders, installed again, and the load now works.

luisdelatorre012 avatar Apr 23 '24 15:04 luisdelatorre012