{"record":{"id":"1f26dc19d856d67e","repo":"vercel/next.js","slug":"port-originalport-is-in-use-by-process-pid","errorCode":null,"errorMessage":"Port ${originalPort} is in use by process ${pid}, using available port ${port} instead.","messagePattern":"Port (.+?) is in use by process (.+?), using available port (.+?) instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/lib/start-server.ts","lineNumber":339,"sourceCode":"      const addr = server.address()\n      const actualHostname = formatHostname(\n        typeof addr === 'object'\n          ? addr?.address || hostname || 'localhost'\n          : addr\n      )\n      const formattedHostname =\n        !hostname || actualHostname === '0.0.0.0'\n          ? 'localhost'\n          : actualHostname === '[::]'\n            ? '[::1]'\n            : formatHostname(hostname)\n\n      port = typeof addr === 'object' ? addr?.port || port : port\n\n      if (portRetryCount) {\n        const pid = await getProcessIdUsingPort(originalPort)\n        if (pid) {\n          Log.warn(\n            `Port ${originalPort} is in use by process ${pid}, using available port ${port} instead.`\n          )\n        } else {\n          Log.warn(\n            `Port ${originalPort} is in use by an unknown process, using available port ${port} instead.`\n          )\n        }\n      }\n\n      const networkHostname =\n        hostname ?? getNetworkHost(isIPv6(actualHostname) ? 'IPv6' : 'IPv4')\n\n      const protocol = selfSignedCertificate ? 'https' : 'http'\n\n      const networkUrl = networkHostname\n        ? `${protocol}://${formatHostname(networkHostname)}:${port}`\n        : null\n","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/vercel/next.js/blob/89d017eac43ebf4742ed2b58d3c1373b70283b69/packages/next/src/server/lib/start-server.ts#L321-L357","documentation":"Warning from startServer's listening handler when port retrying was enabled (portRetryCount > 0): the requested originalPort is already bound, so the server fell back to the next available port. It resolves the holding process id via getProcessIdUsingPort and reports which pid holds the original port and which port is actually being used instead.","triggerScenarios":"Thrown at packages/next/src/server/lib/start-server.ts:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stop the process using the port, or accept the automatically selected port."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89d017eac43ebf4742ed2b58d3c1373b70283b69","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}