Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: Transfer names with '/' fail ingest #1642

Open
5 tasks
jens-st opened this issue Dec 6, 2023 · 0 comments
Open
5 tasks

Problem: Transfer names with '/' fail ingest #1642

jens-st opened this issue Dec 6, 2023 · 0 comments

Comments

@jens-st
Copy link

jens-st commented Dec 6, 2023

Expected behaviour

  • transfer UUID exists and has a defined status
  • transfer is shown in dashboard

Current behaviour

  • package API endpoint returns HTTP 202 Accepted + transfer UUID
  • no transfer entry in dashboard transfer tab
  • status API endpoint return HTTP 400 Bad Request
    {"error": true, "message": "Unable to determine the status of the unit [transfer UUID]"}
  • nothing related in dashboard log
  • exception in storage service log
DEBUG     2023-12-05 15:18:58  locations.api.resources:resources:_move_files_between_locations:547:  Moving files from this location is not allowed
DEBUG     2023-12-05 15:18:58  locations.models.space:space:move_to_storage_service:343:  TO: src: mnt/ingest/3aaa899d-9379-11ee-937c-d55f27564ecb/.
DEBUG     2023-12-05 15:18:58  locations.models.space:space:move_to_storage_service:344:  TO: dst: /mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/.
DEBUG     2023-12-05 15:18:58  locations.models.space:space:move_to_storage_service:345:  TO: staging: /var/archivematica/storage_service
INFO      2023-12-05 15:18:58  locations.models.space:space:move_rsync:547:  Moving from /mnt/ingest/3aaa899d-9379-11ee-937c-d55f27564ecb/. to /var/archivematica/storage_service/mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/.
INFO      2023-12-05 15:18:58  locations.models.space:space:move_rsync:589:  rsync command: ['rsync', '-t', '-O', '--protect-args', '-vv', '--chmod=Fug+rw,o-rwx,Dug+rwx,o-rwx', '-r', '/mnt/ingest/3aaa899d-9379-11ee-937c-d55f
27564ecb/.', '/var/archivematica/storage_service/mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/.']
DEBUG     2023-12-05 15:18:58  locations.models.space:space:move_from_storage_service:420:  FROM: src: /mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/.
DEBUG     2023-12-05 15:18:58  locations.models.space:space:move_from_storage_service:421:  FROM: dst: /mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/.
WARNING   2023-12-05 15:18:58  locations.models.space:space:create_local_directory:628:  Could not create storage directory: [Errno 13] Permission denied: '/mnt/import'
ERROR     2023-12-05 15:18:58  django.request.tastypie:resources:_handle_500:321:  Internal Server Error: /api/v2/location/b308e7f3-5a6d-4856-8f0d-bf6f8aaaad7e/
Traceback (most recent call last):
  File "/usr/lib/archivematica/storage-service/locations/api/resources.py", line 548, in _move_files_between_locations
    raise PosixMoveUnsupportedError
locations.models.space.PosixMoveUnsupportedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/site-packages/tastypie/resources.py", line 227, in wrapper
    response = callback(request, *args, **kwargs)
  File "/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/site-packages/tastypie/resources.py", line 476, in dispatch_detail
    return self.dispatch('detail', request, **kwargs)
  File "/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/site-packages/tastypie/resources.py", line 499, in dispatch
    response = method(request, **kwargs)
  File "/usr/lib/archivematica/storage-service/locations/api/resources.py", line 685, in post_detail
    return self._handle_location_file_move(move_files, request, *args, **kwargs)
  File "/usr/lib/archivematica/storage-service/locations/api/resources.py", line 632, in _handle_location_file_move
    return move_files_fn(data["files"], origin_location, destination_location)
  File "/usr/lib/archivematica/storage-service/locations/api/resources.py", line 679, in move_files
    files, origin_location, destination_location
  File "/usr/lib/archivematica/storage-service/locations/api/resources.py", line 565, in _move_files_between_locations
    package=None,
  File "/usr/lib/archivematica/storage-service/locations/models/space.py", line 429, in move_from_storage_service
    source_path, destination_path, *args, **kwargs
  File "/usr/lib/archivematica/storage-service/locations/models/local_filesystem.py", line 44, in move_from_storage_service
    self.space.create_local_directory(destination_path)
  File "/usr/lib/archivematica/storage-service/locations/models/space.py", line 624, in create_local_directory
    os.makedirs(dir_path, mode)
  File "/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/mnt/import'

Steps to reproduce

  1. Start transfer with https://www.archivematica.org/en/docs/archivematica-1.14/dev-manual/api/api-reference-archivematica/#package using a transfer name containing '/', i.e. /mnt/import/TEST-SIP_2023-11-27_16-36-28_13849/
  2. Check dashboard
  3. Check status with https://www.archivematica.org/en/docs/archivematica-1.14/dev-manual/api/api-reference-archivematica/#status
  4. Check storage service log for exception

Your environment (version of Archivematica, operating system, other relevant details)

  • Archivematica v1.14.1
  • Storage Service v0.20.1
  • Ubuntu Server 18.04.6 LTS

For Artefactual use:

Before you close this issue, you must check off the following:

  • All pull requests related to this issue are properly linked
  • All pull requests related to this issue have been merged
  • A testing plan for this issue has been implemented and passed (testing plan information should be included in the issue body or comments)
  • Documentation regarding this issue has been written and merged (if applicable)
  • Details about this issue have been added to the release notes (if applicable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant