Attaching DB via URL on Windows leads to "Cannot open file" error

Open
#308 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, sql
Domain
database

Research direction

Start by reproducing the failure with the linked DuckdbBugRepro project on Windows, focusing on DuckdbBugRepro.java at the attachDatabaseFromHttpUrl call around line 80. Compare behavior between versions 1.2.2.0 and 1.3.0.0, then verify that attaching the signed HTTP URL no longer treats it as a local file.

Written by the indexing model from the issue text.

Description

When attempting to attach a database via an HTTP URL on Windows, DuckDB seems to interpret the URL as a file and then fails to open it. This issue was introduced between versions 1.2.2.0 and 1.3.0.0. Here is a repo that is able to reproduce the error:

https://github.com/nikammerlaan/duckdb-bug-repro

DuckdbBugRepro > test() FAILED
    java.sql.SQLException: IO Error: Cannot open file "http://localhost:56144/test-bucket/database.duckdb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250712%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250712T203631Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=c90c1d82b5c44409343a9b42f5e451304808d81035f1c1af8ef22cef8f9cb951": The system cannot find the path specified.
        at org.duckdb.DuckDBNative.duckdb_jdbc_execute(Native Method)
        at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:178)
        at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:155)
        at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:241)
        at DuckdbBugRepro.attachDatabaseFromHttpUrl(DuckdbBugRepro.java:80)
        at DuckdbBugRepro.test(DuckdbBugRepro.java:25)
Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 41m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-java

All issues in duckdb/duckdb-java

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.