{"record":{"id":"25d26da93fc61d81","repo":"paperclipai/paperclip","slug":"runtime-service-not-found-for-this-execution-works","errorCode":null,"errorMessage":"Runtime service not found for this execution workspace","messagePattern":"Runtime service not found for this execution workspace","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/execution-workspaces.ts","lineNumber":342,"sourceCode":"            ),\n          )\n          .then((rows) => parseProjectExecutionWorkspacePolicy(rows[0]?.executionWorkspacePolicy))\n      : null;\n    const effectiveRuntimeConfig = existing.config?.workspaceRuntime ?? projectWorkspaceRuntime ?? null;\n    const target = req.body as { workspaceCommandId?: string | null; runtimeServiceId?: string | null; serviceIndex?: number | null };\n    const configuredServices = effectiveRuntimeConfig\n      ? listConfiguredRuntimeServiceEntries({ workspaceRuntime: effectiveRuntimeConfig })\n      : [];\n    const repairRestartsRuntimeServices = action === \"repair\" && configuredServices.length > 0;\n    const workspaceCommand = effectiveRuntimeConfig\n      ? findWorkspaceCommandDefinition(effectiveRuntimeConfig, target.workspaceCommandId ?? null)\n      : null;\n    if (target.workspaceCommandId && !workspaceCommand) {\n      res.status(404).json({ error: \"Workspace command not found for this execution workspace\" });\n      return;\n    }\n    if (target.runtimeServiceId && !(existing.runtimeServices ?? []).some((service) => service.id === target.runtimeServiceId)) {\n      res.status(404).json({ error: \"Runtime service not found for this execution workspace\" });\n      return;\n    }\n    const matchedRuntimeService =\n      workspaceCommand?.kind === \"service\" && !target.runtimeServiceId\n        ? matchWorkspaceRuntimeServiceToCommand(workspaceCommand, existing.runtimeServices ?? [])\n        : null;\n    const selectedRuntimeServiceId = target.runtimeServiceId ?? matchedRuntimeService?.id ?? null;\n    const selectedServiceIndex =\n      workspaceCommand?.kind === \"service\"\n        ? workspaceCommand.serviceIndex\n        : target.serviceIndex ?? null;\n    if (\n      selectedServiceIndex !== undefined\n      && selectedServiceIndex !== null\n      && (selectedServiceIndex < 0 || selectedServiceIndex >= configuredServices.length)\n    ) {\n      res.status(422).json({ error: \"Selected runtime service is not defined in this execution workspace runtime config\" });\n      return;","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/execution-workspaces.ts#L324-L360","documentation":"422 from the execution workspace runtime command handler: the selected runtimeServiceId does not correspond to any runtime service registered on the workspace, so the command has no service to act on.","triggerScenarios":"Thrown at server/src/routes/execution-workspaces.ts:232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}