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

staggered_orders bug #152

Closed
shesio opened this issue May 30, 2018 · 3 comments
Closed

staggered_orders bug #152

shesio opened this issue May 30, 2018 · 3 comments

Comments

@shesio
Copy link

shesio commented May 30, 2018

Expected Behavior

When an order is filled, the order cannot be placed again

Actual Behavior

Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/er/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.7-py3.5-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1808, in delete
state = attributes.instance_state(instance)
AttributeError: 'NoneType' object has no attribute '_sa_instance_state'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/home/er/.local/lib/python3.5/site-packages/dexbot-0.2.4-py3.5.egg/dexbot/storage.py", line 138, in run
func(*args)
File "/home/er/.local/lib/python3.5/site-packages/dexbot-0.2.4-py3.5.egg/dexbot/storage.py", line 259, in _remove_order
self.session.delete(e)
File "/home/er/.local/lib/python3.5/site-packages/SQLAlchemy-1.2.7-py3.5-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1810, in delete
raise exc.UnmappedInstanceError(instance)
sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.NoneType' is not mapped

Steps to Reproduce the Problem

Specifications

  • Version: 0.2.4
  • OS: linux
@MarkoPaasila
Copy link
Collaborator

Steps to reproduce: Start Staggered Orders strategy and wait for bug to occur :-)

@bitphage
Copy link
Collaborator

I can confirm this, very annoying bug.

@bitphage
Copy link
Collaborator

OK this happening because order removal happens twice:

2018-05-30 21:40:35,610 - xxxxworker2 using account xxx on BTS/USD - INFO - Change detected, updating orders
removing <dexbot.storage.Orders object at 0x7fe4f4d4bb38>
2018-05-30 21:40:35,724 - xxxxworker2 using account xxxx on BTS/USD - INFO - Placing a sell order for 10.0 BTS @ 0.18068988
removing None
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/vvk/.local/share/virtualenvs/DEXBot-XTl2tJdV/lib/python3.6/site-packages/SQLAlchemy-1.2.7-py3.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1808, in delete
    state = attributes.instance_state(instance)
AttributeError: 'NoneType' object has no attribute '_sa_instance_state'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants