-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Issue: coaia tash and coaia fetch commands failing with Redis authentication error
Problem Description
The coaia tash and coaia fetch commands are currently failing to execute successfully, returning an "invalid username-password pair or user is disabled" error. This occurs even when no .env file is explicitly present in the current working directory, suggesting a potential misconfiguration or incorrect handling of Redis connection parameters.
Observed Behavior
When attempting to use coaia tash (e.g., coaia tash TMP -F README.md -T 33) or coaia fetch <key>, the following error message is displayed:
invalid username-password pair or user is disabled
Key: TMP was just saved to memory.
Despite the message indicating the key was saved, subsequent coaia fetch commands for the same key also fail with the same authentication error. This indicates that the operation is not completing successfully due to a Redis authentication issue.
Expected Behavior
- The
coaia tashandcoaia fetchcommands should successfully interact with the configured Redis instance. - The commands should correctly prioritize environment variables for Redis connection, specifically
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKEN. - If a
.envfile exists in the current working directory (/src/coaiapy/), these variables should be read from it and used for Redis authentication. - If no
.envfile is present, the commands should fall back to other configured methods (e.g.,~/.coaia.jsonor other global configurations) without authentication errors.
Reproduction Steps
- Ensure no
.envfile is present in/src/coaiapy/. - Execute
coaia tash TMP -F README.md -T 33. - Observe the "invalid username-password pair or user is disabled" error.
- Execute
coaia fetch TMP. - Observe the same authentication error.
Relevant Environment Variables
The following environment variables are critical for Redis connection and should be correctly processed by the coaia tool:
UPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN
These variables should be looked for in the .env file within the current working directory (/src/coaiapy/) first.
Suggested Solution/Investigation Areas for Copilot Agents
Copilot agents should investigate the following:
- Environment Variable Loading: Verify how
coaialoads and prioritizes environment variables, especially from.envfiles. Ensure thatpython-dotenvor a similar mechanism is correctly implemented and functioning. - Redis Client Configuration: Examine the
coaiacodebase to understand how the Redis client is initialized and how theUPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKENare passed to it. There might be an issue with how these credentials are being formatted or used during the connection attempt. - Fallback Mechanism: Confirm that the fallback logic for Redis configuration (when
.envvariables are not present) is correctly implemented and does not lead to authentication failures. - Error Handling: Improve error messaging to provide more specific details about why the authentication failed (e.g., which credential was invalid, which configuration source was used).
- Testing: Implement unit and integration tests to ensure robust handling of Redis connection parameters and environment variables under various scenarios (e.g.,
.envpresent,.envabsent, invalid credentials).