{"record":{"id":"1c802e578571327e","repo":"paperclipai/paperclip","slug":"registry-is-corrupt-or-of-an-unsupported-version","errorCode":null,"errorMessage":"registry is corrupt or of an unsupported version","messagePattern":"registry is corrupt or of an unsupported version","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailscale-https-broker/src/registry.ts","lineNumber":44,"sourceCode":"    generationCounter: 0,\n    leases: [],\n    quarantinedPorts: [],\n  };\n}\n\nexport function loadRegistry(path: string, nodeIdentity: string): BrokerRegistry {\n  let raw: string;\n  try {\n    raw = readFileSync(path, \"utf8\");\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n      return emptyRegistry(nodeIdentity);\n    }\n    throw error;\n  }\n  const parsed = JSON.parse(raw) as BrokerRegistry;\n  if (parsed.version !== 1 || !Array.isArray(parsed.leases)) {\n    throw new Error(\"registry is corrupt or of an unsupported version\");\n  }\n  // Compatibility with the pre-reservation development build: an existing\n  // lease necessarily represented an exposed mapping.\n  parsed.leases = parsed.leases.map((lease) => ({\n    ...lease,\n    state: lease.state === \"reserved\" ? \"reserved\" : \"exposed\",\n    expiresAtIso: typeof lease.expiresAtIso === \"string\" ? lease.expiresAtIso : null,\n  }));\n  parsed.quarantinedPorts = Array.isArray(parsed.quarantinedPorts) ? parsed.quarantinedPorts : [];\n  return parsed;\n}\n\n/**\n * Persist the registry atomically. Temp file in the same directory (same fs),\n * fsync data, rename over the target, then fsync the directory so the rename is\n * durable.\n */\nexport function saveRegistry(path: string, registry: BrokerRegistry): void {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/tailscale-https-broker/src/registry.ts#L26-L62","documentation":"Registry integrity check in loadRegistry: the on-disk registry.json parsed as JSON but its version is not 1 or its leases field is not an array — the file is corrupt or written by an incompatible broker version. Aborts startup rather than importing an uninterpretable lease set.","triggerScenarios":"Thrown at packages/tailscale-https-broker/src/registry.ts:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete or move aside the corrupt registry file so the broker can recreate it, or restore it from a backup of a supported version."],"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-14T00:17:10.932Z"}