TensorHive icon indicating copy to clipboard operation
TensorHive copied to clipboard

Detached instance in tasks controller

Open roscisz opened this issue 5 years ago • 1 comments

Subject of the issue

Describe your issue here.

Your environment

List relevant info:

  • TensorHive 0.3.3

Steps to reproduce

Assign some tasks to a reservation in the calendar view. Then repeat: assign the same tasks to the same reservation.

Expected behaviour

Re-assagning tasks should not be possible while the tasks are running.

Actual behaviour

ERROR | 2020-11-03 16:20:28 | MainThread | MSG: Exception on /api/0.3/tasks [GET] | FROM: tensorhive.api.APIServer Traceback (most recent call last): File "/home/tensorhive/venv/lib/python3.6/site-packages/tensorhive/controllers/task.py", line 167, in get_all content, status = business_get_all(user_id, sync_all) File "/home/tensorhive/venv/lib/python3.6/site-packages/tensorhive/controllers/task.py", line 275, in business_get_all synchronize(task.id) File "/home/tensorhive/venv/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 276, in get return self.impl.get(instance_state(instance), dict_) File "/home/tensorhive/venv/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 677, in get value = state._load_expired(state, passive) File "/home/tensorhive/venv/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 660, in _load_expired self.manager.deferred_scalar_loader(self, toload) File "/home/tensorhive/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 913, in load_scalar_attributes "attribute refresh operation cannot proceed" % (state_str(state)) sqlalchemy.orm.exc.DetachedInstanceError: Instance <Task at 0x7f1ef437bac8> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3)

roscisz avatar Nov 03 '20 15:11 roscisz

could be a duplicate of #174

roscisz avatar Nov 03 '20 16:11 roscisz