Troubleshooting
Sometimes things go wrong. Here are some common problems and solutions.
Connection Issues
Bot Not Starting
The issue: Your bot is failing to start and throws connection errors.
How to fix it:
- Verify your
API_IDandAPI_HASHare correct. - Ensure your bot token is actually valid.
- Check network connectivity to the Telegram API.
Cannot Connect to Telegram
The issue: You are getting "Failed to connect" or timeout errors.
How to fix it:
- Check your firewall settings. Telegram needs port 443 open.
- Make sure your server can actually reach
api.telegram.org. - Try enabling
USE_PUBLIC_IPif you are behind a NAT.
Stream Issues
Slow Stream Start
The issue: A video takes a very long time to start playing.
How to fix it:
- Increase
STREAM_CONCURRENCYfor a faster initial fetch. - Increase
STREAM_BUFFER_COUNTto prefetch more data. - Check your network latency to Telegram's servers.
Stream Fails Mid-Playback
The issue: The stream randomly stops or throws errors during playback.
How to fix it:
- Increase
STREAM_TIMEOUT_SECif you are dealing with slow connections. - Increase
STREAM_MAX_RETRIESif the network is just unreliable. - Check server logs for any specific error messages.
- Make sure your server has enough memory to support your buffer count.
Flood Wait Errors
The issue: You keep seeing "Flood wait" errors popping up in the logs.
How to fix it:
- Lower your
STREAM_CONCURRENCY. - Add more worker bots (check out the Multi-Bot Setup).
- Wait out the specified cooldown period.
Configuration Issues
Invalid Log Channel
The issue: The bot cannot post to the log channel.
How to fix it:
- Make sure your bot is actually an admin in the channel.
- Verify your
LOG_CHANNELID is correct (it must be a negative number starting with-100). - Test it manually by sending a message through the bot's API.
Host URL Not Working
The issue: The generated links simply do not work.
How to fix it:
- Set
HOSTexplicitly to your domain or IP address in your.envfile. - If you deployed to a cloud platform, make sure
HOSTmatches your public app URL. - Make sure you exposed your port correctly.
High Memory Usage
The issue: Your server is running completely out of memory.
How to fix it:
- Reduce your
STREAM_BUFFER_COUNT. - Limit concurrent streams at your proxy or load balancer level.
- Get a beefier server.
Exploring User Sessions
If you need to automatically add bots to your log channel, you need a USER_SESSION. Run the following command:
./fsb session --api-id <your_api_id> --api-hash <your_api_hash>.\fsb session --api-id <your_api_id> --api-hash <your_api_hash>🟠 WARNING
Use this feature with caution. Newly created accounts might get banned by Telegram.
Scan the generated QR code with your Telegram app. If the session is invalid or expired, just generate a new one.
Getting Help
If none of this helped, you can always open a GitHub Issue or join the Telegram Support Group. We won't bite.. unless you don't follow the common internet etiquettes.