YangSiJun528 opened a new issue, #2308:
URL: https://github.com/apache/iggy/issues/2308

   ### 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
   ```bash
   # 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to