Flaky test failure: Unknown storage type found for drop secret: 'bogus'
- Dominant language
- C++
- Stars
- 60
- Forks
- 100
- Avg merge
- 1h 50m
- Merged PRs (30d)
- 25
Description
### Test failure
I'm seeing a httpfs test [failure](https://github.com/duckdb/duckdb/actions/runs/30072728978/job/89417166658?pr=24106#step:7:26) on duckdb in a random branch:
```
retrying failed test /home/runner/work/duckdb/duckdb/build/reldebug/_deps/httpfs_extension_fc-src/test/sql/secrets/create_secret_name_conflicts.test (attempt 1/2, retry 1/4)
.
================================================================
error: FAIL /home/runner/work/duckdb/duckdb/build/reldebug/_deps/httpfs_extension_fc-src/test/sql/secrets/create_secret_name_conflicts.test
> 36 statement error
37 DROP SECRET s1 FROM bogus;
38 ----
39 Invalid Input Error: Unknown storage type found for drop secret: 'bogus'
1. /home/runner/work/duckdb/duckdb/build/reldebug/_deps/httpfs_extension_fc-src/test/sql/secrets/create_secret_name_conflicts.test:36
================================================================================
Error: Query failed, but error message did not match expected error message: Invalid Input Error: Unknown storage type found for drop secret: 'bogus' (/home/runner/work/duckdb/duckdb/build/reldebug/_deps/httpfs_extension_fc-src/test/sql/secrets/create_secret_name_conflicts.test:36)!
================================================================================
DROP SECRET s1 FROM bogus;
================================================================================
Actual result:
================================================================================
Invalid Input Error: Failed to remove non-existent transaction secret with name 's1'
PRAGMA enable_verification has been deprecated - there is no need to set this anymore
PRAGMA enable_verification has been deprecated - there is no need to set this anymore
recovered: passed on retry 1/2
reproduce:
build/reldebug/test/unittest /home/runner/work/duckdb/duckdb/build/reldebug/_deps/httpfs_extension_fc-src/test/sql/secrets/create_secret_name_conflicts.test
```
The test recovers, but it's still obscuring real errors in CI, so useful to resolve.
### Context
I asked Codex to reason about the test failure:
Secrets are isolated across SQL tests via per-test `{TEST_DIR}` and per-connection/transaction state. This failure does not look like another httpfs test leaking `s1`.
The more likely bug is in DuckDB main’s `DROP SECRET` metadata:
- [drop.gram]() makes `TEMPORARY` optional.
- [transform_drop.cpp]() only sets `ExtraDropSecretInfo::persist_mode` when that optional keyword exists.
- [extra_drop_info.cpp]() does not initialize `persist_mode`.
- [secret_manager.cpp]() treats `SecretPersistType::TRANSACTION` specially before normal storage validation.
So plain `DROP SECRET s1 FROM bogus` can intermittently execute as if the persist mode were `TRANSACTION`, producing:
```
Failed to remove non-existent transaction secret with name 's1'
```
instead of validating `FROM bogus`.
The minimal fix is likely to initialize `ExtraDropSecretInfo::persist_mode = SecretPersistType::DEFAULT` in its constructor, and optionally add/adjust a regression test around `DROP SECRET ... FROM bogus` without `TEMPORARY`/`PERSISTENT`. I didn’t run the reproduction locally because `build/reldebug` is not present in this checkout.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/parser/parsed_data/extra_drop_info.cpp and trace persist_mode through transform_drop.cpp into src/main/secret/secret_manager.cpp. Run the provided create_secret_name_conflicts.test reproduction, then add or adjust the regression coverage for DROP SECRET ... FROM bogus without TEMPORARY or PERSISTENT. Done means the query consistently reports the unknown storage type and the flaky test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, sql
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100