git code import fails: ValueError: invalid literal for int() with base 10: '--700'

Bug #697828 reported by Guillermo Gonzalez
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Fix Released
Low
Jelmer Vernooij
Dulwich
Fix Released
Low
Jason R. Coombs
Launchpad itself
Fix Released
Low
Jelmer Vernooij

Bug Description

A code import failed with this traceback, but it also fails with tip of dulwich and bzr-git locally.

The branch is: https://code.launchpad.net/~verterok/boto/trunk-git

2011-01-05 19:14:09 INFO Starting job.
2011-01-05 19:14:09 INFO Getting exising bzr branch from central store.
2011-01-05 19:14:09 INFO [chan bzr SocketAsChannelAdapter] Opened sftp connection (server version 3)
2011-01-05 19:14:10 INFO [chan bzr SocketAsChannelAdapter] Opened sftp connection (server version 3)
2011-01-05 19:14:10 INFO 51 bytes transferred
2011-01-05 19:14:10 INFO Importing foreign branch.
2011-01-05 19:14:11 INFO Counting objects: 9947, done. 0
2011-01-05 19:14:12 INFO finding revisions to fetch:generating index 0/9947
2011-01-05 19:14:13 INFO finding revisions to fetch 1/2689
2011-01-05 19:14:13 INFO
Traceback (most recent call last):
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/scripts/code-import-worker.py", line 82, in <module>
    sys.exit(script.main())
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/scripts/code-import-worker.py", line 77, in main
    return import_worker.run()
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/lp/codehosting/codeimport/worker.py", line 452, in run
    return self._doImport()
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/lp/codehosting/codeimport/worker.py", line 590, in _doImport
    overwrite=True, **self.getExtraPullArgs())
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/optionalbzrplugins/git/branch.py", line 514, in pull
    stop_revision, overwrite=overwrite, graph=graph, limit=limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/optionalbzrplugins/git/branch.py", line 463, in _update_revisions
    determine_wants, self.source.mapping, limit=limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/optionalbzrplugins/git/fetch.py", line 571, in fetch_objects
    objects_iter, store, wants_recorder.wants, pb, limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/optionalbzrplugins/git/fetch.py", line 413, in import_git_objects
    o = lookup_object(head)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/optionalbzrplugins/git/fetch.py", line 399, in lookup_object
    return object_iter[sha]
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/pack.py", line 1488, in __getitem__
    return ShaFile.from_raw_string(type, uncomp)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/objects.py", line 370, in from_raw_string
    obj.set_raw_string(string)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/objects.py", line 257, in set_raw_string
    self.set_raw_chunks([text])
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/objects.py", line 261, in set_raw_chunks
    self._deserialize(chunks)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/objects.py", line 958, in _deserialize
    parse_timezone(timezonetext)
  File "/srv/importd.launchpad.net/production/launchpad-rev-12138/lib/dulwich/objects.py", line 888, in parse_timezone
    offset = int(text)
ValueError: invalid literal for int() with base 10: '--700'
Import failed:
Traceback (most recent call last):
Failure: twisted.internet.error.ProcessTerminated: A process has ended with a probable error condition: process ended with exit code 1.

Related branches

summary: - parse_timezone fails with: ValueError: invalid literal for int() with
- base 10: '--700'
+ git code import fails: ValueError: invalid literal for int() with base
+ 10: '--700'
Aaron Bentley (abentley)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Medium
tags: added: code-import
description: updated
Revision history for this message
Aaron Bentley (abentley) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is a broken git repository. It has a timezone specification "--700" when it should probably be "-0700".

charis:~/tmp/boto% git fsck --full
error in commit c1eddff4ee3f62b6039f1083651b9118883e7f07: invalid author/committer line - bad time zone

Dulwich should warn about it in check() rather than error out.

Changed in bzr-git:
status: New → Triaged
Changed in dulwich:
status: New → Triaged
Changed in bzr-git:
importance: Undecided → Low
Changed in dulwich:
importance: Undecided → Low
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi jelmer,
thanks for the quick reply.

Is there something (some magic git command) I can request to the owner of the repo in order to fix it?

regards,

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Fixing it will probably involve doing a fastexport + fastimport of the repository.

Since this changes the timestamp field it will affect the SHA1s of all commits after the problematic commit too, so they may not want to do this.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Oh, right..

probably I'll patch dulwich to handle this case and convert the --700 to -0700 and do a one time import into bzr.

Thanks!

Changed in launchpad:
importance: Medium → Low
Revision history for this message
Jason R. Coombs (jaraco) wrote :

This issue has bitten me when trying to make an hg clone of the canonical boto repo (git://github.com/boto/boto.git) using hg-git. It would be nice to have a fix for this sooner than later.

Revision history for this message
Jason R. Coombs (jaraco) wrote :

I should mention that I'm using dulwich as bundled with TortoiseHg (Windows) as a binary, so I don't have the luxury of simply patching the source as a workaround.

Revision history for this message
Jason R. Coombs (jaraco) wrote :

I did some reading into the relevant code in cgit: https://github.com/gitster/git/blob/master/date.c#L604.

If I read the code correctly, the C code interprets "--700" as a double-negative, or equivalent to +0700. I believe that implementation is a mistake, but if copying that mistake into dulwich is the proper fix, I will put together a patch.

Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Triaged → Fix Committed
assignee: nobody → Jason R. Coombs (jaraco)
milestone: none → 0.8.4
Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: Triaged → Fix Committed
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 0.6.8
Changed in launchpad:
assignee: nobody → Jelmer Vernooij (jelmer)
status: Triaged → In Progress
Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Fix Committed → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: Fix Committed → Fix Released
Revision history for this message
George Kola (georgekola) wrote :

I wanted to get the latest version of boto 2.3.0 (precise has 2.2.2) because of some bug fixes for EC2 oregon data center. I tried to build it on launchpad and ran into the above bug. Is there a timeframe of when launchpad would get this fix.

Thanks,
George

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This can be fixed in Launchpad by updating to the latest bzr-git, which would also require a newer version of bzr to be used.

Changed in launchpad:
status: In Progress → Triaged
assignee: Jelmer Vernooij (jelmer) → nobody
Jelmer Vernooij (jelmer)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
Steve Kowalik (stevenk)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.