MQTT connection unstable just after deployment

Hi Render team,

I have a node JS web service running on render and this service needs to connect with a MQTT broker (I am using HiveMQ). Everything works fine running locally, but when I deploy this app to render cloud, it takes some time to establish the connection with the broker. It connects with success and in a short time it disconnects without any errors. It only occurs just after a new deploy. After some connections/disconnections following this pattern, a successful connection is stablished.

I am sure this is not related to my MQTT connection credentials (like use unique Id etc) cause it is working locally and in other cloud services (but I really like render and I would like to continue using it). Also, I have reported a very similar issue using websockets months ago here in the forum: /t/websocket-new-connections-entering-in-a-loop/25902

At the time I opened this issue, I was not sure because I was connecting microcontrolers to render. But now I am testing a very simple node js app, and the issue is exactly the same! I am suspecting render has a tricky bug to establish the connection just after the deploy.

Do you have a way to see deep logs for an app? From my app, there is no errors, only the events of “connection” and a little while the “disconnection” being triggered.

I would appreciate your help. Thanks in advance!