{"record":{"id":"21c9882f60e2b1dd","repo":"MemPalace/mempalace","slug":"daemon-is-not-running","errorCode":null,"errorMessage":"daemon is not running","messagePattern":"daemon is not running","errorType":"exception","errorClass":"DaemonError","httpStatus":null,"severity":"error","filePath":"mempalace/cli.py","lineNumber":1297,"sourceCode":"                if not qpath.exists():\n                    jobs = []\n                else:\n                    jobs = [\n                        job_to_dict(job, include_payload=False)\n                        for job in QueueStore(qpath).list(args.limit)\n                    ]\n            for job in jobs:\n                print(f\"{job['id']}  {job['state']:<9}  {job['kind']:<10}  {job['created_at']}\")\n            return\n\n        if action == \"wait\":\n            client = get_client_if_running(palace_path)\n            if client is not None:\n                job = client.wait(args.job_id)\n            else:\n                qpath = queue_path(palace_path)\n                if not qpath.exists():\n                    raise DaemonError(\"daemon is not running\")\n                job = job_to_dict(QueueStore(qpath).get(args.job_id))\n                if job.get(\"state\") not in TERMINAL_STATES:\n                    raise DaemonError(f\"daemon is not running; job {args.job_id} is {job['state']}\")\n            result = job.get(\"result\") or {}\n            from .service import print_job_result\n\n            exit_code = print_job_result(result)\n            if job.get(\"state\") != \"succeeded\" and exit_code == 0:\n                print(f\"mempalace: daemon job failed: {job.get('error')}\", file=sys.stderr)\n                exit_code = 1\n            if exit_code:\n                sys.exit(exit_code)\n            return\n    except DaemonError as exc:\n        print(f\"mempalace: daemon error: {exc}\", file=sys.stderr)\n        sys.exit(1)\n\n","sourceCodeStart":1279,"sourceCodeEnd":1315,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/cli.py#L1279-L1315","documentation":"Raised by the CLI's job 'wait' action when no daemon is running and there is no persisted queue store under the palace path. The wait command first tries to attach to a live daemon via get_client_if_running(); when that returns None it falls back to reading the job from disk, but a missing queue_path means the job was never queued locally. It surfaces as a DaemonError printed as 'mempalace: daemon error: ...' and a non-zero exit.","triggerScenarios":"Running the CLI job wait subcommand (e.g. `mempalace job wait <job_id>` or the equivalent action dispatcher in cli.py) when: (a) the daemon process is not running, and (b) queue_path(palace_path) does not exist on disk — typically because no job was ever enqueued in this palace.","commonSituations":"Calling wait with a job_id from a different palace path (--palace pointing elsewhere); the daemon crashed and its queue directory was cleaned up; running wait before ever starting the daemon or enqueueing a job; fresh machine/clone with no ~/.mempalace state.","solutions":["Start the daemon (e.g. the daemon/service start subcommand) and re-run the wait command","Verify you are pointing at the right palace: check the --palace path argument matches where the job was enqueued","Confirm the job was actually created first with the job list action; if the queue file does not exist, no job was ever queued in this palace","If the queue store was deleted accidentally, re-enqueue the work and retry"],"exampleFix":"# before\nmempalace job wait abc123   # daemon not running, no queue file\n\n# after\nmempalace daemon start\nmempalace job wait abc123","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom mempalace.cli import queue_path  # or recompute: palace_path / \"queue\"\n\n# Before `job wait`: daemon running OR queue store present\nclient = get_client_if_running(palace_path)\nif client is None and not queue_path(palace_path).exists():\n    raise SystemExit(\"daemon is not running and no queue exists; start the daemon first\")","typeGuard":null,"tryCatchPattern":"try:\n    run_wait_action(args)\nexcept DaemonError as exc:\n    # covers both 'daemon is not running' variants\n    print(f\"daemon unavailable: {exc}\", file=sys.stderr)\n    sys.exit(1)  # or start daemon and retry once","preventionTips":["Start the daemon before issuing wait commands in scripts","Pin --palace to an explicit path so the queue store is always the one you enqueued into","Treat DaemonError during wait as a signal to check daemon status, not to loop-retry"],"tags":["cli","daemon","jobs","mempalace"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}