{"record":{"id":"327cb9e1e9bb5700","repo":"Significant-Gravitas/AutoGPT","slug":"community-rebuild-scheduling-failed-type-exc","errorCode":null,"errorMessage":"Community rebuild scheduling failed: {type(exc).__name__}: {exc}","messagePattern":"Community rebuild scheduling failed: (.+?): (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/admin/memory_admin_routes.py","lineNumber":995,"sourceCode":"    except ValueError as exc:\n        raise HTTPException(status_code=400, detail=str(exc))\n\n    job_id = str(_uuid.uuid4())\n    status = await write_initial_status(kind=\"rebuild\", job_id=job_id, user_id=target)\n\n    try:\n        await get_scheduler_client().schedule_immediate_community_rebuild(\n            user_id=target, job_id=job_id\n        )\n    except Exception as exc:\n        logger.warning(\n            \"Failed to schedule community rebuild %s for user %s: %s\",\n            job_id[:12],\n            target[:12],\n            exc,\n        )\n        await _mark_schedule_failed(\"rebuild\", job_id, exc)\n        raise HTTPException(\n            status_code=500,\n            detail=(\n                f\"Community rebuild scheduling failed: \" f\"{type(exc).__name__}: {exc}\"\n            ),\n        )\n\n    payload = JobTriggerResponse(\n        job_id=status.job_id,\n        user_id=status.user_id,\n        kind=status.kind,\n        state=status.state,\n        started_at=status.started_at,\n    )\n    return JSONResponse(status_code=202, content=payload.model_dump(mode=\"json\"))\n\n\n@router.get(\n    \"/{user_id}/communities/rebuild/{job_id}\",","sourceCodeStart":977,"sourceCodeEnd":1013,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/admin/memory_admin_routes.py#L977-L1013","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the 'Failed to schedule community rebuild' warning in logs for the real error","Bring the scheduler/broker back up and verify connectivity from the API","Confirm via GET /{user_id}/communities/rebuild/{job_id}/status that the job shows failed, then re-trigger","Check for version/config mismatch if a recent deploy preceded the failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if resp.status_code == 500 and \"Community rebuild scheduling failed\" in detail:\n    # job marked failed server-side; safe to re-trigger after infra recovery\n    ...","preventionTips":["Verify scheduler connectivity before fan-out style triggers","Poll job status to confirm terminal 'failed' state before retriggering"],"tags":["http-500","scheduler","community-rebuild","broker"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}