When trying to set the allowed_directories configuration when starting a new DuckDB instance, I have the following error:
Exception in thread "main" java.sql.SQLException: Catalog Error: Failed to set configuration option "allowed_directories", error: Attempted to dereference unique_ptr that is NULL!
at org.duckdb.DuckDBNative.duckdb_jdbc_startup(Native Method)
at org.duckdb.DuckDBConnection.newConnection(DuckDBConnection.java:51)
at org.duckdb.DuckDBDriver.connect(DuckDBDriver.java:41)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:191)
at duck$_.<init>(duck.sc:14)
at duck_sc$.script$lzyINIT1(duck.sc:29)
at duck_sc$.script(duck.sc:29)
at duck_sc$.main(duck.sc:33)
at duck_sc.main(duck.sc)
To reproduce:
- Install
scala-cli
See https://scala-cli.virtuslab.org/install
- Create a new file named
duck.sc
- Copy/paste the following code into the
duck.sc file:
//> using dep org.duckdb:duckdb_jdbc:1.2.0
import java.sql.DriverManager
import java.util.Properties
val config = new Properties()
config.put("enable_external_access", "false")
// allowed_directories value took from https://github.com/duckdb/duckdb/blob/f317a112e0c789a11987d9de6d621d8469c00fb8/test/sql/settings/allowed_directories.test#L16
config.put("allowed_directories", "['data/csv/glob']")
DriverManager.getConnection("jdbc:duckdb:", config)
- Run the
duck.sc file with the bash cmd:
Notice that commenting the line config.put("allowed_directories", "['data/csv/glob']") removes the error
When trying to set the
allowed_directoriesconfiguration when starting a new DuckDB instance, I have the following error:To reproduce:
scala-cliSee https://scala-cli.virtuslab.org/install
duck.scduck.scfile:duck.scfile with the bash cmd:Notice that commenting the line
config.put("allowed_directories", "['data/csv/glob']")removes the error