{"record":{"id":"0906d5d08d88c9e2","repo":"usebruno/bruno","slug":"failed-to-check-port-availability","errorCode":null,"errorMessage":"Failed to check port availability","messagePattern":"Failed to check port availability","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/mock-server/mock-server-instances.js","lineNumber":443,"sourceCode":"  ));\n};\n\nexport const getConfiguredMockServerPorts = (instances, { excludeUid } = {}) => (\n  instances\n    .filter((instance) => instance.uid !== excludeUid)\n    .map((instance) => Number(instance.port))\n    .filter((port) => port >= 1 && port <= 65535)\n);\n\nexport const checkMockServerPortAvailable = async (port, instances, { excludeUid } = {}) => {\n  const result = await window.ipcRenderer.invoke('renderer:mock-server-check-port', {\n    port: Number(port),\n    mockServerUid: excludeUid || null,\n    additionalUsedPorts: getConfiguredMockServerPorts(instances, { excludeUid })\n  });\n\n  if (!result?.success) {\n    throw new Error(result?.error || 'Failed to check port availability');\n  }\n\n  return result;\n};\n\nexport const getMockServerPortError = (portCheck, port) => {\n  if (!portCheck || portCheck.available) {\n    return null;\n  }\n\n  const normalizedPort = Number(port);\n\n  if (portCheck.reason === 'system') {\n    return `Port ${normalizedPort} is already in use on this system.`;\n  }\n\n  if (portCheck.reason === 'bruno' || portCheck.reason === 'bruno-config') {\n    return `Port ${normalizedPort} is already used by another mock server in Bruno.`;","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/mock-server/mock-server-instances.js#L425-L461","documentation":"Error \"Failed to check port availability\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-app/src/utils/mock-server/mock-server-instances.js:443 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick a port manually instead of auto-detection.","Check OS firewall/permissions; retry after closing conflicting applications."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}