lfnovo/open-notebook · error · HTTPException

Failed to submit command

Error message

Failed to submit command

What it means

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: ...'.

Source

Thrown at api/routers/commands.py:76

        job_id = await CommandService.submit_command_job(
            module_name=request.app,  # This should be "open_notebook"
            command_name=request.command,
            command_args=request.input,
        )

        return CommandJobResponse(
            job_id=job_id,
            status="submitted",
            message=f"Command '{request.command}' submitted successfully",
        )

    except HTTPException:
        raise
    except OpenNotebookError:
        raise
    except Exception as e:
        logger.error(f"Error submitting command: {str(e)}")
        raise HTTPException(
            status_code=500, detail="Failed to submit command"
        )


@router.get("/commands/jobs/{job_id}", response_model=CommandJobStatusResponse)
async def get_command_job_status(job_id: str):
    """Get the status of a specific command job"""
    try:
        status_data = await CommandService.get_command_status(job_id)
        return CommandJobStatusResponse(**status_data)

    except HTTPException:
        raise
    except OpenNotebookError:
        raise
    except Exception as e:
        logger.error(f"Error fetching job status: {str(e)}")
        raise HTTPException(

View on GitHub (pinned to a7de90d38a)

Solutions

  1. Check the API log 'Error submitting command' line for the real cause
  2. Verify the command exists via GET /api/commands/registry/debug and use its exact slug
  3. Ensure SurrealDB and the worker (make worker-start) are running
Defensive patterns

Strategy: validation

Validate before calling

const registry = await (await fetch('/api/commands/registry/debug')).json();
if (!registry.some(c => c.slug === cmd)) throw new Error('Unknown command');

Try / catch

catch (e) { if (e.status === 500) checkWorkerAndRetry(); else throw e; }

Prevention

When it happens

Trigger: Command registry lookup failures (unknown command name/slug), job queue backend errors, or serialization failures of command inputs.

Common situations: Command name typo or a command not registered after a rename; queue worker/DB unavailable at submit time.

Related errors


AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27). Data as JSON: /api/errors/fc4a90f1431630bf. Report an issue: GitHub.