Streamlit App crashes on Heroku

For the record I been searching all over the Streamlit Forum and Stack Overflow for finding a solution before posting this question.

I developed a PyTorch based Image Classification Inference App (Covid Detector) using Streamlit. I tried to deploy the app in Heroku. But the app crashes on Heroku for an unknown reason. Please help me resolve it.

Here’s my repository : Covid-Detector

2020-06-23T21:58:25.453800+00:00 heroku[web.1]: State changed from starting to crashed

2020-06-24T03:36:28.910332+00:00 heroku[web.1]: State changed from crashed to starting

2020-06-24T03:36:48.637972+00:00 heroku[web.1]: Starting process with command `sh && streamlit run`  
2020-06-24T03:36:53.063897+00:00 heroku[web.1]: Process exited with status 139

2020-06-24T03:36:53.099917+00:00 heroku[web.1]: State changed from starting to crashed

2020-06-24T04:59:03.034010+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" request_id=41d80cd4-e50d-46e8-95b1-820c76284a3c fwd="" dyno= connect= service= status=503 bytes=protocol=https

2020-06-24T04:59:04.307493+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" request_id=15175180-2d40-4f52-b97e-59c604b99228 fwd="" dyno= connect= service= status=503 bytes= protocol=https

Having the same issue. I did make sure my Procfile and is correct


I am getting the same issue. I am too using PyTorch and Opencv to deploy over heroku Repo. It is giving same H10 error. It works fine locally. I have checked it. Please provide solution.


Haven’t check it for a while and use AWS instead to deploy it on the web using this tutorial

1 Like

While it might feel like an unsatisfactory response, plenty of people seem to be able to deploy on Heroku, so it’s definitely possible. Your Procfile and can’t be right and not work.

I would suggest doing the most basic example you can first, where there are no imports other than Streamlit and your configuration file. Once you can make that work, then you can layer in the complexity.

Hi. Have you found the solution for this? I faced a similar issue recently because I had to download easyocr library which runs on PyTorch.

Same issue with my project.
Works excellent at localhost but while deploying it using heroku CLI, it gives me this warning.

the config option ‘server.enableCORS=false’ is not compatible with ‘server.enableXsrfProtection=true’. As a result, ‘server.enableCORS’ is being overridden to ‘true’.

I solved the same Error…

If you are using OpenCV-python in…change it to opencv-contrib-python-headless… It worked for me…

1 Like

That’s right! I solved the same error too! Thank you!