Errors with watch folders in version 3.5
From the forum: https://forum.mayan-edms.com/viewtopic.php?t=4027
Hi,
I upgraded Mayan with Docker to 3.5. Now I am not able to delete the watchfolders I created and just getting an error. Additionally the docker protocol/log gets spammed with errors. When I disable the watchfolders the errors are gone, but other errors appear (see 2nd code). Despite the errors, if enabled the watchfolders still work.
I use PostgreSQL 12.3 container und Redis 5.0 alpine container. I did not touch them after updating the Mayan container. Can anyone help me?
P.S.: Mayan is great, thx!
[2020-10-10 07:59:40,120: ERROR/ForkPoolWorker-2] Error processing source id: 4; get() returned more than one ErrorLog -- it returned 2!,
[2020-10-10 07:59:40,123: ERROR/ForkPoolWorker-2] Task mayan.apps.sources.tasks.task_check_interval_source[5f76e187-9c23-4847-ac9d-941c0dcd5115] raised unexpected: AttributeError("'WatchFolderSource' object has no attribute 'logs'"),
Traceback (most recent call last):,
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/sources/tasks.py", line 43, in task_check_interval_source,
source.check_source(test=test),
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/sources/models/base.py", line 224, in check_source,
self.error_log.all().delete(),
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/logging/classes.py", line 42, in method_instance_logs,
error_log_partition, created = error_log_instance.model.partitions.get_or_create(,
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/logging/classes.py", line 34, in model,
model, created = ErrorLogModel.objects.get_or_create(name=self.app_config.name),
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method,
return getattr(self.get_queryset(), name)(*args, **kwargs),
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/query.py", line 538, in get_or_create,
return self.get(**kwargs), False,
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/query.py", line 412, in get,
(self.model._meta.object_name, num),
mayan.apps.logging.models.ErrorLog.MultipleObjectsReturned: get() returned more than one ErrorLog -- it returned 2!,
,
During handling of the above exception, another exception occurred:,
,
Traceback (most recent call last):,
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/app/trace.py", line 412, in trace_task,
R = retval = fun(*args, **kwargs),
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/app/trace.py", line 704, in __protected_call__,
return self.run(*args, **kwargs),
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/sources/tasks.py", line 48, in task_check_interval_source,
source.logs.create(,
AttributeError: 'WatchFolderSource' object has no attribute 'logs',
mayan.apps.sources.tasks <405> [ERROR] "task_check_interval_source() line 46 Error processing source id: 4; get() returned more than one ErrorLog -- it returned 2!",
edms/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/views/mixins.py", line 128, in dispatch
return super(ExternalObjectMixin, self).dispatch(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/views/mixins.py", line 554, in dispatch
).dispatch(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/generic/list.py", line 142, in get
self.object_list = self.get_queryset()
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/views/generics.py", line 809, in get_queryset
queryset = super(SingleObjectListView, self).get_queryset()
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/views/mixins.py", line 508, in get_queryset
queryset = self.get_source_queryset()
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/logging/views.py", line 47, in get_source_queryset
return self.external_object.error_log.all()
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/logging/classes.py", line 42, in method_instance_logs
error_log_partition, created = error_log_instance.model.partitions.get_or_create(
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/logging/classes.py", line 34, in model
model, created = ErrorLogModel.objects.get_or_create(name=self.app_config.name)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/query.py", line 538, in get_or_create
return self.get(**kwargs), False
File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/models/query.py", line 412, in get
(self.model._meta.object_name, num)
mayan.apps.logging.models.ErrorLog.MultipleObjectsReturned: get() returned more than one ErrorLog -- it returned 2!