Issue
The --with-default-root-credentials flag only works on first server start. (when no local_data directory exists)
On subsequent starts, the flag is ignored but the server still logs:
INFO iggy_server: Using default root credentials (username: iggy, password: iggy) - FOR DEVELOPMENT ONLY!
This misleads users into thinking the credentials are active when they're not.
This also affects users who manually set IGGY_ROOT_USERNAME and IGGY_ROOT_PASSWORD environment variables after the server has already created a root user.
Steps to Reproduce
# First run - creates root user with random password
cargo run --bin iggy-server
# Stop and restart with flag
cargo run --bin iggy-server -- --with-default-root-credentials
# Authentication fails
cargo run --example getting-started-producer
Root Cause
The flag sets IGGY_ROOT_USERNAME=iggy and IGGY_ROOT_PASSWORD=iggy environment variables, but load_users() in core/server/src/streaming/systems/users.rs only creates a new root user when users.is_empty().
Since local_data already contains the user from the first run, the flag is silently ignored.
Proposed Fix
- Add warning log when flag/environment variables are used but users already exist
- Add information in README that existing user data persists across restarts
Update CLI help text to clarify this behavior (CLI help already mentions this)
Issue
The
--with-default-root-credentialsflag only works on first server start. (when nolocal_datadirectory exists)On subsequent starts, the flag is ignored but the server still logs:
This misleads users into thinking the credentials are active when they're not.
This also affects users who manually set
IGGY_ROOT_USERNAMEandIGGY_ROOT_PASSWORDenvironment variables after the server has already created a root user.Steps to Reproduce
Root Cause
The flag sets
IGGY_ROOT_USERNAME=iggyandIGGY_ROOT_PASSWORD=iggyenvironment variables, butload_users()incore/server/src/streaming/systems/users.rsonly creates a new root user whenusers.is_empty().Since
local_dataalready contains the user from the first run, the flag is silently ignored.Proposed Fix
Update CLI help text to clarify this behavior(CLI help already mentions this)