Integrity constraint error when uploading a new document

When things don't work as they should.
Post Reply
joekhoobyar
Posts: 9
Joined: Mon Feb 24, 2020 3:49 am

Integrity constraint error when uploading a new document

Post by joekhoobyar »

Hi - I'm getting the following integrity constraint error when uploading a new document.

My guess is that this is due to a previous incompletely processed document - when Mayan became unresponsive, Kubernetes restarted the server.

Is there something that I can do in postgres to fix this?

Code: Select all

[mayan-0] mayan.apps.file_caching.models <117> [ERROR] "create_file() line 162 Unexpected exception while trying to save new cache file; duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq" 
[mayan-0] DETAIL:  Key (partition_id, filename)=(2579, base_image) already exists. 
[mayan-0] " 
[mayan-0] [2020-03-17 00:53:17,454: ERROR/ForkPoolWorker-2] Unexpected exception while trying to save new cache file; duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq" 
[mayan-0] DETAIL:  Key (partition_id, filename)=(2579, base_image) already exists. 
[mayan-0]  
[mayan-0] mayan.apps.documents.models.document_page_models <117> [ERROR] "get_image() line 240 Error creating page cache file "base_image"; duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq" 
[mayan-0] DETAIL:  Key (partition_id, filename)=(2579, base_image) already exists. 
[mayan-0] " 
[mayan-0] [2020-03-17 00:53:17,470: ERROR/ForkPoolWorker-2] Error creating page cache file "base_image"; duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq" 
[mayan-0] DETAIL:  Key (partition_id, filename)=(2579, base_image) already exists. 
[mayan-0]  
[mayan-0] [2020-03-17 00:53:17,471: ERROR/ForkPoolWorker-2] Task mayan.apps.documents.tasks.task_generate_document_page_image[af6599e6-acc5-424f-a0af-89f437fc5c27] raised unexpected: IntegrityError('duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq"\nDETAIL:  Key (partition_id, filename)=(2579, base_image) already exists.\n') 
[mayan-0] Traceback (most recent call last): 
[mayan-0]   File "/opt/mayan-edms/lib/python3.7/site-packages/django/db/backends/utils.py", line 64, in execute 
[mayan-0]     return self.cursor.execute(sql, params) 
[mayan-0] psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "file_caching_cachepartit_partition_id_filename_e553caf0_uniq"

User avatar
rosarior
Developer
Developer
Posts: 513
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Integrity constraint error when uploading a new document

Post by rosarior »

Version 3.3.16 includes an update targeting this issue, please give it a try.

Post Reply