{"record":{"id":"4eac4c1e79355110","repo":"ComposioHQ/composio","slug":"failed-to-subscribe-to-triggers-errormessage","errorCode":null,"errorMessage":"Failed to subscribe to triggers: ${errorMessage}","messagePattern":"Failed to subscribe to triggers: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/utils/pusher.ts","lineNumber":269,"sourceCode":"          fn(data);\n        } catch (error: unknown) {\n          const errorMessage = error instanceof Error ? error.message : String(error);\n          logger.error('Error in trigger callback:', errorMessage);\n          // Don't throw here to prevent breaking the subscription\n        }\n      };\n\n      PusherUtils.bindWithChunking(\n        channel as PusherClient,\n        'trigger_to_client',\n        safeCallback as (data: unknown) => void\n      );\n\n      logger.info(`Subscribed to triggers. You should start receiving events now.`);\n    } catch (error: unknown) {\n      const errorMessage = error instanceof Error ? error.message : String(error);\n      logger.error('Failed to subscribe to triggers:', error);\n      throw new Error(`Failed to subscribe to triggers: ${errorMessage}`);\n    }\n  }\n\n  static triggerUnsubscribe(clientId: string): void {\n    try {\n      if (!PusherUtils.pusherClient) {\n        throw new Error('Pusher client not initialized');\n      }\n      PusherUtils.pusherClient.unsubscribe(`private-${clientId}_triggers`);\n      logger.info('Successfully unsubscribed from triggers');\n    } catch (error: unknown) {\n      const errorMessage = error instanceof Error ? error.message : String(error);\n      logger.error('Failed to unsubscribe from triggers:', error);\n      throw new Error(`Failed to unsubscribe from triggers: ${errorMessage}`);\n    }\n  }\n}\n","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/utils/pusher.ts#L251-L287","documentation":"Catch-all wrapper around any failure in triggerSubscribe (init guard, subscription error, bind setup). The underlying message is appended, so inspect it to distinguish errors 404/405/403.","triggerScenarios":"Any failure within PusherUtils.triggerSubscribe: client not initialized, pusher:subscription_error, or bindWithChunking throwing during setup.","commonSituations":"Any of the underlying trigger-subscription failures bubbling through the outer try/catch; most commonly auth failures (405) or initialization order (404).","solutions":["Parse the appended underlying message to route to the right fix (init order vs auth vs chunking)","Ensure getPusherClient completed successfully first with valid credentials","If the appended text mentions 'Trigger subscription error', follow the auth troubleshooting for the API key/baseURL/clientId trio"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  PusherUtils.triggerSubscribe(clientId, fn);\n} catch (e) {\n  const msg = e instanceof Error ? e.message : String(e);\n  logger.error('Trigger subscription failed:', msg);\n  // route to fix based on appended cause\n}","preventionTips":["Initialize the client first with valid credentials","Treat this as a wrapper: always log the full appended message","Retry once for transient network failures"],"tags":["pusher","realtime","triggers","wrapper-error"],"backgroundTag":"event-subscription-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}