{"record":{"id":"b994c047c6663c5a","repo":"Significant-Gravitas/AutoGPT","slug":"dream-pass-scheduling-failed-type-exc-name","errorCode":null,"errorMessage":"Dream pass scheduling failed: {type(exc).__name__}: {exc}","messagePattern":"Dream pass scheduling failed: (.+?): (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/admin/memory_admin_routes.py","lineNumber":767,"sourceCode":"\n    job_id = str(_uuid.uuid4())\n    status = await write_initial_status(\n        kind=\"dream_pass\", job_id=job_id, user_id=target\n    )\n\n    try:\n        await get_scheduler_client().schedule_immediate_dream_pass(\n            user_id=target, job_id=job_id\n        )\n    except Exception as exc:\n        logger.warning(\n            \"Failed to schedule dream pass %s for user %s: %s\",\n            job_id[:12],\n            target[:12],\n            exc,\n        )\n        await _mark_schedule_failed(\"dream_pass\", job_id, exc)\n        raise HTTPException(\n            status_code=500,\n            detail=f\"Dream pass scheduling failed: {type(exc).__name__}: {exc}\",\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}/dream/{job_id}\",\n    response_model=DreamJobStatus,\n)","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/admin/memory_admin_routes.py#L749-L785","documentation":"HTTP 500 raised after an on-demand dream pass was accepted (initial status row already written) but the scheduler client failed to enqueue schedule_immediate_dream_pass. The detail embeds the underlying exception class name and message, and the job's stored status is marked failed via _mark_schedule_failed, so a subsequent status poll shows the failure.","triggerScenarios":"POST /{user_id}/dream succeeds at validation, but the scheduler backend (queue/broker backing get_scheduler_client) is unreachable, not running, has auth mismatch, or raises any exception during schedule_immediate_dream_pass — e.g. RabbitMQ/Redis/scheduler service down in the docker-compose stack or in a deployment where the scheduler is a separate process.","commonSituations":"Local dev without the scheduler service started (docker compose up -d skipped or partial); broker connection env vars (host/port/credentials) wrong in .env; scheduler deployed separately and network-partitioned; version skew between API and scheduler after a partial deploy.","solutions":["Check backend logs for the preceding 'Failed to schedule dream pass' warning — it contains the root exception","Verify the scheduler/broker service is running: docker compose ps, and that the API container can reach it","Compare broker/scheduler connection settings in .env between the API and scheduler processes","GET the job status endpoint for the returned job_id — it will show the failed state and stored error","Retry the POST once infrastructure is healthy; the failed job row is terminal and a new job_id is issued"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Pre-flight: scheduler reachable (health endpoint if available)\nassert await scheduler_healthcheck(), \"scheduler down; dream pass will 500\"","typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.post(f\"/memory/{uid}/dream\")\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 500 and \"scheduling failed\" in e.response.json()[\"detail\"]:\n        detail = e.response.json()[\"detail\"]  # contains root exception name\n        # job already marked failed; safe to re-trigger after infra fix\n        ...\n    raise","preventionTips":["Keep scheduler and broker services running before triggering jobs","Monitor for the 'Failed to schedule dream pass' log warning as an early signal","Treat 500-on-trigger as infrastructure, not application, failure — fix the broker first"],"tags":["http-500","scheduler","dream-pass","infrastructure","broker"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}