Hi Brian,
Lately and often I get the below error after starting a backtest run. It usually runs fine. However, randomly after the backtest has been running for over 20 minutes or more it suddenly throws the below error. I am always connected to the internet and have no connectivity issues either. Any idea why this keeps happening?
Thanks
Here is the log output:
HTTPError Traceback (most recent call last)
File :10, in
File /opt/conda/lib/python3.9/site-packages/quantrocket/zipline.py:636, in backtest(strategy, data_frequency, capital_base, bundle, start_date, end_date, progress, params, filepath_or_buffer)
632 _params["progress"] = progress
634 response = houston.post("/zipline/backtests/{0}".format(strategy), params=_params, timeout=606096)
--> 636 houston.raise_for_status_with_json(response)
638 filepath_or_buffer = filepath_or_buffer or sys.stdout
639 write_response_to_filepath_or_buffer(filepath_or_buffer, response)
File /opt/conda/lib/python3.9/site-packages/quantrocket/houston.py:212, in Houston.raise_for_status_with_json(response)
210 e.json_response = {}
211 e.args = e.args + ("please check the logs for more details",)
--> 212 raise e
File /opt/conda/lib/python3.9/site-packages/quantrocket/houston.py:204, in Houston.raise_for_status_with_json(response)
199 """
200 Raises 400/500 error codes, attaching a json response to the
201 exception, if possible.
202 """
203 try:
--> 204 response.raise_for_status()
205 except requests.exceptions.HTTPError as e:
206 try:
File /opt/conda/lib/python3.9/site-packages/requests/models.py:960, in Response.raise_for_status(self)
957 http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
959 if http_error_msg:
--> 960 raise HTTPError(http_error_msg, response=self)
HTTPError: ('400 Client Error: BAD REQUEST for url: http://houston/zipline/backtests/LongShortStratProdRefe?data_frequency=daily&capital_base=5000000&bundle=usstock-1d-bundle&start_date=2021-01-01&end_date=2023-03-21&progress=D', {'status': 'error', 'msg': "('403 Client Error: FORBIDDEN for url: http://houston/history/refe-fundamentals.csv?start_date=2019-09-01&end_date=2021-07-14&fields=ForwardEnterpriseValueToOperatingCashFlow&fields=LongTermGrowth_Mean&fields=EnterpriseValueToEBITDA_&fields=CombinedAlpha&fields=CompanyMarketCap', {'status': 'error', 'error': 'A license key is required (view license details if this is unexpected, see Usage Guide for help)'}) (see detailed logs for full traceback)"})