Streamlit App not deploying to heroku

Hey

I was trying to deploy my app to Heroku but it is giving me this error in the build logs


2021-08-10T11:04:39.246704+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=para-tools.herokuapp.com request_id=33220c49-b047-422b-8b24-6b3a557a23a0 fwd="59.177.78.99" dyno= connect= service= status=503 bytes= protocol=https
2021-08-10T11:04:40.722952+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=para-tools.herokuapp.com request_id=b6a94c58-64a4-4ba6-b6be-7d291ed8e4ce fwd="59.177.78.99" dyno= connect= service= status=503 bytes= protocol=https

This is my setup.sh file :
mkdir -p ~/.streamlit/
echo "[general]"  > ~/.streamlit/credentials.toml
echo "email = \"my@email.com\""  >> ~/.streamlit/credentials.toml
echo "[server]"  > ~/.streamlit/config.toml 
echo "headless = true"  >> ~/.streamlit/config.toml
echo "port = $PORT"  >> ~/.streamlit/config.toml
echo "enableCORS = true"  >> ~/.streamlit/config.toml


This is the Procfile :

web: sh setup.sh && streamlit run input.py





This is requirements.txt :

en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0-py3-none-any.whl
gitdb==4.0.7
GitPython==3.1.18
nltk==3.6.2
python-dateutil==2.8.2
python-git==2018.2.1
scikit-learn==0.24.2
sklearn==0.0
spacy==3.1.1
spacy-legacy==3.0.8
streamlit==0.86.0
gunicorn

Why is it not working ?

1 Like

Hi @Adit_Magotra,

It may be an issue with the setup.sh file.

Can you please try with:

mkdir -p ~/.streamlit

echo "[server]
headless = true
port = $PORT
enableCORS = false
" > ~/.streamlit/config.toml

Another option is to wait for your Streamlit Sharing invite that should arrive very shortly! :stuck_out_tongue:

Best,
Charly

Hey ! This is still not working. Samme erroor.

But definitely waiting for Streamlit Share access as I want to finish it by tonight : )

1 Like

Thanks for the prompt feedback @Adit_Magotra!

I’ll nudge folks internally to make sure you get your invite even faster! :wink:

Can you pls give me your email address and GH username?

Thanks
Charly

Thanks a lot @Charly_Wargnier

E-Mail - aditmagotra@gmail.com
Github - AlphaLaser · GitHub

1 Like

Thanks! Keep your eyes peeled on your inbox! :wink:

Hey, Thanks! Hoping to receive that mail soon :smiley::smiley:

Hi, i don’t know why but maybe is there a problem in your requirements.txt. Mine setup.sh, Procfile and requirements.txt are like:

setup.sh:

mkdir -p ~/.streamlit/
echo "\
[server]\n\
headless = true\n\
port = $PORT\n\
enableCORS = false\n\
\n\
" > ~/.streamlit/config.toml

Procfile:

web: sh setup.sh && streamlit run first_app.py

requirements.txt:

streamlit==0.85.0
pandas
numpy
altair
xlrd
openpyxl
streamlit_analytics
1 Like