denshoproject / ddr-local

Web UI used for interacting with DDR collections and entities on a local machine.
Other
3 stars 0 forks source link

"TypeError: 'AttributeError' object is not subscriptable" when creating a collection #311

Closed gjost closed 11 months ago

gjost commented 2 years ago

Celery task error when trying to create new collections:

Traceback (most recent call last):
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py", line 543, in trace_task
    task_after_return(
  File "/opt/ddr-local/ddrlocal/webui/tasks/collection.py", line 117, in after_return
    collection_id = retval['collection_id']
TypeError: 'AttributeError' object is not subscriptable
gjost commented 2 years ago

From /var/log/ddr/ddrlocal-celery.log. The actual error is AttributeError: module 'DDR.docstore' has no attribute 'DOCSTORE'

[2022-05-12 10:17:46,248: INFO/MainProcess] Task collection-new-idservice[50d26d77-cf27-49b9-b81a-1c1d9a8dba90] received
[2022-05-12 10:17:58,801: ERROR/MainProcess] Task collection-new-idservice[50d26d77-cf27-49b9-b81a-1c1d9a8dba90] raised unexpected: AttributeError("module 'DDR.docstore' has
 no attribute 'DOCSTORE'")
Traceback (most recent call last):
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/ddr-local/ddrlocal/webui/tasks/collection.py", line 198, in collection_new_idservice
    exit,status = Collection.create(cidentifier, git_name, git_mail)
  File "/opt/ddr-local/ddrlocal/webui/models.py", line 625, in create
    docstore.DOCSTORE.post(collection)
AttributeError: module 'DDR.docstore' has no attribute 'DOCSTORE'
[2022-05-12 10:17:58,802: WARNING/MainProcess] /opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py:660: RuntimeWarning: Exception raised outside bod
y: TypeError("'AttributeError' object is not subscriptable"):
Traceback (most recent call last):
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py", line 543, in trace_task
    task_after_return(
  File "/opt/ddr-local/ddrlocal/webui/tasks/collection.py", line 117, in after_return
    collection_id = retval['collection_id']
TypeError: 'AttributeError' object is not subscriptable

  warn(RuntimeWarning(

[2022-05-12 10:17:58,802: ERROR/MainProcess] Task collection-new-idservice[50d26d77-cf27-49b9-b81a-1c1d9a8dba90] raised unexpected: TypeError("'AttributeError' object is not
 subscriptable")
Traceback (most recent call last):
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/celery/app/trace.py", line 543, in trace_task
    task_after_return(
  File "/opt/ddr-local/ddrlocal/webui/tasks/collection.py", line 117, in after_return
    collection_id = retval['collection_id']
TypeError: 'AttributeError' object is not subscriptable
gjost commented 2 years ago

Created hotfix branch fix-311-newcoll

gjost commented 2 years ago

Fixed in commit 6af278b969, merged in to master and included in package ddrlocal-master_5.4.5.