AttributeError: 'dict' object has no attribute 'read'
When receiving an empty atom entry request, the deposit server reads the empty metadata file and crashes. [1]
It expects such request to not be empty. So there is an issue on the deposit server side, it should answer with a 400 bad request.
The full report is in sentry with some more context [2].
!272 (closed) fixes such issue.
- [1]
AttributeError: 'dict' object has no attribute 'read'
(7 additional frame(s) were not displayed)
...
File "rest_framework/views.py", line 492, in dispatch
response = handler(request, *args, **kwargs)
File "swh/deposit/api/common.py", line 1133, in post
request, headers, collection_name, deposit
File "swh/deposit/api/collection.py", line 142, in process_post
receipt = self._atom_entry(req, headers, collection_name, deposit)
File "swh/deposit/api/common.py", line 811, in _atom_entry
raw_metadata, metadata = self._read_metadata(request.data)
File "swh/deposit/api/common.py", line 506, in _read_metadata
raw_metadata = metadata_stream.read()
Migrated from T3856 (view on Phabricator)
Edited by Phabricator Migration user