archivematica / Issues

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

Problem: Cannot create a transfer as package cannot be created #1621

Closed wilsonson closed 1 year ago

wilsonson commented 1 year ago

Expected behaviour Create a transfer and start transferring

Current behaviour

The dashboard log said: archivematica.dashboard:views:_package_create:851: Package cannot be created: packageCreate failed (check the logs)

And the mcp server log said:

2023-08-20 00:21:14 ERROR    RPCServer-1 2023-08-19 16:21:14 rpc_server:wrap:184:  Exception raised by handler packageCreate: ["'' is not a valid UUID."]
2023-08-20 00:21:14 Traceback (most recent call last):
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/fields/__init__.py", line 2396, in to_python
2023-08-20 00:21:14     return uuid.UUID(value)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/uuid.py", line 140, in __init__
2023-08-20 00:21:14     raise ValueError('badly formed hexadecimal UUID string')
2023-08-20 00:21:14 ValueError: badly formed hexadecimal UUID string
2023-08-20 00:21:14 
2023-08-20 00:21:14 During handling of the above exception, another exception occurred:
2023-08-20 00:21:14 
2023-08-20 00:21:14 Traceback (most recent call last):
2023-08-20 00:21:14   File "/src/src/MCPServer/lib/server/rpc_server.py", line 176, in wrap
2023-08-20 00:21:14     resp = handler(*args)
2023-08-20 00:21:14   File "/src/src/MCPServer/lib/server/rpc_server.py", line 262, in _package_create_handler
2023-08-20 00:21:14     return create_package(*args, **kwargs).pk
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/contextlib.py", line 52, in inner
2023-08-20 00:21:14     return func(*args, **kwds)
2023-08-20 00:21:14   File "/src/src/MCPServer/lib/server/packages.py", line 336, in create_package
2023-08-20 00:21:14     id=metadata_set_id
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
2023-08-20 00:21:14     return getattr(self.get_queryset(), name)(*args, **kwargs)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/query.py", line 374, in get
2023-08-20 00:21:14     num = len(clone)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/query.py", line 232, in __len__
2023-08-20 00:21:14     self._fetch_all()
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/query.py", line 1121, in _fetch_all
2023-08-20 00:21:14     self._result_cache = list(self._iterable_class(self))
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
2023-08-20 00:21:14     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 876, in execute_sql
2023-08-20 00:21:14     sql, params = self.as_sql()
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 441, in as_sql
2023-08-20 00:21:14     where, w_params = self.compile(self.where) if self.where is not None else ("", [])
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 373, in compile
2023-08-20 00:21:14     sql, params = node.as_sql(self, self.connection)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/sql/where.py", line 79, in as_sql
2023-08-20 00:21:14     sql, params = compiler.compile(child)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 373, in compile
2023-08-20 00:21:14     sql, params = node.as_sql(self, self.connection)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/lookups.py", line 170, in as_sql
2023-08-20 00:21:14     rhs_sql, rhs_params = self.process_rhs(compiler, connection)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/lookups.py", line 103, in process_rhs
2023-08-20 00:21:14     return self.get_db_prep_lookup(value, connection)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/lookups.py", line 196, in get_db_prep_lookup
2023-08-20 00:21:14     [get_db_prep_value(value, connection, prepared=True)]
2023-08-20 00:21:14   File "/src/src/dashboard/src/main/models.py", line 78, in get_db_prep_value
2023-08-20 00:21:14     value = self.to_python(value)
2023-08-20 00:21:14   File "/pyenv/data/versions/3.6.15/lib/python3.6/site-packages/django/db/models/fields/__init__.py", line 2401, in to_python
2023-08-20 00:21:14     params={'value': value},
2023-08-20 00:21:14 django.core.exceptions.ValidationError: ["'' is not a valid UUID."]

Steps to reproduce

  1. Select 'Standard' in transfer type box.
  2. Enter a name for the transfer
  3. Add transfer content
  4. Click 'Start Transfer'

Your environment (version of Archivematica, operating system, other relevant details) qa/1.x Docker Engine v24.0.5


For Artefactual use:

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

replaceafill commented 1 year ago

We noticed this problem last week and have a fix for it. See this commit for reference https://github.com/artefactual/archivematica/commit/81c605cbe52f4dea21a73ffd4fe6682016f74e52. It will be merged in the qa/1.x branch early next week.