Streamlit app refreshing unexpectedly - unable to debug

aibstracts
PRO

10 months ago

I'm encountering a strange behavior in my streamlit app when deployed on railway. This is preventing me and any user from continuing to use it.

Context: At a certain step in my app, the app's 'running', then switches momentarily to 'connecting' and back to square 1. No logs, no errors produced, no nothing to debug and determine what went wrong. I've got this app deployed in streamlit cloud and locally without this issue from occurring at all. Same dependencies, same code base.

There's got to be something internally (in railway) forcing the app to restart.

The only relevant logs i see are these UserWarnings which precede the refreshing:

```

/opt/venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:341: UserWarning: Valid config keys have changed in V2:

level:"error"

deployment: 3f4cbb91-14d3-44ff-ae15-f04b885ce769

replica: d891f7a0-dcd5-4480-8c24-cf3a7171137d

service: 14197733-799a-4bbb-88d7-e6406b4e0bbc

Aug 30 16:12:46

aibstracts-librarian

* 'allow_population_by_field_name' has been renamed to 'populate_by_name'

level:"error"

deployment: 3f4cbb91-14d3-44ff-ae15-f04b885ce769

replica: d891f7a0-dcd5-4480-8c24-cf3a7171137d

service: 14197733-799a-4bbb-88d7-e6406b4e0bbc

Aug 30 16:12:46

aibstracts-librarian

* 'smart_union' has been removed

level:"error"

deployment: 3f4cbb91-14d3-44ff-ae15-f04b885ce769

replica: d891f7a0-dcd5-4480-8c24-cf3a7171137d

service: 14197733-799a-4bbb-88d7-e6406b4e0bbc

Aug 30 16:12:46

aibstracts-librarian

warnings.warn(message, UserWarning)

level:"error"

deployment: 3f4cbb91-14d3-44ff-ae15-f04b885ce769

replica: d891f7a0-dcd5-4480-8c24-cf3a7171137d

service: 14197733-799a-4bbb-88d7-e6406b4e0bbc

So, I've redeployed multiple times with the following filterwarnings:

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="pydantic")

And in both scenarios (with Warnings suppressed and enabled), I can see the following errors on the browser console, which I'm not certain what they refer to exactly (not sure if they're even related to the issue):

main.33cac65c.js:10

GET https://aibstracts-librarian-production.up.railway.app/_stcore/host-config 502 (Bad Gateway)

GET https://aibstracts-librarian-production.up.railway.app/_stcore/host-config 502 (Bad Gateway)

Can you please advise as to why this behavior may be occurring and what the steps should be to perform any kind of troubleshooting.

Thank you in advance.

Solved

2 Replies

aibstracts
PRO

10 months ago

Problem resolved. Had to deploy in Heroku to realize what was going on in here.... Memory usage was likely the cause for the unexpected refresh. It'd be very helpful to be able to monitor the internal actions/limits being hit on railway. It drove me nuts... SOLUTION: Upgrading plan to Hobby ;)


10 months ago

You can check the metrics tab to see that you where hitting the 500MB memory limit of the trial plan!


Status changed to Solved brody 10 months ago