archivematica / Issues

Issues repository for the Archivematica project
GNU Affero General Public License v3.0
16 stars 1 forks source link

Problem: PID declaration fails if there are two identifier.json files #874

Open sallain opened 5 years ago

sallain commented 5 years ago

Expected behaviour Archivematica should consolidate the identifiers.json files in some way.

This situation can occur when two transfers with identifier.json files are combined in the Appraisal tab.

Current behaviour Job: Persistent identifier (PID) declaration fails, which results in the whole SIP failing.

Steps to reproduce

  1. Create two transfers containing identifier.json files and send to backlog.
  2. Combine some of the objects from each transfer into one SIP via the Arrangement pane in the Appraisal tab.
  3. Create SIP

Your environment (version of Archivematica, commit, OS version, etc) qa/1.x (commit 60342d8) on Ubuntu 16.04

Logs/output

Errors and diagnostics (stderr)
get() returned more than one File -- it returned 2!Traceback (most recent call last):
  File "/opt/archivematica/archivematica/src/MCPClient/lib/job.py", line 111, in JobContext
    yield
  File "/opt/archivematica/archivematica/src/MCPClient/lib/clientScripts/pid_declaration.py", line 218, in call
    unit_uuid=job.args[1], sip_directory=job.args[2]
  File "/opt/archivematica/archivematica/src/MCPClient/lib/clientScripts/pid_declaration.py", line 61, in wrapped
    func(*args, **kwargs)
  File "/opt/archivematica/archivematica/src/MCPClient/lib/clientScripts/pid_declaration.py", line 201, in pid_declaration
    identifiers = self._retrieve_identifiers_path(unit_uuid, sip_directory)
  File "/opt/archivematica/archivematica/src/MCPClient/lib/clientScripts/pid_declaration.py", line 190, in _retrieve_identifiers_path
    currentlocation__endswith="identifiers.json",
  File "/usr/share/archivematica/virtualenvs/archivematica-mcp-client/local/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/share/archivematica/virtualenvs/archivematica-mcp-client/local/lib/python2.7/site-packages/django/db/models/query.py", line 338, in get
    (self.model._meta.object_name, num)
MultipleObjectsReturned: get() returned more than one File -- it returned 2!

For Artefactual use: Please make sure these steps are taken before moving this issue from Review to Done:

sallain commented 5 years ago

Just a note: in my testing, I created this failure when I had the same transfer material in the backlog twice, and then tried to combine them into one SIP. That is, I created two different transfers using DemoTransferCSV and sent both transfers to the backlog, where I tried to pull beihai.tif out of transfer 1 and bird.mp3 out of transfer 2. In this case, the two identifier.json files would have been identical.