dev-mode key pair and healthcheck without a config file read a variable that is not UTF-8 as unset
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- authentication, cli
Research direction
Two readers treat non-UTF-8 environment values as unset: the non_empty closure in resolve_with in crates/server/src/dev_credentials.rs, and the std::env::var calls in resolve_target in crates/app/src/cmd_healthcheck.rs. Start with the disable switch EXTENDDB_DEV_DISABLE_EXAMPLE_CREDENTIAL, which already refuses such a value with a message naming it, and compare. Done when a non-UTF-8 value in either reader produces an error that names the variable, with the existing error paths left intact.
Written by the indexing model from the issue text.
Description
What happens
Two readers of ExtendDB variables read the process environment with their own code instead of the configuration loader. Both treat a value that is not UTF-8 as unset, and no message says that the value is not UTF-8. For an EXTENDDB__ variable, the configuration loader refuses such a value with an error that names it (#977).
Measured on 21 November 2026 with the dev-mode SQLite binary (--features sqlite-memory,dev-mode) of the fix for #977. Each case ran twice and gave the same answer both times.
The dev-mode key pair
A dev-mode build reads EXTENDDB_DEV_ACCESS_KEY_ID and EXTENDDB_DEV_SECRET_ACCESS_KEY as unset when their values are not UTF-8.
env $'EXTENDDB_DEV_ACCESS_KEY_ID=\xff' $'EXTENDDB_DEV_SECRET_ACCESS_KEY=\xfe' extenddb serve --foreground --port 18991
At 20:53 UTC, both runs served /health, and a ListTables signed with the documented example pair got HTTP 200. The startup output named only the example pair under "Sign requests with".
With only EXTENDDB_DEV_ACCESS_KEY_ID not UTF-8 and EXTENDDB_DEV_SECRET_ACCESS_KEY=abc, both runs at 20:58 UTC exited 1 with this message. The message says that the access key variable is not set:
Error: EXTENDDB_DEV_SECRET_ACCESS_KEY is set but EXTENDDB_DEV_ACCESS_KEY_ID is not; set both to seed an additional dev credential, or neither.
resolve_with in crates/server/src/dev_credentials.rs reads each variable of the pair through the non_empty closure. The closure maps a value that is not UTF-8 to None (.and_then(|v| v.into_string().ok())). The disable switch EXTENDDB_DEV_DISABLE_EXAMPLE_CREDENTIAL refuses such a value with a message that names it.
Healthcheck without a config file
With no config file, resolve_target in crates/app/src/cmd_healthcheck.rs reads EXTENDDB__SERVER__PORT and EXTENDDB__SERVER__BIND_ADDR with std::env::var. It treats Err(_) as unset. std::env::var also returns Err for a value that is not UTF-8. Its comment says that it reports a bad port instead of using the default port.
extenddb healthcheck --config <a path that does not exist>, with nothing on port 18443, at 20:52 UTC:
| Environment | Answer |
|---|---|
EXTENDDB__SERVER__PORT=abc |
exit 1, healthcheck failed: EXTENDDB__SERVER__PORT 'abc' is not a valid port: invalid digit found in string |
EXTENDDB__SERVER__PORT holds the byte 0xFF |
exit 1, healthcheck failed: Cannot connect to 127.0.0.1:18443: Connection refused (os error 111) |
EXTENDDB__SERVER__BIND_ADDR holds the byte 0xFF |
exit 1, the same Cannot connect to 127.0.0.1:18443 |
The byte 0xFF in the port gives the answer of an unset port. The probe goes to the default port, and the message does not name the variable.
On main, any variable that is not UTF-8 stops serve with a panic before it reads the key pair (#977). Neither reader changes in the fix for #977.
Expected
Each reader refuses a value that is not UTF-8 with a message that names the variable, as the disable switch and the configuration loader do.
- Dominant language
- Rust
- Stars
- 517
- Forks
- 60
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 116
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ExtendDB/extenddb
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ExtendDB/extenddb#1321 · 1 comment ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 3 days
All issues in ExtendDB/extenddb
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day
-
Invalid JSON options for ngram and edge_ngram silently use defaultsPossibly taken @Tilendlesa claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
noemaforge/vimanam#153 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mufeedvh/code2prompt#355 ·