Having trouble deploying streamlit apps on Heroku

Hello,
Please I need help deploying streamlit applications to Heroku. Just a few months ago, I could deploy streanlit apps on Heroku but now, I cannot deploy even a simple app with just one st.write() statement.

Screenshot from 2022-06-01 03-47-57

Here is the output heroku logs --tail --app

2022-05-31T22:20:46.590789+00:00 app[api]: Initial release by user cyrillemesue@gmail.com
2022-05-31T22:20:46.590789+00:00 app[api]: Release v1 created by user cyrillemesue@gmail.com
2022-05-31T22:20:47.206930+00:00 app[api]: Release v2 created by user cyrillemesue@gmail.com
2022-05-31T22:20:47.206930+00:00 app[api]: Enable Logplex by user cyrillemesue@gmail.com
2022-06-01T00:27:08.000000+00:00 app[api]: Build started by user cyrillemesue@gmail.com
2022-06-01T00:28:29.963264+00:00 app[api]: Release v3 created by user cyrillemesue@gmail.com
2022-06-01T00:28:29.963264+00:00 app[api]: Deploy dd2eb9cf by user cyrillemesue@gmail.com
2022-06-01T00:28:29.985400+00:00 app[api]: Scaled to web@1:Free by user cyrillemesue@gmail.com
2022-06-01T00:28:41.269312+00:00 heroku[web.1]: Starting process with command `sh setup.sh && streamlit run bromodomain-app.py`
2022-06-01T00:28:42.667237+00:00 app[web.1]: Traceback (most recent call last):
2022-06-01T00:28:42.667255+00:00 app[web.1]: File "/app/.heroku/python/bin/streamlit", line 5, in <module>
2022-06-01T00:28:42.667378+00:00 app[web.1]: from streamlit.cli import main
2022-06-01T00:28:42.667396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/__init__.py", line 102, in <module>
2022-06-01T00:28:42.667566+00:00 app[web.1]: from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator
2022-06-01T00:28:42.667601+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/DeltaGenerator.py", line 38, in <module>
2022-06-01T00:28:42.667815+00:00 app[web.1]: from streamlit.proto import Alert_pb2
2022-06-01T00:28:42.667834+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/proto/Alert_pb2.py", line 35, in <module>
2022-06-01T00:28:42.667991+00:00 app[web.1]: type=None),
2022-06-01T00:28:42.668001+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 755, in __new__
2022-06-01T00:28:42.668272+00:00 app[web.1]: _message.Message._CheckCalledFromGeneratedFile()
2022-06-01T00:28:42.668294+00:00 app[web.1]: TypeError: Descriptors cannot not be created directly.
2022-06-01T00:28:42.668294+00:00 app[web.1]: If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
2022-06-01T00:28:42.668295+00:00 app[web.1]: If you cannot immediately regenerate your protos, some other possible workarounds are:
2022-06-01T00:28:42.668295+00:00 app[web.1]: 1. Downgrade the protobuf package to 3.20.x or lower.
2022-06-01T00:28:42.668295+00:00 app[web.1]: 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
2022-06-01T00:28:42.668296+00:00 app[web.1]: 
2022-06-01T00:28:42.668298+00:00 app[web.1]: More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
2022-06-01T00:28:42.816530+00:00 heroku[web.1]: Process exited with status 1
2022-06-01T00:28:42.934308+00:00 heroku[web.1]: State changed from starting to crashed
2022-06-01T00:28:42.937828+00:00 heroku[web.1]: State changed from crashed to starting
2022-06-01T00:28:53.184589+00:00 heroku[web.1]: Starting process with command `sh setup.sh && streamlit run bromodomain-app.py`
2022-06-01T00:28:54.267127+00:00 app[web.1]: Traceback (most recent call last):
2022-06-01T00:28:54.267164+00:00 app[web.1]: File "/app/.heroku/python/bin/streamlit", line 5, in <module>
2022-06-01T00:28:54.267261+00:00 app[web.1]: from streamlit.cli import main
2022-06-01T00:28:54.267263+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/__init__.py", line 102, in <module>
2022-06-01T00:28:54.267407+00:00 app[web.1]: from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator
2022-06-01T00:28:54.267417+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/DeltaGenerator.py", line 38, in <module>
2022-06-01T00:28:54.267517+00:00 app[web.1]: from streamlit.proto import Alert_pb2
2022-06-01T00:28:54.267519+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/streamlit/proto/Alert_pb2.py", line 35, in <module>
2022-06-01T00:28:54.267610+00:00 app[web.1]: type=None),
2022-06-01T00:28:54.267619+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 755, in __new__
2022-06-01T00:28:54.268020+00:00 app[web.1]: _message.Message._CheckCalledFromGeneratedFile()
2022-06-01T00:28:54.268033+00:00 app[web.1]: TypeError: Descriptors cannot not be created directly.
2022-06-01T00:28:54.268033+00:00 app[web.1]: If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
2022-06-01T00:28:54.268033+00:00 app[web.1]: If you cannot immediately regenerate your protos, some other possible workarounds are:
2022-06-01T00:28:54.268034+00:00 app[web.1]: 1. Downgrade the protobuf package to 3.20.x or lower.
2022-06-01T00:28:54.268034+00:00 app[web.1]: 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
2022-06-01T00:28:54.268034+00:00 app[web.1]: 
2022-06-01T00:28:54.268042+00:00 app[web.1]: More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
2022-06-01T00:28:54.412147+00:00 heroku[web.1]: Process exited with status 1
2022-06-01T00:28:54.489813+00:00 heroku[web.1]: State changed from starting to crashed
2022-06-01T00:29:02.000000+00:00 app[api]: Build succeeded
2022-06-01T00:29:07.818530+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=cd-discoverer.herokuapp.com request_id=bcbac3d6-064c-4b08-a683-aafcc768a431 fwd="194.27.101.106" dyno= connect= service= status=503 bytes= protocol=https
2022-06-01T00:29:08.403025+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=cd-discoverer.herokuapp.com request_id=b5a8ab3d-4a8e-4372-89f5-332608d47fb8 fwd="194.27.101.106" dyno= connect= service= status=503 bytes= protocol=https


Hi @Cyrille_Mesue, welcome to the Streamlit community!

This is an unfortunate error, but if you specify streamlit >= 1.9.2 in your requirements and re-launch, you should hopefully have more success.

Best,
Randy

Thank you very much. Specifying Streamlit>= 1.9.2 in the requirements.txt file fixed the problem.

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