{"record":{"id":"bbcc265ca037f876","repo":"paperclipai/paperclip","slug":"name-must-be-true-or-false-got-env-name","errorCode":null,"errorMessage":"${name} must be \"true\" or \"false\", got: ${env[name]}","messagePattern":"(.+?) must be \"true\" or \"false\", got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/db/src/client.ts","lineNumber":77,"sourceCode":"  const ref = new WeakRef(client);\n  let refs = clientsByHostPort.get(key);\n  if (!refs) {\n    refs = new Set();\n    clientsByHostPort.set(key, refs);\n  }\n  refs.add(ref);\n  clientFinalizer.register(client, { hostPortKey: key, ref }, ref);\n}\n\n/**\n * Ends every live client `createDb` handed out for the given URL's host and\n * port, then forgets them. Call this before stopping a Postgres cluster: a\n * client that outlives the cluster it points at can crash the process (a\n * reserved connection's deferred write firing after the socket is gone).\n * Swallows individual `end()` errors so one bad client cannot block the rest.\n */\nexport async function closeRegisteredClients(url: string): Promise<void> {\n  const key = hostPortKey(url);\n  const refs = clientsByHostPort.get(key);\n  if (!refs) return;\n\n  clientsByHostPort.delete(key);\n  const clients: RegisteredPostgresClient[] = [];\n  for (const ref of refs) {\n    clientFinalizer.unregister(ref);\n    const client = ref.deref();\n    if (client) clients.push(client);\n  }\n\n  await Promise.all(clients.map((client) => client.end({ timeout: 1 }).catch(() => {})));\n}\n\nfunction isSafeIdentifier(value: string): boolean {\n  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);\n}\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/db/src/client.ts#L59-L95","documentation":"Environment-variable parsing guard in the DB client bootstrap: a boolean-typed env var (e.g. pool prepare toggle) was set to a value other than true/1/false/0, so the driver option cannot be derived and startup aborts naming the variable and its raw value.","triggerScenarios":"Thrown at packages/db/src/client.ts:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ${name} to \"true\" or \"false\"."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}