FUSE: directories referencing artifacts missing from the archive are reported as empty
$ ls archive/swh:1:dir:9e7cba45f1ef65a45647bce181bdf78f65da90a4
$
whereas the directory swh:1:dir:9e7cba45f1ef65a45647bce181bdf78f65da90a4 is not empty, but //references// a revision (as a submodule named "sha1collisiondetection") which is itself missing from the archive: swh:1:rev:855827c583bc30645ba427885caa40c5b81764d2.
Here are the logs:
ERROR:swh.fuse:Cannot fetch metadata for object swh:1:rev:855827c583bc30645ba427885caa40c5b81764d2: 404 Client Error: Not Found for url: https://archive.softwareheritage.org/api/1/revision/855827c583bc30645ba427885caa40c5b81764d2/
ERROR:swh.fuse:Cannot lookup: 404 Client Error: Not Found for url: https://archive.softwareheritage.org/api/1/revision/855827c583bc30645ba427885caa40c5b81764d2/
Traceback (most recent call last):
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fuse.py", line 290, in lookup
lookup_entry = await parent_entry.lookup(name)
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fs/entry.py", line 104, in lookup
async for entry in self.get_entries():
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fs/entry.py", line 93, in get_entries
entries = [x async for x in self.compute_entries()]
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fs/entry.py", line 93, in <listcomp>
entries = [x async for x in self.compute_entries()]
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fs/artifact.py", line 115, in compute_entries
await self.fuse.get_metadata(swhid)
File "/home/haltode/work/swh/swh-environment/swh-fuse/swh/fuse/fuse.py", line 87, in get_metadata
metadata = await loop.run_in_executor(None, self.web_api.get, swhid, typify)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/haltode/work/swh/swh-environment/.venv/lib/python3.8/site-packages/swh/web/client/client.py", line 226, in get
return self._getters[swhid_.object_type](swhid_, typify)
File "/home/haltode/work/swh/swh-environment/.venv/lib/python3.8/site-packages/swh/web/client/client.py", line 306, in revision
json = self._call(f"revision/{_get_swhid(swhid).object_id}/", **req_args).json()
File "/home/haltode/work/swh/swh-environment/.venv/lib/python3.8/site-packages/swh/web/client/client.py", line 191, in _call
r.raise_for_status()
File "/home/haltode/work/swh/swh-environment/.venv/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://archive.softwareheritage.org/api/1/revision/855827c583bc30645ba427885caa40c5b81764d2/
Instead we should be able to list the directory entries and either report the symlink as broken or not show it at all.
Migrated from T2851 (view on Phabricator)
Edited by Phabricator Migration user