Closed OneCyrus closed 7 months ago
What happens if you run the same commands from DuckDB cli?
Also, can you put that code in try catch to see if you are able to catch the exception?
i'm trying to do a repro. it seems to be related to manual installation of the httpfs extension.
created a reproduction here: https://github.com/OneCyrus/duckdb-repro/
it's a simple webservice which should return a string on the root endpoint ("/"). when run as a linux container it never reaches the end of the method. also no exception is thrown. it basically just kills the whole process.
app.MapGet("/", (IWebHostEnvironment env) =>
{
var _connection = new DuckDBConnection("DataSource=:memory:");
_connection.Open();
var extensionPath = Path.Combine(
env.ContentRootPath,
$"httpfs.duckdb_extension_92_linux"
);
using var cmd = _connection.CreateCommand();
cmd.CommandText =
$"INSTALL '{extensionPath}';"
+ $"LOAD '{extensionPath}';";
cmd.ExecuteReader();
return "Success!";
});
Does it work if you run those commands from cli?
looks like it shows an error when using the cli in the container. but the process is still running. not sure what really happens there and what changed from 0.8.0.
D INSTALL 'httpfs.duckdb_extension_92_linux';
D LOAD 'httpfs.duckdb_extension_92_linux';
Error: IO Error: Extension "httpfs.duckdb_extension_92_linux" could not be loaded: httpfs.duckdb_extension_92_linux: cannot open shared object file: No such file or directory
D
Is the extension in the current folder for the cli?
If ExecuteReader
throws an exception you should be able to catch it with try/catch.
no exception is thrown. it just crashes the whole thing.
but I might have found the issue. it looks like the newer version needs a special version of the extension now. with the gcc4 version it seems to work. when loading then httpfs.duckdb_extension_92_linux_amd64_gcc4 file it doesn't crash anymore.
I suspect that loading an incompatible extension is causing access violation or some similar error that can't be caught by the .Net runtime. Glad that you got it working.
By the way, with version 0.9.3-alpha.11 of the package (only available on GitHub at the moment) you can specify S3 settings in the connection string.
See more details in the readme: Connection String Parameters
version 0.9.2 seems to have a bug which kills the full dotnet application when running in a container. not sure if it's an issue of the bindings or duckdb itself.
version 0.8.0 worked without an issue. basically just running code like kills the process without any error message: