{"record":{"id":"912232f46d795c08","repo":"paperclipai/paperclip","slug":"environment-inactive","errorCode":"environment_inactive","errorMessage":"Environment \"${environment.name}\" is not active (status: ${environment.status}).","messagePattern":"Environment \"(.+?)\" is not active \\(status: (.+?)\\)\\.","errorType":"exception","errorClass":"EnvironmentRunError","httpStatus":null,"severity":"error","filePath":"server/src/services/environment-run-orchestrator.ts","lineNumber":188,"sourceCode":"    companyId: string;\n    selectedEnvironmentId: string;\n    localEnvironmentId: string;\n  }): Promise<Environment> {\n    const environmentId = input.selectedEnvironmentId || input.localEnvironmentId;\n\n    const environment =\n      environmentId === input.localEnvironmentId\n        ? await environmentsSvc.ensureLocalEnvironment(input.companyId)\n        : await environmentsSvc.getById(environmentId);\n\n    if (!environment) {\n      throw new EnvironmentRunError(\"environment_not_found\", `Environment \"${environmentId}\" not found.`, {\n        environmentId,\n      });\n    }\n\n    if (environment.status !== \"active\") {\n      throw new EnvironmentRunError(\"environment_inactive\", `Environment \"${environment.name}\" is not active (status: ${environment.status}).`, {\n        environmentId: environment.id,\n        driver: environment.driver,\n      });\n    }\n\n    return environment;\n  }\n\n  /**\n   * Acquire an environment lease for a heartbeat run.\n   * Wraps the runtime driver's acquire call with standardized error handling.\n   */\n  async function acquireLease(input: {\n    companyId: string;\n    environment: Environment;\n    issueId: string | null;\n    agentId: string;\n    heartbeatRunId: string;","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/environment-run-orchestrator.ts#L170-L206","documentation":"EnvironmentRunError from resolveEnvironment: the environment row exists but its status is not active (e.g. archived or paused). Runs may only target active environments, so orchestration aborts with the environment's name and current status.","triggerScenarios":"Thrown at server/src/services/environment-run-orchestrator.ts:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reactivate the environment (or wait for activation) before running; check its status in the environments list."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}