{"record":{"id":"fc4a90f1431630bf","repo":"lfnovo/open-notebook","slug":"failed-to-submit-command","errorCode":null,"errorMessage":"Failed to submit command","messagePattern":"Failed to submit command","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"api/routers/commands.py","lineNumber":76,"sourceCode":"        job_id = await CommandService.submit_command_job(\n            module_name=request.app,  # This should be \"open_notebook\"\n            command_name=request.command,\n            command_args=request.input,\n        )\n\n        return CommandJobResponse(\n            job_id=job_id,\n            status=\"submitted\",\n            message=f\"Command '{request.command}' submitted successfully\",\n        )\n\n    except HTTPException:\n        raise\n    except OpenNotebookError:\n        raise\n    except Exception as e:\n        logger.error(f\"Error submitting command: {str(e)}\")\n        raise HTTPException(\n            status_code=500, detail=\"Failed to submit command\"\n        )\n\n\n@router.get(\"/commands/jobs/{job_id}\", response_model=CommandJobStatusResponse)\nasync def get_command_job_status(job_id: str):\n    \"\"\"Get the status of a specific command job\"\"\"\n    try:\n        status_data = await CommandService.get_command_status(job_id)\n        return CommandJobStatusResponse(**status_data)\n\n    except HTTPException:\n        raise\n    except OpenNotebookError:\n        raise\n    except Exception as e:\n        logger.error(f\"Error fetching job status: {str(e)}\")\n        raise HTTPException(","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/lfnovo/open-notebook/blob/a7de90d38aaf18ee85fd661854d35c11e44613e2/api/routers/commands.py#L58-L94","documentation":"500 from POST /commands (execute_command) when submitting a command to the surreal-commands job queue fails unexpectedly. The detail is deliberately generic; the real cause is in the log line 'Error submitting command: ...'.","triggerScenarios":"Command registry lookup failures (unknown command name/slug), job queue backend errors, or serialization failures of command inputs.","commonSituations":"Command name typo or a command not registered after a rename; queue worker/DB unavailable at submit time.","solutions":["Check the API log 'Error submitting command' line for the real cause","Verify the command exists via GET /api/commands/registry/debug and use its exact slug","Ensure SurrealDB and the worker (make worker-start) are running"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const registry = await (await fetch('/api/commands/registry/debug')).json();\nif (!registry.some(c => c.slug === cmd)) throw new Error('Unknown command');","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.status === 500) checkWorkerAndRetry(); else throw e; }","preventionTips":["Validate command slug against the registry","Keep the surreal-commands worker running"],"tags":["http-500","command-queue","worker"],"backgroundTag":"job-queue-submit-failed","analyzedSha":"a7de90d38aaf18ee85fd661854d35c11e44613e2","analyzedAt":"2026-08-27T02:39:58.166Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}