Page MenuHomeSoftware Heritage

golang: /@latest sometimes returns an empty body
Closed, MigratedEdits Locked


with a 200 status code, instead of a 404 error; which makes get_default_version crash with:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
(2 additional frame(s) were not displayed)
  File "swh/loader/package/", line 209, in newf
    value = f(self)
  File "swh/loader/package/golang/", line 73, in get_default_version
    return json.loads(latest)["Version"]
  File "", line 346, in loads
    return _default_decoder.decode(s)
  File "json/", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

Failed to get list of versions for

We should report this to, and maybe add a workaround on our side (if latest == "": raise NotFound(...))