Skip to content

Gitorious import: ObjectFormatException raised when badly formatted object (around date?)

Reproduction: Use /srv/storage/space/mirrors/gitorious.org/mnt/repositories/opensuse/kernel-source.git

repo = 'kernel-source.git'
origin_url = 'http://opensuse/kernel-source.git'

import logging
logging.basicConfig(level=logging.DEBUG)

from swh.loader.git.tasks import LoadDiskGitRepository

t = LoadDiskGitRepository()
t.run(origin_url=origin_url, directory=repo, date='2016-05-03T15:16:32+00:00')

output:

DEBUG:swh.scheduler.task.LoadDiskGitRepository:Creating git origin for http://opensuse/kernel-source.git
DEBUG:swh.scheduler.task.LoadDiskGitRepository:Done creating git origin for http://opensuse/kernel-source.git
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tony/work/inria/repo/swh/swh-environment/swh-scheduler/swh/scheduler/task.py", line 35, in run
    raise e from None
  File "/home/tony/work/inria/repo/swh/swh-environment/swh-scheduler/swh/scheduler/task.py", line 32, in run
    result = self.run_task(*args, **kwargs)
  File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/tasks.py", line 39, in run_task
    return loader.load(origin_url, directory, dateutil.parser.parse(date))
  File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/base.py", line 422, in load
    self.fetch_data()
  File "/home/tony/work/inria/repo/swh/swh-environment/swh-loader-git/swh/loader/git/loader.py", line 48, in fetch_data
    type_name = self.repo[oid].type_name
  File "/usr/lib/python3/dist-packages/dulwich/repo.py", line 472, in __getitem__
    return self.object_store[name]
  File "/usr/lib/python3/dist-packages/dulwich/object_store.py", line 119, in __getitem__
    return ShaFile.from_raw_string(type_num, uncomp, sha=sha)
  File "/usr/lib/python3/dist-packages/dulwich/objects.py", line 393, in from_raw_string
    obj.set_raw_string(string, sha)
  File "/usr/lib/python3/dist-packages/dulwich/objects.py", line 305, in set_raw_string
    self.set_raw_chunks([text], sha)
  File "/usr/lib/python3/dist-packages/dulwich/objects.py", line 310, in set_raw_chunks
    self._deserialize(chunks)
  File "/usr/lib/python3/dist-packages/dulwich/objects.py", line 761, in _deserialize
    raise ObjectFormatException(e)
dulwich.errors.ObjectFormatException: invalid literal for int() with base 10: b'Thu Oct 30 17:30:06 2014'

Related #819 (closed)


Migrated from T822 (view on Phabricator)

Edited by Phabricator Migration user