bzr starts raising error on all actions after usin repo for a while: # ValueError: invalid literal for int() with base 10: 'None'

Bug #322299 reported by caolan
4
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
High
Unassigned

Bug Description

This seems to happen after using a repository set up on a linux server using bzr 1.11 on ubuntu 8.10 and bzr smart-server over ssh. It happens when committing, checking out, all actions as far as I can tell. Deleting the repository and starting again (with no revision history) seems to fix it for a short while. The last time this error started was when I committed .bzrignore as a new file on a copy checked out from the server.

.bzrignore contained the following:
./__init__.py
./settings.py
./manage.py
*.pyc

This error basically makes bzr unusable for version control.

bzr co bzr+ssh://bzr@host/repo
bzr: ERROR: exceptions.ValueError: invalid literal for int() with base 10: 'None'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1129, in run
    accelerator_tree, hardlink)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 838, in create_checkout
    checkout_branch.pull(self, stop_revision=revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1963, in pull
    _override_hook_target=_override_hook_target)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1756, in pull
    source.lock_read()
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 1442, in lock_read
    self.repository.lock_read()
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 542, in lock_read
    self._real_repository.lock_read()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 2007, in lock_read
    self._refresh_data()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1968, in _refresh_data
    self._pack_collection.ensure_loaded()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1469, in ensure_loaded
    self._names[name] = self._parse_index_sizes(value)
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1476, in _parse_index_sizes
    return tuple([int(digits) for digits in value.split(' ')])
ValueError: invalid literal for int() with base 10: 'None'

bzr 1.11 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'co', 'bzr+ssh://bzr@host/repo']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
caolan (caolan) wrote :

This has just occurred again, and I now think that it is down to my collaborator checking out using tortoise-bzr on windows. when I get some time I will test this and report back.

Revision history for this message
Andrew Bennetts (spiv) wrote :

This sounds serious. I wonder if it's a line-ending issue or something? Can you send a tarball or zip file of your repository?

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
caolan (caolan) wrote :

We've just recreated this bug 3 times in a row, each time it occurred on committing the 10th revision. The 9th works fine, and the other can bzr update and get the 9th, but on committing the 10th we get:

bzr: ERROR: Server sent an unexpected error: ('error', "invalid literal for int() with base 10: 'None'")

This occurs no matter what the content in the repository is.

Me (Ubuntu 8.10)
bzr 1.11

Collaborator (Vista Home Premium)
bzr 1.11
tortoise-bzr 0.2rc0

Server (Ubuntu 8.10)
bzr 1.11

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 322299] Re: bzr starts raising error on all actions after usin repo for a while: # ValueError: invalid literal for int() with base 10: 'None'

On Thu, 2009-01-29 at 00:19 +0000, caolan wrote:
> We've just recreated this bug 3 times in a row, each time it occurred on
> committing the 10th revision. The 9th works fine, and the other can bzr
> update and get the 9th, but on committing the 10th we get:
>
> bzr: ERROR: Server sent an unexpected error: ('error', "invalid literal
> for int() with base 10: 'None'")

10 commits is the first autopack to occur. Please try using 'sftp:'
rather than 'bzr+ssh:' and see if that behaves better.

Andrew - could it be your server side autopack hook?

-Rob

Revision history for this message
Andrew Bennetts (spiv) wrote :

My guess is that the server-side autopack hook is the victim here, not the cause. It'd be good to see a tarball of the repository, or at least its .bzr/repository/indices directory, to see exactly what the corruption looks like.

Revision history for this message
John A Meinel (jameinel) wrote :

It sounds like it is getting a "number of entries/size" of a pack file = None rather than a legitimate size.

Revision history for this message
caolan (caolan) wrote :

Ok, I've tried using sftp:// and that worked fine. I now believe I have narrowed it down to a plugin which forms part of bazitis, which I have installed on the server (should have mentioned that!).

I will look into it further when I get chance.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Ah, ok. <http://bazaar.launchpad.net/%7Earolsen/bazitis/trunk/annotate/head%3A/bazitis/templates/bazplugin.py> looks pretty suspicious to me. I haven't checked carefully, but I wouldn't be surprised if its path mangling was buggy.

(I'd recommend implementing that sort of access control by writing a plugin that overrides the 'bzr serve' command to use a custom transport, rather than by overriding LocalTransport globally inside bzrlib.)

Revision history for this message
Andrew Bennetts (spiv) wrote :

Marking this bug "incomplete" while waiting for caolan to look into the plugin on the server.

Changed in bzr:
status: Confirmed → Incomplete
Revision history for this message
caolan (caolan) wrote :

Andrew, I agree, that sounds like a better way to do things! I'll try making the changes you've suggested to the plugin and report back.

Revision history for this message
caolan (caolan) wrote :

Making those changes to the plugin and creating a new command 'authserve' which uses the modified transport seems to be working so far. Once I tidy up the code I'll report back to the bazitis developer.

Thanks for your help and guidance, I appreciate this wasn't really a bzr issue, but a plugin problem.

Andrew Bennetts (spiv)
Changed in bzr:
status: Incomplete → Invalid
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.