ValueError: invalid literal for int() with base 10: 'None' in _parse_index_sizes from broken repository pack-names
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I'm trying to develop a little repo manager like gitosis for git. And when doing the first push from the client to the server, this error shows up:
bzr: ERROR: bzrlib.
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
return self._operation
File "/usr/lib/
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
use_
File "/usr/lib/
remember, create_prefix)
File "/usr/lib/
overwrite, stop_revision=
File "/usr/lib/
lossy, *args, **kwargs)
File "/usr/lib/
_override_
File "/usr/lib/
self.cleanups, self.func, self, *args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
result = self._basic_
File "/usr/lib/
graph=graph)
File "/usr/lib/
result = unbound(self, *args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
result = unbound(self, *args, **kwargs)
File "/usr/lib/
fetch_
File "/usr/lib/
find_
File "/usr/lib/
result = unbound(self, *args, **kwargs)
File "/usr/lib/
find_
File "/usr/lib/
self.__fetch()
File "/usr/lib/
self.
File "/usr/lib/
stream, from_format, [])
File "/usr/lib/
(verb, path, resume_tokens) + lock_args, byte_stream)
File "/usr/lib/
expect_
File "/usr/lib/
return request.
File "/usr/lib/
return self._call(
File "/usr/lib/
expect_
File "/usr/lib/
_raise_
File "/usr/lib/
raise errors.
ErrorFromSmartS
On the server side I also get this error:
dom 2012-06-03 22:22:26 +0200
0.033 bazaar version: 2.3.4
0.033 bzr arguments: [u'serve', u'--inet', u'--directory=
0.047 looking for plugins in /home/bzr/
0.083 looking for plugins in /usr/lib/
0.096 encoding stdout as osutils.
0.575 Traceback (most recent call last):
File "/usr/lib/
return callable(*args, **kwargs)
File "/usr/lib/
return self.do(*args)
File "/usr/lib/
return self.do_
File "/usr/lib/
revno, last_revision = branch.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
first_read = self.ensure_
File "/usr/lib/
self.
File "/usr/lib/
return tuple([int(digits) for digits in value.split(' ')])
ValueError: invalid literal for int() with base 10: 'None'
I found that changing this line on the bzrlib/
1100 return tuple([int(digits) for digits in value.split(' ')])
to this:
1100 return tuple([int(digits) for digits in value.replace(
Solves the problem and the I can work with the repositories. But I'm not sure if this may introduce more errors or if it is safe.
Thanks
Related branches
- David Caro (community): Disapprove
- Martin Packman (community): Needs Information
-
Diff: 12 lines (+1/-1)1 file modifiedbzrlib/repofmt/pack_repo.py (+1/-1)
summary: |
- Error when pushing through smart server + alueError: invalid literal for int() with base 10: 'None' in + _parse_index_sizes |
summary: |
- alueError: invalid literal for int() with base 10: 'None' in - _parse_index_sizes + ValueError: invalid literal for int() with base 10: 'None' in + _parse_index_sizes from broken repository pack-names |
Changed in bzr: | |
importance: | Undecided → Medium |
status: | Invalid → Confirmed |
tags: | added: check-for-breezy |
It seems like you have a broken pack-names file in the repository in question, can you find it (inside .bzr/repository on the server) and attach it to the bug please?
If you want to see exactly where that dodgy value is, try running the following script:
import pprint
btree_ index,
from bzrlib import (
transport,
)
url = "file:/ //path/ to/repo/ .bzr/repository " get_transport( url) BTreeGraphIndex (t, "pack-names", None) pprint( list(idx. iter_all_ entries( )))
t = transport.
idx = btree_index.
pprint.