So I bought a new computer (MacbookPro 64GB just to be sure) installed everything from scratch....
Identical error pattern
I suspect it has to do with values in the database for SPY (maybe the volumes are too big for ints?)
I'm willing privately to share my algo file for bugfixing purposes.... I'm pretty desparate
the dates are consistent: ["20200508","20200506","20200507","20200507", "20200308"]
My universe is fixed:
context.SPY = algo.sid('FIBBG000BDTBL9')
context.GLD = algo.sid("FIBBG000CRF6Q8")#"SPDR GOLD SHARES"
context.VNQ= algo.sid("FIBBG000Q89NG6")#"VANGUARD REAL ESTATE ETF"
context.EEM= algo.sid("FIBBG000M0P5L2")#"ISHARES MSCI EMERGING MARKET"
context.RWX= algo.sid('FIBBG000Q8TD76')
context.IEF=algo.sid('FIBBG000BHR296')
context.TLT= algo.sid('FIBBG000BJKYW3')
context.EWJ=algo.sid('FIBBG000BK38F5')
context.VGK=algo.sid('FIBBG000HT8SM3')
context.SLV=algo.sid('FIBBG000NDCRW7')
context.DBB=algo.sid('FIBBG000QNK9K6')
context.UUP=algo.sid('FIBBG000Q7R318')
context.TLH=algo.sid('FIBBG000QN16D1')
context.XLC=algo.sid("FIBBG00L5F9F38") #""COMM SERV SELECT SECTOR SPDR"
context.XLY=algo.sid("FIBBG000BJ1MF9") #""CONSUMER DISCRETIONARY SELT"
context.XLP=algo.sid("FIBBG000BJ10N8") #""CONSUMER STAPLES SPDR"
context.XLE=algo.sid("FIBBG000BJ20S2") #""ENERGY SELECT SECTOR SPDR"
context.XLF=algo.sid("FIBBG000BJ29X7") #""FINANCIAL SELECT SECTOR SPDR"
context.XLV=algo.sid("FIBBG000BHVSG6") #""HEALTH CARE SELECT SECTOR"
context.XLI=algo.sid("FIBBG000BJ2RF7") #""INDUSTRIAL SELECT SECT SPDR"
context.XLB=algo.sid("FIBBG000BHNNF7") #""MATERIALS SELECT SECTOR SPDR"
context.XLRE=algo.sid("FIBBG00B597128") #"REAL ESTATE SELECT SECT SPDR"
context.XLK=algo.sid("FIBBG000BJ7007") #""TECHNOLOGY SELECT SECT SPDR"
context.XLU=algo.sid("FIBBG000BJ7G75") #""UTILITIES SELECT SECTOR SPDR"
Sometimes the error is :
quantrocket_zipline_1|Fatal Python error: GC object already tracked
quantrocket_zipline_1|
quantrocket_zipline_1|Thread 0x00007fbb0b3e7700 (most recent call first):
quantrocket_zipline_1|
quantrocket_zipline_1|Thread 0x00007fbb0abe6700 (most recent call first):
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/threading.py", line 295 in wait
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/queue.py", line 164 in get
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/logging/handlers.py", line 1401 in dequeue
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/logging/handlers.py", line 1452 in monitor
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/threading.py", line 864 in run
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/threading.py", line 916 in bootstrap_inner
quantrocket_zipline_1| File "/opt/c, line 884t (most recent call first):
quantrocket_zipline_1|"/opt/conda/lib/python3.6/site-packages/zipline/utils/eventst File "/optl/th3.s-agktp", line ps File "/opt/co/ry441rpe File /opt/conda/lib/pythkfksl_it.py", line 587 in dispatch_request
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/flask/views.py", line 84 in view
quantrocket_zipline_1| File "/opt/conda/lib/lib/python3.6/siteaksa/py", line 1598 in dispatch_request
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/flask/app.py", line 1612 in full_dispatch_request
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/flask/app.py", line 1982 in wsgi_app
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/flask/app.py", line 1994 in call
quantrocket_zipline_1| File "sym://qrocket_wsgi_py", line 30 in app
quantrocket_houston_1|2021/02/05 07:46:35 [error] 12#12: *153 upstream prematurely closed connection while reading response header from upstream, client: 172.18.0.9, server: , request: "POST /zipline/backtests/riskpar?start_date=2020-01-01&end_date=2021-02-02&progress=W HTTP/1.1", upstream: "uwsgi://172.18.0.19:80", host: "houston"
quantrocket_houston_1|172.18.0.9 - - [05/Feb/2021:07:46:35 +0000] "POST /zipline/backtests/riskpar?start_date=2020-01-01&end_date=2021-02-02&progress=W HTTP/1.1" 502 0 "-" "python-urllib3/1.26.2"
quantrocket_zipline_1|DAMN ! worker 1 (pid: 37) died, killed by signal 6 trying respawn ...
quantrocket_zipline_1|Respawned uWSGI worker 1 (new pid: 49)
quantrocket_zipline_1|[deadlock-detector] a process holding a robust mutex died. recovering..
Sometimes it's
quantrocket_houston_1|172.18.0.11 - - [05/Feb/2021:08:03:40 +0000] "POST /flightlog/handler HTTP/1.1" 200 5 "-" "-"
quantrocket_zipline_1|Traceback (most recent call last):
quantrocket_zipline_1| File "sym://qrocket_app_py", line 798, in post
quantrocket_zipline_1| File "sym://qrocket_qrzipline_backtest_py", line 167, in backtest_algo
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/algorithm.py", line 669, in run
quantrocket_zipline_1| for perf in self.get_generator():
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/gens/tradesimulation.py", line 205, in transform
quantrocket_zipline_1| for capital_change_packet in every_bar(dt):
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/gens/tradesimulation.py", line 133, in every_bar
quantrocket_zipline_1| handle_data(algo, current_data, dt_to_use)
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/utils/events.py", line 218, in handle_data
quantrocket_zipline_1| dt,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/utils/events.py", line 237, in handle_data
quantrocket_zipline_1| self.callback(context, data)
quantrocket_zipline_1| File "riskpar", line 672, in record_vars
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/algorithm.py", line 1578, in account
quantrocket_zipline_1| self._sync_last_sale_prices()
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/algorithm.py", line 1567, in _sync_last_sale_prices
quantrocket_zipline_1| self.data_portal,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/finance/metrics/tracker.py", line 201, in sync_last_sale_prices
quantrocket_zipline_1| handle_non_market_minutes=handle_non_market_minutes,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/finance/ledger.py", line 464, in sync_last_sale_prices
quantrocket_zipline_1| handle_non_market_minutes=handle_non_market_minutes,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/finance/ledger.py", line 285, in sync_last_sale_prices
quantrocket_zipline_1| update_position_last_sale_prices(self.positions, get_price, dt)
quantrocket_zipline_1| File "zipline/finance/_finance_ext.pyx", line 14, in zipline.finance._finance_ext.update_position_last_sale_prices (zipline/finance/_finance_ext.c:2133)
quantrocket_zipline_1| File "zipline/finance/_finance_ext.pyx", line 32, in zipline.finance._finance_ext.update_position_last_sale_prices (zipline/finance/_finance_ext.c:1945)
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/data_portal.py", line 572, in get_scalar_asset_spot_value
quantrocket_zipline_1| data_frequency,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/data_portal.py", line 468, in _get_single_asset_value
quantrocket_zipline_1| asset, "close", dt, ffill=True,
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/data_portal.py", line 718, in _get_minute_spot_value
quantrocket_zipline_1| query_dt = reader.get_last_traded_dt(asset, dt)
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/dispatch_bar_reader.py", line 101, in get_last_traded_dt
quantrocket_zipline_1| return r.get_last_traded_dt(asset, dt)
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/minute_bars.py", line 1153, in get_last_traded_dt
quantrocket_zipline_1| minute_pos = self._find_last_traded_position(asset, dt)
quantrocket_zipline_1| File "/opt/conda/lib/python3.6/site-packages/zipline/data/minute_bars.py", line 1179, in _find_last_traded_position
quantrocket_zipline_1| self._minutes_per_day,
quantrocket_zipline_1| File "zipline/data/_minute_bar_internal.pyx", line 130, in zipline.data._minute_bar_internal.find_last_traded_position_internal (zipline/data/_minute_bar_internal.c:2371)
quantrocket_zipline_1| File "zipline/data/_minute_bar_internal.pyx", line 87, in zipline.data._minute_bar_internal.find_position_of_minute (zipline/data/_minute_bar_internal.c:2094)
quantrocket_zipline_1|OverflowError: value too large to convert to int
and somtimes its:
quantrocket_flightlog_1|2021-02-05 08:11:26 quantrocket.zipline: INFO [riskpar] ███------- 31% 2020-05-04 8% 3.01 -4% $79208
quantrocket_houston_1|172.18.0.4 - - [05/Feb/2021:08:11:26 +0000] "POST /flightlog/handler HTTP/1.1" 200 5 "-" "-"
quantrocket_zipline_1|!!! uWSGI process 39 got Segmentation Fault !!!
quantrocket_zipline_1|*** backtrace of 39 ***
quantrocket_zipline_1|uwsgi-quantrocket(uwsgi_backtrace+0x30) [0x46ea00]
quantrocket_zipline_1|uwsgi-quantrocket(uwsgi_segfault+0x21) [0x46eda1]
quantrocket_zipline_1|/lib/x86_64-linux-gnu/libc.so.6(+0x350e0) [0x7fbe11ca10e0]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1482e3) [0x7fbe123962e3]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1e7d) [0x7fbe123988dd]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x145e74) [0x7fbe12393e74]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1485e8) [0x7fbe123965e8]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x10c) [0x7fbe12394cfc]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x166) [0x7fbe122b9ba6]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyObject_Call_Prepend+0xcc) [0x7fbe122b9dfc]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x9e) [0x7fbe122b9ade]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1ba22f) [0x7fbe1240822f]
quantrocket_zipline_1|/opt/conda/lib/python3.6/site-packages/zipline/finance/_finance_ext.cpython-36m-x86_64-linux-gnu.so(+0x1050b) [0x7fbde75ca50b]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x102) [0x7fbe12310df2]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1484ec) [0x7fbe123964ec]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1e7d) [0x7fbe123988dd]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1e7d) [0x7fbe123988dd]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x63) [0x7fbe12394ee3]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x9edc2) [0x7fbe122ecdc2]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(PyObject_Call+0x56) [0x7fbe122b9e96]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x8b63e) [0x7fbe122d963e]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyObject_GenericGetAttrWithDict+0x93) [0x7fbe12314843]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4598) [0x7fbe1239aff8]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x145e74) [0x7fbe12393e74]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1485e8) [0x7fbe123965e8]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x145e74) [0x7fbe12393e74]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1485e8) [0x7fbe123965e8]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x145e74) [0x7fbe12393e74]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x1485e8) [0x7fbe123965e8]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x95e33) [0x7fbe122e3e33]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x248e) [0x7fbe12398eee]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x95e33) [0x7fbe122e3e33]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x248e) [0x7fbe12398eee]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x26fd) [0x7fbe1239915d]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x14848a) [0x7fbe1239648a]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1e7d) [0x7fbe123988dd]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x146a60) [0x7fbe12394a60]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x63) [0x7fbe12394ee3]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(+0x9eee1) [0x7fbe122ecee1]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(PyObject_Call+0x56) [0x7fbe122b9e96]
quantrocket_zipline_1|/opt/conda/lib/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x37d6) [0x7fbe1239a236]
quantrocket_zipline_1|*** end of backtrace ***
quantrocket_houston_1|2021/02/05 08:11:26 [error] 12#12: *184 upstream prematurely closed connection while reading response header from upstream, client: 172.18.0.13, server: , request: "POST /zipline/backtests/riskpar?start_date=2020-01-01&end_date=2021-02-02&progress=W HTTP/1.1", upstream: "uwsgi://172.18.0.4:80", host: "houston"
quantrocket_houston_1|172.18.0.13 - - [05/Feb/2021:08:11:26 +0000] "POST /zipline/backtests/riskpar?start_date=2020-01-01&end_date=2021-02-02&progress=W HTTP/1.1" 502 0 "-" "python-urllib3/1.26.2"
quantrocket_zipline_1|DAMN ! worker 1 (pid: 39) died, killed by signal 11 trying respawn ...
quantrocket_zipline_1|Respawned uWSGI worker 1 (new pid: 51)
quantrocket_zipline_1|[deadlock-detector] a process holding a robust mutex died. recovering...