My Streamlit App was working fine till the last week. But, when I tried to use it today, I see a weird error called “json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)”. Initially, I deployed in Heroku, and it was working without any issues, and just a few hours from now, I see this JSONDecodeError. I have tried many ways to resolve it, but no luck. So, I thought of testing it in my local, and the same error continues to persist. I even tried to deploy it on Streamlit share, and still, this error haunts me.
Here, I provide URLs of my codebase and a complete error log.
Heroku App URL: https://stock-data-app-streamlit.herokuapp.com/
GitHub codebase repo: GitHub - msaf9/DataApp
Streamlit share error log:
2021-07-09 18:42:52.785 An update to the [server] config option section was detected. To have these changes be reflected, please restart streamlit. A new version of Streamlit is available.
See what’s new at Official Announcements - Streamlit
Enter the following command to upgrade:
$ pip install streamlit --upgrade
2021-07-09 18:42:53.182 Uncaught app exception
Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py”, line 337, in _run_script
exec(code, module.dict)
File “/app/dataapp/main.py”, line 44, in
stockDf = stockData.history(period=‘1d’, start=From, end=To)
File “/home/appuser/venv/lib/python3.7/site-packages/yfinance/base.py”, line 157, in history
data = data.json()
File “/home/appuser/.conda/lib/python3.7/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/local/lib/python3.7/json/init.py”, line 348, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.7/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.7/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Heroku deployment error log:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback:
File “/app/.heroku/python/lib/python3.9/site-packages/streamlit/script_runner.py”, line 337, in _run_script
exec(code, module.dict)
File “/app/main.py”, line 43, in
stockDf = stockData.history(period=‘1d’, start=From, end=To)
File “/app/.heroku/python/lib/python3.9/site-packages/yfinance/base.py”, line 157, in history
data = data.json()
File “/app/.heroku/python/lib/python3.9/site-packages/requests/models.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “/app/.heroku/python/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/app/.heroku/python/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/app/.heroku/python/lib/python3.9/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
Can someone help me with this?