a month ago
My Telegram bot, deployed on Railway, is consistently failing to connect to the Pocket Option trading API. The bot uses the pocketoptionapi-async Python library to establish WebSocket connections to Pocket Option servers. Despite using a fresh SSID and implementing robust reconnection logic, the bot receives SSID EXPIRED errors. Upon reviewing the Railway deployment logs, I am seeing repeated connection failures to various regional Pocket Option API servers."ERROR | pocketoptionapi_async.client:_attempt_reconnection:1485 - All 3 reconnection attempts failed•ERROR: __main__:Error: Not connected to PocketOption and reconnection failed•Failed to connect to region SERVER1: Failed to connect to any WebSocket endpoint•Trying region: FRANCE2 with URL: wss://api-fr2.po.market/socket.io/?EIO=4&transport=websocket•Failed to connect to region SEYCHELLES: Failed to connect to any WebSocket endpoint
1 Replies
Status changed to Open Railway • 27 days ago
a month ago
Hello
your bot is getting disconnected because railway automatically kills any websocket connection that stays open longer than 15 minutes and when that happens your bot tries to reconnect but pocketoption sees the unexpected drop and marks the session as expired
to solve thi make your bot reconnect every 13 minutes proactively before railway cuts it. that way the reconnect is clean and controlled instead of being caused by a forced timeout
Hope this help you :)