{"record":{"id":"b7b2732e84f7c4d3","repo":"decolua/9router","slug":"not-installed","errorCode":"NOT_INSTALLED","errorMessage":"PXPIPE is not installed","messagePattern":"PXPIPE is not installed","errorType":"error_code","errorClass":null,"httpStatus":409,"severity":"error","filePath":"src/app/api/pxpipe/start/route.js","lineNumber":17,"sourceCode":"import { NextResponse } from \"next/server\";\nimport { getSettings } from \"@/lib/localDb\";\nimport { getInstallInfo, installPxpipe } from \"@/lib/pxpipe/install.js\";\nimport { loadPxpipe } from \"@/lib/pxpipe/loader.js\";\nimport { getPxpipeStatus } from \"@/lib/pxpipe/service.js\";\n\nexport const dynamic = \"force-dynamic\";\nexport const maxDuration = 300;\n\n// \"Start\" in library mode = warm the in-process transform module.\n// Auto-installs first when the package is missing and pxpipeAutoInstall is on.\nexport async function POST() {\n  try {\n    if (!getInstallInfo().installed) {\n      const settings = await getSettings();\n      if (!settings.pxpipeAutoInstall) {\n        return NextResponse.json({ error: \"PXPIPE is not installed\", code: \"NOT_INSTALLED\" }, { status: 409 });\n      }\n      await installPxpipe();\n    }\n    await loadPxpipe();\n    return NextResponse.json(getPxpipeStatus());\n  } catch (error) {\n    return NextResponse.json({ error: error.message, code: error.code || null }, { status: 500 });\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/decolua/9router/blob/90b52e06ffd666b7929554211474d01588f6b1f8/src/app/api/pxpipe/start/route.js#L1-L27","documentation":"POST /api/pxpipe/start returns 409 with code NOT_INSTALLED when the PXPIPE integration package is not present on the machine and the dashboard setting pxpipeAutoInstall is disabled. The route is designed to auto-install the package when missing, but only if the user opted in via settings; without that opt-in it refuses to start rather than silently installing software.","triggerScenarios":"Calling POST /api/pxpipe/start when getInstallInfo().installed is false and the stored settings have pxpipeAutoInstall set to false (or unset).","commonSituations":"Fresh checkout or new machine where the pxpipe dependency was never installed; settings synced from another machine without the package; user deliberately disabled auto-install but still calls the start endpoint; Docker image built without the extra package.","solutions":["Open dashboard settings and enable pxpipeAutoInstall, then retry POST /api/pxpipe/start (the route will install then load).","Manually install the pxpipe package per project docs, restart the server, and confirm getInstallInfo().installed is true before starting.","Call the endpoint again after installation — POST runs loadPxpipe() once the check passes."],"exampleFix":"// before\nawait fetch('/api/pxpipe/start');\n// after\nconst cfg = await fetch('/api/settings').then(r => r.json());\nif (!cfg.pxpipeAutoInstall) await fetch('/api/settings', { method: 'PUT', body: JSON.stringify({ pxpipeAutoInstall: true }) });\nconst res = await fetch('/api/pxpipe/start');\nif (res.status === 409) console.error(await res.json()); // { error, code: 'NOT_INSTALLED' }","handlingStrategy":"validation","validationCode":"const cfg = await fetch('/api/settings').then(r => r.json());\nif (!cfg.pxpipeAutoInstall) {\n  // enable auto-install or install the package before calling start\n}\nconst res = await fetch('/api/pxpipe/start');\nif (res.status === 409 && (await res.json()).code === 'NOT_INSTALLED') { /* handle */ }","typeGuard":"function isNotInstalled(e) { return e && e.code === 'NOT_INSTALLED'; }","tryCatchPattern":"try {\n  const res = await fetch('/api/pxpipe/start', { method: 'POST' });\n  const body = await res.json();\n  if (!res.ok) throw Object.assign(new Error(body.error), { code: body.code });\n} catch (e) {\n  if (e.code === 'NOT_INSTALLED') { /* enable auto-install or install package */ }\n  else throw e;\n}","preventionTips":["Enable pxpipeAutoInstall in settings before deploying environments that call /api/pxpipe/start automatically.","Include the pxpipe package in the base image/dependency list for new machines.","Check install status (getInstallInfo) before invoking the start endpoint in scripts.","Treat HTTP 409 with code NOT_INSTALLED as an installation prerequisite, not a runtime bug."],"tags":["http-409","oauth-configuration","dependency-missing"],"backgroundTag":"dependency-not-installed","analyzedSha":"90b52e06ffd666b7929554211474d01588f6b1f8","analyzedAt":"2026-08-30T21:05:45.952Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}