Skip to content

Login lockout noticed after in-app update to v2.16: AUTH_PASSWORD missing from usr/.env #2065

Open

Description

@PascalHorn

Summary

After using the in-app updater to move an existing Docker installation from Agent Zero v2.15 to v2.16, I could no longer sign in with my previously working credentials. The login page showed:

Invalid Credentials. Please try again.

Inspection through the host terminal showed that /a0/usr/.env still contained AUTH_LOGIN, but the AUTH_PASSWORD key was absent. Restoring the previous password in that file and restarting the container restored login access.

Environment

  • NVIDIA DGX Spark, ARM64.
  • Docker Engine 29.6.2.
  • Existing agent0ai/agent-zero container with persistent storage mounted at /a0/usr.
  • In-app update from v2.15 to v2.16. git -C /a0 describe --tags --always returned v2.16 after the update.
  • Application Python interpreter available at /opt/venv-a0/bin/python.

Observed sequence and uncertainty about the trigger

  1. Login worked before the incident.
  2. Model presets were edited and saved in the web UI earlier in the same session, including saving the main Settings dialog.
  3. I accepted the suggested in-app update to v2.16.
  4. Afterwards, attempts to sign in with my previously working credentials failed.
  5. Terminal inspection found the missing password key.

We did not inspect the on-disk authentication configuration immediately before the update. Therefore, the exact trigger is unconfirmed. The key may have disappeared during the earlier settings save or during the update. This is a single observed incident, and we have not reproduced it in a clean installation.

Sanitized diagnostic findings

/a0/usr/.env: present
AUTH_LOGIN: set
AUTH_PASSWORD: key absent

/a0/.env: absent

docker exec environment:
AUTH_LOGIN: unset
AUTH_PASSWORD: unset

The docker exec environment above refers to a new exec process, rather than the environment already loaded by the running web-server process.

Expected behavior

Configured authentication credentials should survive model-preset/settings saves and in-app updates. If credential configuration becomes incomplete, the application should report an actionable configuration error and provide recovery guidance.

Recovery performed with Codex through the terminal

We diagnosed this with Codex, using SSH to the Docker host. We restored the previous password through a hidden terminal prompt, backed up the existing configuration, and restarted the A0 container. Login then worked again.

For another operator encountering the same missing-key state, the following is the English equivalent of the recovery command we used. Run it in the Docker host terminal. Change A0_CONTAINER to the correct container name. The interpreter path is installation-specific.

The script requires an existing username and an absent or empty password field. It prompts twice for the intended existing password, validates the temporary configuration, creates a backup with mode 0600, and atomically replaces the configuration. The password is entered interactively rather than included in the command.

A0_CONTAINER=agent-zero

docker exec -it "$A0_CONTAINER" /opt/venv-a0/bin/python -c '
import getpass
import os
import tempfile
from datetime import datetime
from pathlib import Path
from dotenv import dotenv_values, set_key

path = Path("/a0/usr/.env")
original = path.read_bytes()
before = dotenv_values(path)
if not before.get("AUTH_LOGIN"):
    raise SystemExit("AUTH_LOGIN is missing. Stop and inspect the configuration.")
if before.get("AUTH_PASSWORD"):
    raise SystemExit("AUTH_PASSWORD is already set. Stop and investigate before changing it.")

password = getpass.getpass("Previous A0 password: ")
confirmation = getpass.getpass("Enter it again: ")
if not password or password != confirmation:
    raise SystemExit("Passwords are empty or different. Configuration was not changed.")

fd, temporary_name = tempfile.mkstemp(prefix=".env.auth-", dir=path.parent)
os.close(fd)
temporary = Path(temporary_name)
try:
    temporary.write_bytes(original)
    set_key(str(temporary), "AUTH_PASSWORD", password, quote_mode="always")
    checked = dotenv_values(temporary)
    if checked.get("AUTH_PASSWORD") != password:
        raise SystemExit("Password could not be stored unchanged. Configuration was not replaced.")
    if checked.get("AUTH_LOGIN") != before["AUTH_LOGIN"]:
        raise SystemExit("Username validation failed. Configuration was not replaced.")
    if path.read_bytes() != original:
        raise SystemExit("Configuration changed concurrently. Stop and inspect it.")

    backup = path.with_name(
        ".env.backup-" + datetime.now().strftime("%Y%m%d-%H%M%S-%f")
    )
    backup_fd = os.open(
        str(backup), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600
    )
    with os.fdopen(backup_fd, "wb") as stream:
        stream.write(original)

    os.replace(temporary, path)
    print("Password restored. Configuration backup:", backup.name)
finally:
    if temporary.exists():
        temporary.unlink()
' && docker restart --timeout 60 "$A0_CONTAINER"

After the container starts, reload the login page and sign in with the existing username and the password entered at the prompt.

Related report

#2019 discusses loss of AUTH_LOGIN and its authentication consequences. In this incident, AUTH_LOGIN remained present and AUTH_PASSWORD was absent, resulting in a login lockout. Linking it because both reports concern preservation and handling of authentication configuration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions