Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker disabled due to KeyError: 'orderid' #782

Closed
abitmore opened this issue Dec 2, 2021 · 1 comment
Closed

Worker disabled due to KeyError: 'orderid' #782

abitmore opened this issue Dec 2, 2021 · 1 comment

Comments

@abitmore
Copy link

abitmore commented Dec 2, 2021

Error logs:

2021-12-02 14:25:00,152 - mm.xusdt-xhive.abot-stag using account mm.xusdt-xhive.abot on XBTSX.HIVE/XBTSX.USDT - INFO - Placing a buy order with 246.927378 XBTSX.USDT @ 2.03085904
2021-12-02 14:25:03,352 - mm.xusdt-xhive.abot-stag using account mm.xusdt-xhive.abot on XBTSX.HIVE/XBTSX.USDT - ERROR - in ontick()
Traceback (most recent call last):
  File "/home/ubuntu/dexbot/dexbot/worker.py", line 131, in on_block
    self.workers[worker_name].ontick(data)
  File "/home/ubuntu/opt/python-3.9.1/lib/python3.9/site-packages/events/events.py", line 95, in __call__
    f(*a, **kw)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 2249, in tick
    self.maintain_strategy()
  File "/home/ubuntu/dexbot/dexbot/decorators.py", line 21, in wrapper
    func(self, *args, **kwargs)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 173, in maintain_strategy
    self.check_operational_depth(self.real_buy_orders, self.virtual_buy_orders)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 616, in check_operational_depth
    self.replace_virtual_order_with_real(virtual_orders[i])
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 669, in replace_virtual_order_with_real
    new_order = self.place_market_buy_order(quote_amount, price, returnOrderId=True)
  File "/home/ubuntu/dexbot/dexbot/orderengines/bitshares_engine.py", line 607, in place_market_buy_order
    buy_order = self.get_order(buy_transaction['orderid'], return_none=return_none)
KeyError: 'orderid'
2021-12-02 14:25:07,031 - mm.xusdt-xhive.abot-stag using account mm.xusdt-xhive.abot on XBTSX.HIVE/XBTSX.USDT - ERROR - Worker "mm.xusdt-xhive.abot-stag" is disabled
2021-12-02 14:58:18,375 - mm.xusdt-xhive.abot-stag using account mm.xusdt-xhive.abot on XBTSX.HIVE/XBTSX.USDT - ERROR - in ontick()
Traceback (most recent call last):
  File "/home/ubuntu/dexbot/dexbot/worker.py", line 131, in on_block
    self.workers[worker_name].ontick(data)
  File "/home/ubuntu/opt/python-3.9.1/lib/python3.9/site-packages/events/events.py", line 95, in __call__
    f(*a, **kw)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 2249, in tick
    self.maintain_strategy()
  File "/home/ubuntu/dexbot/dexbot/decorators.py", line 21, in wrapper
    func(self, *args, **kwargs)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 174, in maintain_strategy
    self.check_operational_depth(self.real_sell_orders, self.virtual_sell_orders)
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 616, in check_operational_depth
    self.replace_virtual_order_with_real(virtual_orders[i])
  File "/home/ubuntu/dexbot/dexbot/strategies/staggered_orders.py", line 678, in replace_virtual_order_with_real
    new_order = self.place_market_sell_order(quote_amount, price, returnOrderId=True)
  File "/home/ubuntu/dexbot/dexbot/orderengines/bitshares_engine.py", line 655, in place_market_sell_order
    sell_transaction = self.retry_action(
  File "/home/ubuntu/dexbot/dexbot/orderengines/bitshares_engine.py", line 699, in retry_action
    return action(*args, **kwargs)
  File "/home/ubuntu/opt/python-3.9.1/lib/python3.9/site-packages/bitshares/market.py", line 641, in sell
    tx["orderid"] = tx["operation_results"][0][1]
IndexError: list index out of range

It is likely caused by a change in BitShares 6.0 (Mekong) update:

Description Issue Pull Request
The get_block API will return an empty operation_results field for blocks produced by nodes with version 6.0.0 or higher. The operation results can still be retrieved via get_account_history and related APIs. - 2475
@abitmore
Copy link
Author

abitmore commented Dec 2, 2021

Update:
It seems to be an issue about the broadcast_transaction_with_callback API, which has been fixed by bitshares/bitshares-core#2528. The solution is to run dexbot with BitShares 6.0 API nodes. Will close this issue when confirmed.

@abitmore abitmore closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant