Deployment failed for python code


Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

code snippet

Deployment failed even though the code works fine in workspace There are no errors explaining why the deployment failed

Hi @MoMore1 , welcome to the forums!
What is your repl about, and what deployment method are you using?

1 Like

Telegram bot, autoscale

1 Like

Does the telegram bot have a webserver (Flask/Express)?
If so, could you send the full deployment logs?
If not, try deploying your bot as a Reserved VM deployment, with the Background worker option.
Hope this helps!

Yes ,I deployed the same code and it worked successfully, but the simple modification to this code is that I added a webhook, and the code worked well in workspace before deployment.
this repl link
There are no errors other than what i sent in the picture

Try deploying it as Reserved VM, using Background worker maybe?

The problem was solved and the deployment was successful, but I have another problem, which is that when I redeploy, the program loses the data that was saved in the Josn file.

May I know how it was solved?

Deployments do not have persistent file systems, unfortunately. Data written to files won’t save, and your best bet is to use an external database like Google’s Firestore.
Hope this helps!