Skip to content

[v1.2.0] Failed to set configuration option "allowed_directories", error: Attempted to dereference unique_ptr that is NULL! #137

@jivanic-demystdata

Description

@jivanic-demystdata

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:

  1. Install scala-cli
    See https://scala-cli.virtuslab.org/install
  2. Create a new file named duck.sc
  3. 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)
  1. Run the duck.sc file with the bash cmd:
scala-cli duck.sc

Notice that commenting the line config.put("allowed_directories", "['data/csv/glob']") removes the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions