{"record":{"id":"2322ea7649df27b7","repo":"openclaw/openclaw","slug":"crabbox-lease-id-is-invalid","errorCode":null,"errorMessage":"Crabbox lease id is invalid","messagePattern":"Crabbox lease id is invalid","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/crabbox/src/crabbox-worker-provider.ts","lineNumber":582,"sourceCode":"  const resolveBinary = (explicit?: string) => {\n    if (explicit) {\n      return explicit;\n    }\n    defaultBinary ??= resolveCrabboxBinary({\n      explicit,\n      isExecutable: dependencies.isExecutable,\n      openclawRoot,\n      pathEnv: dependencies.pathEnv ?? process.env.PATH,\n      platform: dependencies.platform,\n    });\n    return defaultBinary;\n  };\n  const resolveLeaseContext = (\n    lease: Parameters<WorkerProvider[\"inspect\"]>[0],\n  ): LeaseCommandContext => {\n    const parsed = parseCrabboxProfile(lease.profile);\n    if (!LEASE_ID_PATTERN.test(lease.leaseId)) {\n      throw new Error(\"Crabbox lease id is invalid\");\n    }\n    return {\n      binary: resolveBinary(parsed.binary),\n      id: lease.leaseId,\n      provider: parsed.provider,\n    };\n  };\n\n  return {\n    id: CRABBOX_WORKER_PROVIDER_ID,\n    resolveProvisionTimeoutMs(profile) {\n      return resolveCrabboxProvisionCallTimeoutMs(parseCrabboxProfile(profile));\n    },\n    async provision(profile: WorkerProfile, operationId: string): Promise<WorkerLease> {\n      const parsed = parseCrabboxProfile(profile);\n      const warmupTimeoutMs = parsed.desktop\n        ? CRABBOX_DESKTOP_WARMUP_TIMEOUT_MS\n        : CRABBOX_WARMUP_TIMEOUT_MS;","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/crabbox/src/crabbox-worker-provider.ts#L564-L600","documentation":"Thrown by resolveLeaseContext when lease.leaseId does not match LEASE_ID_PATTERN (/^(?:cbx_|tbx_)[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u). Only cbx_- or tbx_-prefixed ids of the right charset/length are accepted; anything else is treated as a programming/caller error before any command runs.","triggerScenarios":"Calling inspect/resolveSshIdentity/destroy with a malformed leaseId: missing cbx_/tbx_ prefix, empty string, wrong prefix, overlong id, or illegal characters.","commonSituations":"Caller stored a raw operationId instead of the derived lease id; copy/paste truncated the id; mixed Crabbox and Testbox ids; caller fabricated an id locally.","solutions":["Use the lease id returned by provision (operationLeaseId(operationId)), not the operationId or slug.","Validate the id against the cbx_/tbx_ pattern before passing it to inspect/destroy.","If migrating formats, regenerate ids via operationLeaseId so they carry the correct prefix."],"exampleFix":"// before - passing the operation id\nprovider.inspect({ leaseId: operationId, profile });\n// after - passing the derived lease id\nconst leaseId = operationLeaseId(operationId); // e.g. cbx_a1b2c3d4e5f6\nprovider.inspect({ leaseId, profile });","handlingStrategy":"validation","validationCode":"const LEASE_ID_PATTERN = /^(?:cbx_|tbx_)[A-Za-z0-9][A-Za-z0-9_-]{0,128}$/u;\nfunction assertLeaseId(id) {\n  if (!LEASE_ID_PATTERN.test(id)) {\n    throw new Error(`Invalid lease id: ${id}`);\n  }\n}","typeGuard":"function isValidLeaseId(id) {\n  return typeof id === 'string' && /^(?:cbx_|tbx_)[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u.test(id);\n}","tryCatchPattern":null,"preventionTips":["Always derive the lease id via operationLeaseId(operationId).","Never pass an operationId or slug where a lease id is expected.","Validate the id format at the caller boundary before invoking the provider."],"tags":["crabbox","validation","lease-id","worker-provider"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}