Skip to content

fix(indexing): recover_index_queue raises "'int' object has no attribute 'lower'" on every backend boot #9784

Closed

Description

@mrveiss

Observed

Every backend boot logs:

initialization.lifespan - WARNING - Index queue recovery failed (non-fatal): 'int' object has no attribute 'lower'

The exception is swallowed at autobot-backend/initialization/lifespan.py:1252 (_recover_index_queue), so queued indexing jobs are never recovered after a restart (the #1717 feature is silently broken).

Root cause (to trace)

Entry point: api/codebase_analytics/scanner.py:195 recover_index_queue(). An int is being .lower()-ed — almost certainly a value read back from Redis (where everything is bytes/str) is already an int, or a field expected to be a string is an int. Likely a deserialization/type-coercion mismatch when restoring the queued job payload.

Fix

Trace the .lower() call inside recover_index_queue (and helpers), coerce/validate the offending field, and add a regression test that round-trips a queued job through Redis and recovers it. Do not leave the broad except Exception → WARNING masking it.

Impact

Index-queue recovery after restart is non-functional. Discovered while triaging compose-startup log spam (#9771).

Activity

  1. mrveiss commented on Jun 10, 2026

    @mrveiss
    OwnerAuthor

    Verified STALE during the 2026-06-10 bug sweep — already fixed by #9862 (b25418f95).

    The 'int' object has no attribute 'lower' came from chromadb_storage.py:56 running config.codebase_index_embedding_mode.lower() at import time, where the field was typed int (default 0). When recover_index_queue imported that module chain at boot, the AttributeError propagated and was swallowed at lifespan.py as the reported WARNING.

    git show b25418f95^:autobot_shared/ssot_config.py vs current:

    -    codebase_index_embedding_mode: int = Field(default=0, ...)
    +    codebase_index_embedding_mode: str = Field(default="precompute", ...)
    

    .lower() now resolves, the import succeeds, recovery proceeds. No code change needed.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions