Significant-Gravitas/AutoGPT · error · HTTPException

Community rebuild scheduling failed

Error message

Community rebuild scheduling failed: {type(exc).__name__}: {exc}

What it means

HTTP 500 raised when a community rebuild trigger passes validation and writes initial status but get_scheduler_client().schedule_immediate_community_rebuild raises. The failure is logged with job/user prefixes, the job row is marked failed, and the exception class plus message are embedded in the response detail.

Solutions

  1. Inspect the 'Failed to schedule community rebuild' warning in logs for the real error
  2. Bring the scheduler/broker back up and verify connectivity from the API
  3. Confirm via GET /{user_id}/communities/rebuild/{job_id}/status that the job shows failed, then re-trigger
  4. Check for version/config mismatch if a recent deploy preceded the failures
Defensive patterns

Strategy: retry

Try / catch

if resp.status_code == 500 and "Community rebuild scheduling failed" in detail:
    # job marked failed server-side; safe to re-trigger after infra recovery
    ...

Prevention

When it happens

Trigger: POST /{user_id}/communities/rebuild where the scheduler enqueue fails — scheduler service down, broker/network/auth failure, or an exception inside the scheduling client. The API returns 500 and the rebuild job is recorded as failed.

Common situations: Partial docker-compose stacks in development; scheduler restarted between the POST and enqueue; connection pool exhaustion under load; config drift between API and scheduler deployments.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/327cb9e1e9bb5700. Report an issue: GitHub.

Appendix: source

Thrown at autogpt_platform/backend/backend/api/features/admin/memory_admin_routes.py:995

    except ValueError as exc:
        raise HTTPException(status_code=400, detail=str(exc))

    job_id = str(_uuid.uuid4())
    status = await write_initial_status(kind="rebuild", job_id=job_id, user_id=target)

    try:
        await get_scheduler_client().schedule_immediate_community_rebuild(
            user_id=target, job_id=job_id
        )
    except Exception as exc:
        logger.warning(
            "Failed to schedule community rebuild %s for user %s: %s",
            job_id[:12],
            target[:12],
            exc,
        )
        await _mark_schedule_failed("rebuild", job_id, exc)
        raise HTTPException(
            status_code=500,
            detail=(
                f"Community rebuild scheduling failed: " f"{type(exc).__name__}: {exc}"
            ),
        )

    payload = JobTriggerResponse(
        job_id=status.job_id,
        user_id=status.user_id,
        kind=status.kind,
        state=status.state,
        started_at=status.started_at,
    )
    return JSONResponse(status_code=202, content=payload.model_dump(mode="json"))


@router.get(
    "/{user_id}/communities/rebuild/{job_id}",

View on GitHub (pinned to 9c8bb5550f)