Errors while deploying golang telegram bot with postgres

Hello everyone. I am trying to deploy my simple golang telegram bot (with postgres DB connection (via connection string) hosted here on Render), but when I am having quite strange issues. Here is log:

May 10 04:01:18 PM ==> Build uploaded in 12s
May 10 04:01:18 PM ==> Build successful :tada:
May 10 04:01:18 PM ==> Deploying…
May 10 04:01:34 PM 2023/05/10 13:01:34 SERVER STARTED
May 10 04:01:34 PM 2023/05/10 13:01:34 DB CONNECTION ESTABLISHED
May 10 04:02:16 PM 2023/05/10 13:02:16 unexpected end of JSON input

So server successfully starts and working, but after some time I am getting this JSON errors. It runs absolutely fine on my PC. Furthermore, even after server started, render says “in progress…”.
After that it restarts server several times with the same error and then fails…

Edit: I am not using any side packages except pq, which, according to the logs, is always downloaded and works

I think some error in your code. Better you can use: “try - except” to handle the error

Hey,

On Render, bots are best deployed using a Background Worker, which runs persistently in the background without exposing a web server. However, this service type is not available with a free instance.

If you attempt to run a bot via a Web Service, the deployment will likely fail after approximately 10 minutes. Sometimes, there may be instances where two bots are running simultaneously for a brief period. This behavior is related to our zero-downtime feature and cannot be disabled.

Regards.
Jérémy, Render Support

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