Continuous ws error: Unexpected server response: 403 errors flooding Railway logs
- Stricter enabled check - Now requires EXACT match of
'true' - Constructor logging - Shows when service is disabled
- Enhanced error handling - Immediately terminates WebSocket on 403
- Reconnection guards - Multiple checks to prevent reconnect loops
- Missing import fixed - Added pumpFunWebhook import in webhook-routes.ts
Since Helius webhook already handles all token detection, PumpFun WebSocket is redundant.
Railway Dashboard Steps:
- Go to your Railway project
- Select your service
- Go to Variables tab
- Look for
ENABLE_PUMPFUN_MONITORvariable - If it exists:
- DELETE IT (this will default to disabled), OR
- Set it to
false
- Click Deploy or let auto-deploy run
Expected Result:
- Logs will show:
[PumpFun] Service disabled (ENABLE_PUMPFUN_MONITOR not set to true) - No more 403 errors
- Helius webhook continues to detect all tokens
If you specifically need PumpFun WebSocket monitoring:
- Contact https://pumpportal.fun for API access
- Get authenticated WebSocket URL
- Update
PUMP_FUN_WS_URLin Railway with authenticated endpoint - Ensure
ENABLE_PUMPFUN_MONITOR=true
Look for one of these messages at startup:
If disabled (good):
[PumpFun] Service disabled (ENABLE_PUMPFUN_MONITOR not set to true)
If enabled but still getting 403:
[PumpFun] β οΈ 403 Authentication Error - Pump.fun WebSocket requires authentication
[PumpFun] Set ENABLE_PUMPFUN_MONITOR=false in Railway environment variables to disable
If successfully connected:
[PumpFun] Connecting to WebSocket: wss://pumpportal.fun/api/data
[PumpFun] WebSocket connected
[PumpFun] Subscribed to events: ['new_token', 'graduation']
The PumpFun WebSocket endpoint (wss://pumpportal.fun/api/data) now requires authentication or is rate-limiting/blocking connections. Previously it was open, but they've tightened access.
Your app has:
- β Helius webhook - Detects ALL Solana tokens (working perfectly)
- β QuickNode streams - Custom monitoring (if configured)
- β PumpFun WebSocket - Redundant and requires auth
Working Services:
- Helius webhook β (detecting 120+ tokens/min)
- Token analyzer β
- Database β
- Frontend β
- Discord bot β (if enabled)
- Telegram bot β (if enabled)
Issue:
- PumpFun WebSocket - Getting 403 errors (not critical, can be disabled)
- Check Railway Variables tab
- Remove or set
ENABLE_PUMPFUN_MONITOR=false - Wait for auto-deploy or manually redeploy
- Verify logs show service disabled
- Confirm 403 errors are gone
That's it! Your app will work perfectly with just Helius webhook handling token detection.