Issues with statically linked `duckdb-ui` extension
- Dominant language
- TypeScript
- Stars
- 465
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
### What happens?
I'm building duckdb from sources with statically linked `duckdb-ui` extension in Nix, and I encounter two issues.
1. Both tests from `tests/fast/api/test_config.py::TestDBConfig::test_external_access` fail with the following error:
```
__________________ TestDBConfig.test_external_access[pandas1] __________________
self =
duckdb_cursor =
pandas =
@pytest.mark.parametrize('pandas', [NumpyPandas(), ArrowPandas()])
def test_external_access(self, duckdb_cursor, pandas):
df = pandas.DataFrame({'a': [1, 2, 3]})
# this works (replacement scan)
con_regular = duckdb.connect(':memory:', config={})
con_regular.execute('select * from df')
# disable external access: this also disables pandas replacement scans
> con = duckdb.connect(':memory:', config={'enable_external_access': False})
E duckdb.duckdb.PermissionException: Permission Error: Cannot access directory "/tmp/nix-build-python3.11-duckdb-1.2.1.drv-13/home/.duckdb/extension_data" - file system operations are disabled by configuration
```
I guess `enable_external_access=False` does not fit with autoloaded UI extension.
2. The build passes after marking the tests as ignored, but duckdb crashes if `~/.duckdb` does not exist.
```
v1.2.1
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D call start_ui_server();
Error: unable to open database ":memory:": IO Error: Failed to create directory "/home/tankoand/.duckdb/extension_data": No such file or directory
```
Creating the directory resolves the issue.
### To Reproduce
All is in the description.
### OS:
Linux
### DuckDB Version:
1.2.1
### DuckDB Client:
CLI
### Hardware:
_No response_
### Full Name:
Andrej Tankos
### Affiliation:
Arista Networks
### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
### Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
### Did you include all code required to reproduce the issue?
- [x] Yes, I have
### Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
- [x] Yes, I have
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Nix static-build failures in tests/fast/api/test_config.py::TestDBConfig::test_external_access, then inspect the autoloaded duckdb-ui path reached by start_ui_server(). Done means external-access configuration no longer fails unexpectedly and start_ui_server() works when ~/.duckdb/extension_data does not already exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100