I’m running a private Repl for around a month now, with no issues. But yesterday, it errored out with the following error:
python main.py
Traceback (most recent call last):
File "/home/runner/SimulationsHedge/venv/lib/python3.10/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/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)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/runner/SimulationsHedge/main.py", line 1, in <module>
import data.options_table as options
File "/home/runner/SimulationsHedge/data/options_table.py", line 2, in <module>
import data.contracts_data as dt
File "/home/runner/SimulationsHedge/data/contracts_data.py", line 35, in <module>
btc_data = btc_response.json()
File "/home/runner/SimulationsHedge/venv/lib/python3.10/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
It seems the error is when fetching the bitcoin price from Coingecko API - but when I check the API manually it works, and Coingecko reported no issues.
When I run the same code in my PyCharm locally, it also works.
But on Replit it’s erroring out a second after I run the main.py, and it still doesn’t work after many attempts in last 20 hours.
Would appreciate If I can get some help, what could be the problem here?