ComposioHQ/composio · warning · Error
Pusher connection error: ${err.message}
Error message
Pusher connection error: ${err.message} What it means
The Composio SDK's realtime trigger client (pusher-js) fires a connection 'error' event while establishing or maintaining its websocket connection to the Pusher cluster. The handler in getPusherClient rethrows it as 'Pusher connection error'. This indicates a websocket-level connectivity problem, not an issue with your Composio API key.
Source
Thrown at ts/packages/core/src/utils/pusher.ts:101
try {
callback(null, JSON.parse(data));
} catch (e) {
logger.error('Failed to parse auth response:', e);
callback(new Error('Invalid auth response format'), null);
}
})
.catch((error: unknown) => {
logger.error('Pusher auth request failed:', error);
callback(error instanceof Error ? error : new Error(String(error)), null);
});
},
},
});
// Add connection error handling
PusherUtils.pusherClient.connection.bind('error', (err: Error) => {
logger.error('Pusher connection error:', err);
throw new Error(`Pusher connection error: ${err.message}`);
});
}
return PusherUtils.pusherClient;
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : String(error);
logger.error('Failed to initialize Pusher client:', error);
throw new Error(`Failed to initialize Pusher client: ${errorMessage}`);
}
}
/**
* Subscribes to a Pusher channel and binds an event to a callback function.
* @param {string} channelName - The name of the channel to subscribe to.
* @param {string} event - The event to bind to the channel.
* @param {(data: Record<string, unknown>) => void} fn - The callback function to execute when the event is triggered.
* @returns {PusherClient} The Pusher client instance.
*/
static async subscribe(View on GitHub (pinned to 64b1b85502)
Solutions
- Verify outbound websocket connectivity to the Pusher cluster (cluster mt1) on port 443 from your environment
- If behind a corporate proxy/firewall, allowlist *.pusher.com or configure a websocket-capable proxy for pusher-js
- Retry in a network-open environment (e.g. local machine) to confirm it's environmental
- Check for an SDK version update — the Pusher key is bundled (CLIENT_PUSHER_KEY) and an outdated SDK may carry a stale key
Example fix
// before: running in locked-down CI
await PusherUtils.getPusherClient(baseURL, apiKey);
// after: guard the call
try {
await PusherUtils.getPusherClient(baseURL, apiKey);
} catch (e) {
console.warn('Realtime triggers unavailable, falling back to polling', e);
} Defensive patterns
Strategy: try-catch
Try / catch
try {
await PusherUtils.getPusherClient(baseURL, apiKey);
} catch (e) {
// realtime is optional for many flows; degrade gracefully
logger.warn('Realtime triggers unavailable:', e instanceof Error ? e.message : e);
} Prevention
- Verify websocket egress to *.pusher.com:443 in Docker/CI before enabling triggers
- Treat realtime triggers as optional: catch init failures and fall back to polling
- Test trigger flows in a network-open environment first
When it happens
Trigger: Calling an API that initializes realtime triggers (e.g. Composio.getPusherClient(baseURL, apiKey) or trigger subscription flows) when the environment cannot reach the Pusher cluster (ws://*.pusher.com:443) — blocked ports, restrictive corporate firewalls, offline/sandboxed CI, or an invalid/expired Pusher key/cluster configuration.
Common situations: CI containers with egress allowlists that only permit the Composio API domain; running in Docker without network access; proxies that block websockets; ad-blockers or network policies on the developer machine.
Related errors
- Invalid chunked trigger data format
- Failed to bind chunked events: ${errorMessage}
- Trigger subscription error
- Failed to subscribe to triggers: ${errorMessage}
- Failed to initialize Pusher client: ${errorMessage}
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/bc5bd5e8f09c893f.
Report an issue: GitHub.