{"record":{"id":"0f4419bb26e2e4e4","repo":"paperclipai/paperclip","slug":"api-route-not-found","errorCode":null,"errorMessage":"API route not found","messagePattern":"API route not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/app.ts","lineNumber":939,"sourceCode":"  api.use(\n    adapterRoutes({\n      getNativeRunnerEnabled: async () =>\n        (await instanceSettingsService(db).getExperimental())\n          .enableNativeRunner === true,\n    }),\n  );\n  api.use(\n    accessRoutes(db, {\n      deploymentMode: opts.deploymentMode,\n      deploymentExposure: opts.deploymentExposure,\n      bindHost: opts.bindHost,\n      allowedHostnames: opts.allowedHostnames,\n      authPublicBaseUrl: opts.authPublicBaseUrl,\n    }),\n  );\n  app.use(\"/api\", api);\n  app.use(\"/api\", (_req, res) => {\n    res.status(404).json({ error: \"API route not found\" });\n  });\n  app.use(\n    pluginUiStaticRoutes(db, {\n      localPluginDir: opts.localPluginDir ?? DEFAULT_LOCAL_PLUGIN_DIR,\n    }),\n  );\n\n  const __dirname = path.dirname(fileURLToPath(import.meta.url));\n  if (opts.uiMode === \"static\") {\n    // Try published location first (server/ui-dist/), then monorepo dev location (../../ui/dist)\n    const candidates = [\n      path.resolve(__dirname, \"../ui-dist\"),\n      path.resolve(__dirname, \"../../ui/dist\"),\n    ];\n    const uiDist = candidates.find((p) =>\n      fs.existsSync(path.join(p, \"index.html\")),\n    );\n    if (uiDist) {","sourceCodeStart":921,"sourceCodeEnd":957,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/app.ts#L921-L957","documentation":"API catch-all in createApp: the request matched the /api mount but no registered route handled its method+path, so Express fell through to the terminal middleware which returns a uniform 404 JSON error. It is a router fallback, not a thrown exception.","triggerScenarios":"Thrown at server/src/app.ts:661 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the request path and method against the API routes; correct the URL and retry."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}