Open karinbredenberg opened 1 week ago
Expected behaviour When using the management command purge_transient_processing_data, the database is cleared without error messages.
https://github.com/artefactual/archivematica/blob/qa/1.x/src/dashboard/src/main/management/commands/purge_transient_processing_data.py
Current behaviour When using the command, the database is cleared but the following output is printed for every transfer:
Purging transfers...
» Transfer 5abfcc31-e0c4-4040-bd61-0c42fcfbd18e with status Done Purging main.UnitVariable objects: 2 rows deleted. Purging main.Task objects: 72 rows deleted. Purging main.Job objects: 48 rows deleted. Purging main.Transfer objects: 1 rows deleted. Purging main.Directory objects: 4 rows deleted. Purging search documents... Error: 'UUID' object has no attribute 'replace' Traceback (most recent call last): File "/vagrant/src/archivematica/src/dashboard/src/main/management/commands/purge_transient_processing_data.py", line 185, in handle es.remove_backlog_transfer_files(es_client, package_id) File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1386, in remove_backlog_transfer_files _remove_transfer_files(client, uuid, "transfer") File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1404, in _remove_transfer_files files = _document_ids_from_field_query(File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1255, in _document_ids_from_field_query searchvalue = value.replace("/", "\/") AttributeError: 'UUID' object has no attribute 'replace'
The error message is only printed under the “Purging transfers” step and not under “Purging SIPs”.
The command was used in the same way as shown in the documentation:
sudo -u archivematica bash -c " \ set -a -e -x source /etc/default/archivematica-dashboard || \ source /etc/sysconfig/archivematica-dashboard \ || (echo 'Environment file not found'; exit 1) cd /usr/share/archivematica/dashboard /usr/share/archivematica/virtualenvs/archivematica/bin/python \ manage.py purge_transient_processing_data ";
Steps to reproduce Run the management command purge_transient_processing_data on a database that is not empty.
Your environment (version of Archivematica, operating system, other relevant details) Archivematica 1.16.0 Storage Service 0.22.0 Ubuntu 22.04
For Artefactual use:
Before you close this issue, you must check off the following:
Thank you for reporting this. It's been fixed in https://github.com/artefactual/archivematica/pull/1948 and will be included in the Archivematica 1.17 release.
Expected behaviour When using the management command purge_transient_processing_data, the database is cleared without error messages.
https://github.com/artefactual/archivematica/blob/qa/1.x/src/dashboard/src/main/management/commands/purge_transient_processing_data.py
Current behaviour When using the command, the database is cleared but the following output is printed for every transfer:
Purging transfers...
» Transfer 5abfcc31-e0c4-4040-bd61-0c42fcfbd18e with status Done Purging main.UnitVariable objects: 2 rows deleted. Purging main.Task objects: 72 rows deleted. Purging main.Job objects: 48 rows deleted. Purging main.Transfer objects: 1 rows deleted. Purging main.Directory objects: 4 rows deleted. Purging search documents... Error: 'UUID' object has no attribute 'replace' Traceback (most recent call last): File "/vagrant/src/archivematica/src/dashboard/src/main/management/commands/purge_transient_processing_data.py", line 185, in handle es.remove_backlog_transfer_files(es_client, package_id) File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1386, in remove_backlog_transfer_files _remove_transfer_files(client, uuid, "transfer") File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1404, in _remove_transfer_files files = _document_ids_from_field_query(File "/usr/lib/archivematica/archivematicaCommon/elasticSearchFunctions.py", line 1255, in _document_ids_from_field_query searchvalue = value.replace("/", "\/") AttributeError: 'UUID' object has no attribute 'replace'
The error message is only printed under the “Purging transfers” step and not under “Purging SIPs”.
The command was used in the same way as shown in the documentation:
sudo -u archivematica bash -c " \ set -a -e -x source /etc/default/archivematica-dashboard || \ source /etc/sysconfig/archivematica-dashboard \ || (echo 'Environment file not found'; exit 1) cd /usr/share/archivematica/dashboard /usr/share/archivematica/virtualenvs/archivematica/bin/python \ manage.py purge_transient_processing_data ";
Steps to reproduce Run the management command purge_transient_processing_data on a database that is not empty.
Your environment (version of Archivematica, operating system, other relevant details) Archivematica 1.16.0 Storage Service 0.22.0 Ubuntu 22.04
For Artefactual use:
Before you close this issue, you must check off the following: