Using db as lock manager, "name" column in table "lock_manager_lock" too small
While trying to debug what I think is a locking issue, I switched to use the ModelLock backend. I started to get errors in the logs:
mayan.apps.logging.middleware.error_logging <1312> [ERROR] "process_exception() line 17 Exception caught by request middleware; <WSGIRequest: GET '/api/documents/1756/versions/1756/pages/3128/image/?width=&height=&zoom=&rotation=&_hash=92bcac02c4a72586e21044c0b244b052f5747c7d2c25e6086ca89ca64098e3f3'>, value too long for type character varying(64)
As a workaround, I changed the "name" column in the "lock_manager_lock" table to a varchar(255) instead of varchar(64).
Watching the records being added to the table, I noticed an example of a value which exceeds the 64 character default:
document_page_generate_image_3162_92bcac02c4a72586e21044c0b244b052f5747c7d2c25e6086ca89ca64098e3f3
Apologies - I'm still working my way around the project / code, so not sure how to go about suggesting the right value to use, but 255 was enough to stop the errors and get the images working again!
Full trace from log:
mayan.apps.logging.middleware.error_logging <1312> [ERROR] "process_exception() line 17 Exception caught by request middleware; <WSGIRequest: GET '/api/documents/1756/versions/1756/pages/3128/image/?width=&height=&zoom=&rotation=&_hash=92bcac02c4a72586e21044c0b244b052f5747c7d2c25e6086ca89ca64098e3f3'>, value too long for type character varying(64)
"
Traceback (most recent call last):
File "/opt/mayan-edms/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/mayan-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/rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "/opt/mayan-edms/lib/python3.7/site-packages/rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "/opt/mayan-edms/lib/python3.7/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "/opt/mayan-edms/lib/python3.7/site-packages/rest_framework/views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/rest_framework/generics.py", line 208, in get
return self.retrieve(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/django/views/decorators/cache.py", line 31, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/documents/api_views.py", line 228, in retrieve
cache_filename = task.get(**kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/result.py", line 237, in get
on_message=on_message,
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/backends/asynchronous.py", line 202, in wait_for_pending
return result.maybe_throw(callback=callback, propagate=propagate)
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/result.py", line 342, in maybe_throw
self.throw(value, self._to_remote_traceback(tb))
File "/opt/mayan-edms/lib/python3.7/site-packages/celery/result.py", line 335, in throw
self.on_ready.throw(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.7/site-packages/vine/promises.py", line 244, in throw
reraise(type(exc), exc, tb)
File "/opt/mayan-edms/lib/python3.7/site-packages/vine/five.py", line 195, in reraise
raise value
django.db.utils.DataError: value too long for type character varying(64)