decolua/9router · error

NOT_INSTALLED

NOT_INSTALLED

Error message

PXPIPE is not installed

What it means

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.

Source

Thrown at src/app/api/pxpipe/start/route.js:17

import { NextResponse } from "next/server";
import { getSettings } from "@/lib/localDb";
import { getInstallInfo, installPxpipe } from "@/lib/pxpipe/install.js";
import { loadPxpipe } from "@/lib/pxpipe/loader.js";
import { getPxpipeStatus } from "@/lib/pxpipe/service.js";

export const dynamic = "force-dynamic";
export const maxDuration = 300;

// "Start" in library mode = warm the in-process transform module.
// Auto-installs first when the package is missing and pxpipeAutoInstall is on.
export async function POST() {
  try {
    if (!getInstallInfo().installed) {
      const settings = await getSettings();
      if (!settings.pxpipeAutoInstall) {
        return NextResponse.json({ error: "PXPIPE is not installed", code: "NOT_INSTALLED" }, { status: 409 });
      }
      await installPxpipe();
    }
    await loadPxpipe();
    return NextResponse.json(getPxpipeStatus());
  } catch (error) {
    return NextResponse.json({ error: error.message, code: error.code || null }, { status: 500 });
  }
}

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Open dashboard settings and enable pxpipeAutoInstall, then retry POST /api/pxpipe/start (the route will install then load).
  2. Manually install the pxpipe package per project docs, restart the server, and confirm getInstallInfo().installed is true before starting.
  3. Call the endpoint again after installation — POST runs loadPxpipe() once the check passes.

Example fix

// before
await fetch('/api/pxpipe/start');
// after
const cfg = await fetch('/api/settings').then(r => r.json());
if (!cfg.pxpipeAutoInstall) await fetch('/api/settings', { method: 'PUT', body: JSON.stringify({ pxpipeAutoInstall: true }) });
const res = await fetch('/api/pxpipe/start');
if (res.status === 409) console.error(await res.json()); // { error, code: 'NOT_INSTALLED' }
Defensive patterns

Strategy: validation

Validate before calling

const cfg = await fetch('/api/settings').then(r => r.json());
if (!cfg.pxpipeAutoInstall) {
  // enable auto-install or install the package before calling start
}
const res = await fetch('/api/pxpipe/start');
if (res.status === 409 && (await res.json()).code === 'NOT_INSTALLED') { /* handle */ }

Type guard

function isNotInstalled(e) { return e && e.code === 'NOT_INSTALLED'; }

Try / catch

try {
  const res = await fetch('/api/pxpipe/start', { method: 'POST' });
  const body = await res.json();
  if (!res.ok) throw Object.assign(new Error(body.error), { code: body.code });
} catch (e) {
  if (e.code === 'NOT_INSTALLED') { /* enable auto-install or install package */ }
  else throw e;
}

Prevention

When it happens

Trigger: Calling POST /api/pxpipe/start when getInstallInfo().installed is false and the stored settings have pxpipeAutoInstall set to false (or unset).

Common situations: 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.


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/b7b2732e84f7c4d3. Report an issue: GitHub.