Deploying a python Telethon bot fails

I recently deployed a telegram bot with which I used the telethon library to work on.
It got deployed successfully and the bot was working. But it was spamming messages instead, It kept sending messages repeatedly but worked fine when I ran it locally. So I deleted the build, I thought there was a problem with my code, and I fixed what I thought could be a potential cause. Today I tried to deploy it again and it failed. In the start command, I entered: “gunicorn app:app” (my main filename is app.py), I’ve set all my environment variables correctly, but the deployment just fails. It says build successfully but is unable to start the script. I tried to change the start command from: “gunicorn app:app” (which I used in the first deployment that was successful) to “python3 app.py” and still deployment fails. I don’t see any error in the log as you can see in the screenshot. Please help. Thank you.

Hey there,

Use a Background Worker for best results, but not available with free instances. Web Service may fail after 10 mins or run in duplicates due to zero-downtime. Discord bots may face rate limiting issue, we’ve reached out to Discord but we don’t have a solution here yet. Let us know if you need further assistance."

Regards.
Jérémy, Render Support

1 Like

Hi, Jeremy !
I think, I’ve almost the same problem
When I ran my app by local terminal, all was ok, but Render fails the running process. Below are the details.

Try to deploy my telegram bot (python, telethon)

I’ve been having the error:
"
Mar 21 02:41:31 PM EOFError: EOF when reading a line
"
How can I fix it in Render ?

And how can I enter data into internal hosting terminal ? Is there smth like that in Render or not ?

"
Mar 21 02:41:32 PM Enter api_id:
"

For example, I need to enter manually API_ID, API_HASH, my telegram confirmation code and etc to make my code run in full.

How can I do this ? I have no clue, how to do it, I haven’t find any interface like Hosting Terminal Window or smth else.

Link to my public repository in GitHub: GitHub - ArseniiFigurin/Telegram-Chats-Messaging-Bot-rus-: Telegram Chats Messaging Bot (rus)

Link to my Render Web Service Pack: https://arseniifigurin-telegram-chats-messaging-3kc5.onrender.com

I need Help

Thank you so much !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.