{"record":{"id":"074ddc74c751468a","repo":"earendil-works/pi","slug":"description-is-too-long-maximum-is-max-unix","errorCode":null,"errorMessage":"${description} is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes","messagePattern":"(.+?) is too long; maximum is (.+?) UTF-8 bytes","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/server/src/transports/unix/listener.ts","lineNumber":21,"sourceCode":"import { chmod, link, lstat, mkdir, rename, unlink } from \"node:fs/promises\";\nimport { createConnection, createServer, type Server, type Socket } from \"node:net\";\nimport { dirname, join } from \"node:path\";\nimport { DEFAULT_MAX_FRAME_LENGTH } from \"@earendil-works/pi-protocol\";\nimport type { ByteConnection, ByteConnectionAcceptor } from \"../../connection.ts\";\nimport type { PiServerListener } from \"../../listener.ts\";\nimport type { UnixListenerOptions } from \"./types.ts\";\n\nconst DEFAULT_SOCKET_MODE = 0o600;\nconst DEFAULT_GRACEFUL_CLOSE_TIMEOUT_MS = 5_000;\nconst MAX_UINT32 = 0xffff_ffff;\nconst MAX_TIMER_DELAY_MS = 2_147_483_647;\nconst SOCKET_PROBE_TIMEOUT_MS = 1_000;\nconst MAX_UNIX_SOCKET_PATH_BYTES = process.platform === \"linux\" ? 107 : 103;\n\nexport function validateUnixSocketPath(path: string, description = \"Unix socket path\"): void {\n\tif (!path) throw new TypeError(`${description} must not be empty`);\n\tif (Buffer.byteLength(path) > MAX_UNIX_SOCKET_PATH_BYTES) {\n\t\tthrow new TypeError(`${description} is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes`);\n\t}\n}\n\ninterface ResolvedUnixListenerOptions {\n\tpath: string;\n\tmode: number;\n\tgracefulCloseTimeoutMs: number;\n\tmaxPendingBytes: number;\n\tonError?: (error: Error) => void;\n}\n\ninterface FileIdentity {\n\tdev: number;\n\tino: number;\n}\nclass UnixListener implements PiServerListener {\n\tprivate readonly options: ResolvedUnixListenerOptions;\n\tprivate readonly path: string;","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/server/src/transports/unix/listener.ts#L3-L39","documentation":"Error \"${description} is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/server/src/transports/unix/listener.ts:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the socket path to fit the platform's Unix socket path limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}