usebruno/bruno · error · Error

Failed to check port availability

Error message

Failed to check port availability

What it means

Error "Failed to check port availability" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-app/src/utils/mock-server/mock-server-instances.js:443

  ));
};

export const getConfiguredMockServerPorts = (instances, { excludeUid } = {}) => (
  instances
    .filter((instance) => instance.uid !== excludeUid)
    .map((instance) => Number(instance.port))
    .filter((port) => port >= 1 && port <= 65535)
);

export const checkMockServerPortAvailable = async (port, instances, { excludeUid } = {}) => {
  const result = await window.ipcRenderer.invoke('renderer:mock-server-check-port', {
    port: Number(port),
    mockServerUid: excludeUid || null,
    additionalUsedPorts: getConfiguredMockServerPorts(instances, { excludeUid })
  });

  if (!result?.success) {
    throw new Error(result?.error || 'Failed to check port availability');
  }

  return result;
};

export const getMockServerPortError = (portCheck, port) => {
  if (!portCheck || portCheck.available) {
    return null;
  }

  const normalizedPort = Number(port);

  if (portCheck.reason === 'system') {
    return `Port ${normalizedPort} is already in use on this system.`;
  }

  if (portCheck.reason === 'bruno' || portCheck.reason === 'bruno-config') {
    return `Port ${normalizedPort} is already used by another mock server in Bruno.`;

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pick a port manually instead of auto-detection.
  2. Check OS firewall/permissions; retry after closing conflicting applications.

When it happens

Trigger: Thrown at packages/bruno-app/src/utils/mock-server/mock-server-instances.js:443 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/0906d5d08d88c9e2. Report an issue: GitHub.