Page MenuHomeSoftware Heritage
Paste P1476

patch hash mismatch again
ActivePublic

Authored by ardumont on Oct 4 2022, 8:47 PM.
swh-loader_1 | [2022-10-04 18:00:23,961: DEBUG/ForkPoolWorker-3] Loading config file /loader.yml
swh-loader_1 | [2022-10-04 18:00:23,962: INFO/MainProcess] Task swh.loader.core.tasks.LoadContent[c5c9322d-15d6-4a53-af3a-b157f26211a6] received
swh-loader_1 | [2022-10-04 18:00:23,972: DEBUG/ForkPoolWorker-3] Loader checksums computation: standard
swh-loader_1 | [2022-10-04 18:00:23,996: INFO/ForkPoolWorker-3] Load origin 'https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch' with type 'content'
swh-loader_1 | [2022-10-04 18:00:24,038: DEBUG/ForkPoolWorker-3] prepare; origin_url=https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch fallback=https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch scheme=https path=/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch
swh-loader_1 | [2022-10-04 18:00:24,323: DEBUG/ForkPoolWorker-3] filename: ac938e2ecb48ab4dd21298126c7921689d60571b.patch
swh-loader_1 | [2022-10-04 18:00:24,323: DEBUG/ForkPoolWorker-3] filepath: /tmp/tmpqd7zyqbb/ac938e2ecb48ab4dd21298126c7921689d60571b.patch
swh-loader_1 | [2022-10-04 18:00:24,325: ERROR/ForkPoolWorker-3] Loading failure, updating to `failed` status
swh-loader_1 | Traceback (most recent call last):
swh-loader_1 | File "/src/swh-loader-core/swh/loader/core/loader.py", line 405, in load
swh-loader_1 | more_data_to_fetch = self.fetch_data()
swh-loader_1 | File "/src/swh-loader-core/swh/loader/core/loader.py", line 745, in fetch_data
swh-loader_1 | file_path, _ = download(
swh-loader_1 | File "/srv/softwareheritage/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 326, in wrapped_f
swh-loader_1 | return self(f, *args, **kw)
swh-loader_1 | File "/srv/softwareheritage/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 406, in __call__
swh-loader_1 | do = self.iter(retry_state=retry_state)
swh-loader_1 | File "/srv/softwareheritage/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 351, in iter
swh-loader_1 | return fut.result()
swh-loader_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 439, in result
swh-loader_1 | return self.__get_result()
swh-loader_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
swh-loader_1 | raise self._exception
swh-loader_1 | File "/srv/softwareheritage/venv/lib/python3.9/site-packages/tenacity/__init__.py", line 409, in __call__
swh-loader_1 | result = fn(*args, **kwargs)
swh-loader_1 | File "/src/swh-loader-core/swh/loader/package/utils.py", line 147, in download
swh-loader_1 | raise ValueError(
swh-loader_1 | ValueError: Failure when fetching https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch. Checksum mismatched: 5f210dc6459a0dc8343407d099aac3c904ce4bfba42c37fa8cc7c783be9e8e2f != 8435519814099d6b733d78caab66b92b544e05d503f9c5696f3b9165bd433a57

Event Timeline

cat /var/tmp/sources-unstable-full.json | jq . | grep -C5 https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch

  "outputHash": "0bwfksz87iy7ikx3fb54zd5ww169qfm9kl076hsch3cs8p30s8az",
  "outputHashAlgo": "sha256",
  "outputHashMode": "flat",
  "type": "url",
  "urls": [
    "https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch"
  ],
  "integrity": "sha256-XyENxkWaDcg0NAfQmarDyQTOS/ukLDf6jMfHg76eji8=",
  "inferredFetcher": "fetchpatch"
},
{

So we must do something about the fetcher which does crazy things.
Either filter out those patch or simply integrate those without checking them... (i don't like much the latter).

$ ipython
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import base64

In [2]: integrity="sha256-XyENxkWaDcg0NAfQmarDyQTOS/ukLDf6jMfHg76eji8="

In [3]:  base64.decodebytes(integrity.split("-")[1].encode()).hex()
Out[3]: '5f210dc6459a0dc8343407d099aac3c904ce4bfba42c37fa8cc7c783be9e8e2f'

In [4]: exit
 swh  tony  yavin4  var  tmp  %  sha256sum ac938e2ecb48ab4dd21298126c7921689d60571b.patch
8435519814099d6b733d78caab66b92b544e05d503f9c5696f3b9165bd433a57  ac938e2ecb48ab4dd21298126c7921689d60571b.patch