Page MenuHomeSoftware Heritage

KeyError: 'content:add' in swh.loader.core.loader
Closed, ResolvedPublic


When submitting a "Create save request" on a git repository through the web app, the task fails with a KeyError in swh.loader.core.loader. The log and stacktrace is as follows:

2019-11-15 17:14:12,497: INFO/MainProcess] Received task: swh.loader.git.tasks.UpdateGitRepository[c1670151-ed4a-4544-a841-8ecf595ec5cb]  
[2019-11-15 17:14:12,502: INFO/ForkPoolWorker-1] Loading config file /loader.yml
[2019-11-15 17:14:12,519: DEBUG/ForkPoolWorker-1] Creating origin for
[2019-11-15 17:14:12,545: DEBUG/ForkPoolWorker-1] Done creating origin for
[2019-11-15 17:14:12,545: DEBUG/ForkPoolWorker-1] Creating origin_visit for origin at time 2019-11-15 17:14:12.519239+00:00
[2019-11-15 17:14:12,556: DEBUG/ForkPoolWorker-1] Done Creating git origin_visit for origin at time 2019-11-15 17:14:12.519239+00:00
Enumerating objects: 58, done.
Counting objects: 100% (58/58), done.
Compressing objects: 100% (45/45), done.
Total 5824 (delta 26), reused 36 (delta 13), pack-reused 5766
[2019-11-15 17:14:14,881: INFO/ForkPoolWorker-1] Listed 119 refs for repo
[2019-11-15 17:14:20,658: DEBUG/ForkPoolWorker-1] Sending 2746 contents
[2019-11-15 17:14:21,355: ERROR/ForkPoolWorker-1] Loading failure, updating to `partial` status
Traceback (most recent call last):
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/loader/core/", line 870, in load
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/loader/core/", line 969, in store_data
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/loader/core/", line 652, in send_batch_contents
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/loader/core/", line 48, in send_in_packets
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/", line 206, in call
    return attempt.get(self._wrap_exception)
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/", line 696, in reraise
    raise value
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/loader/core/", line 404, in send_contents
    self.counters['contents'] += result['content:add']
KeyError: 'content:add'
[2019-11-15 17:14:21,357: DEBUG/ForkPoolWorker-1] Updating origin_visit for origin with status partial
[2019-11-15 17:14:21,366: DEBUG/ForkPoolWorker-1] Done updating origin_visit for origin with status partial

The environment is a freshly built docker swh/stack image built off the master branch.

Event Timeline

robguinness created this object in space S1 Public.
robguinness updated the task description. (Show Details)Nov 15 2019, 6:36 PM
zack triaged this task as High priority.Nov 15 2019, 11:23 PM
douardda closed this task as Resolved.Nov 19 2019, 11:26 AM
douardda claimed this task.
douardda added a subscriber: douardda.

This has been fixed by cb42fea77070

@douardda fixed that behavior in loader.core D2299