AssertionError: _remember_remote_is_before((1, 18)) called, but _remember_remote_is_before((1, 15)) was called previously

Bug #418931 reported by Brian de Alwis on 2009-08-25
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
High
Andrew Bennetts

Bug Description

I was pushing a branch to a remote location and encountered this exception. My local bzr is 1.18, the remote is 1.14rc2. I really should upgrade the remote version.

$ bzr push bzr+ssh://$V/staff/bsd178/gt3-pm
bzr: ERROR: exceptions.AssertionError: _remember_remote_is_before((1, 18)) called, but _remember_remote_is_before((1, 15)) was called previously.

Traceback (most recent call last):
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/builtins.py", line 1152, in run
    use_existing_dir=use_existing_dir)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/push.py", line 92, in _show_push_branch
    create_prefix=create_prefix, use_existing_dir=use_existing_dir)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/branch.py", line 1282, in create_clone_on_transport
    create_prefix=create_prefix, use_existing_dir=use_existing_dir)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 274, in clone_on_transport
    repository_policy=repository_policy)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/branch.py", line 1136, in clone
    self.copy_content_into(result, revision_id=revision_id)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/branch.py", line 1203, in copy_content_into
    self.tags.merge_to(destination.tags)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/tag.py", line 214, in merge_to
    to_tags._set_tag_dict(result)
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/tag.py", line 160, in _set_tag_dict
    return self.branch._set_tags_bytes(self._serialize_tag_dict(new_dict))
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/remote.py", line 2196, in _set_tags_bytes
    medium._remember_remote_is_before((1, 18))
  File "/usr/pkg/lib/python2.5/site-packages/bzrlib/smart/medium.py", line 607, in _remember_remote_is_before
    % (version_tuple, self._remote_version_is_before))
AssertionError: _remember_remote_is_before((1, 18)) called, but _remember_remote_is_before((1, 15)) was called previously.

bzr 1.18 on python 2.5.4 (darwin)
arguments: ['/usr/pkg/bin/bzr', 'push', 'bzr+ssh://<email address hidden>/staff/bsd178/gt3-pm']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_CA.UTF-8'
plugins:
  automv /Users/bsd/.bazaar/plugins/automv [unknown]
  clear_exec_bit /Users/bsd/.bazaar/plugins/clear_exec_bit.py [unknown]
  diffstat /Users/bsd/.bazaar/plugins/diffstat [0.2]
  extmerge /Users/bsd/.bazaar/plugins/extmerge [unknown]
  fastimport /Users/bsd/.bazaar/plugins/fastimport [unknown]
  launchpad /usr/pkg/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.18]
  mail_app /Users/bsd/.bazaar/plugins/mail_app.py [unknown]
  merge_into /Users/bsd/.bazaar/plugins/merge_into [unknown]
  netrc_credential_store /usr/pkg/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.18]
  pager /Users/bsd/.bazaar/plugins/pager [unknown]
  rebase /Users/bsd/.bazaar/plugins/rebase [0.4.1]
  search /Users/bsd/.bazaar/plugins/search [1.7dev]
  svn /usr/pkg/lib/python2.5/site-packages/bzrlib/plugins/svn [0.6.4]
  vimdiff /Users/bsd/.bazaar/plugins/vimdiff [unknown]
  xmloutput /Users/bsd/.bazaar/plugins/xmloutput [0.8.5]
*** 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.

Related branches

On Tue, 2009-08-25 at 23:28 +0000, Brian de Alwis wrote:
> Public bug reported:
>
> I was pushing a branch to a remote location and encountered this
> exception. My local bzr is 1.18, the remote is 1.14rc2. I really
> should upgrade the remote version.

You will get significantly improved performance if you do.

That said,this is a bug, and likely to bit other people.

 status confirmed
 importance high

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Martin Pool (mbp) wrote :

It does reflect a real bug, and it's a bit comical:

    def _get_tags_bytes(self):
        medium = self._client._medium
        if medium._is_remote_before((1, 13)):
            return self._vfs_get_tags_bytes()
        try:
            response = self._call('Branch.get_tags_bytes', self._remote_path())
        except errors.UnknownSmartMethod:
            medium._remember_remote_is_before((1, 13))
            return self._vfs_get_tags_bytes()
        return response[0]

    def _vfs_set_tags_bytes(self, bytes):
        self._ensure_real()
        return self._real_branch._set_tags_bytes(bytes)

    def _set_tags_bytes(self, bytes):
        medium = self._client._medium
        if medium._is_remote_before((1, 18)):
            self._vfs_set_tags_bytes(bytes)
        try:
            args = (
                self._remote_path(), self._lock_token, self._repo_lock_token)
            response = self._call_with_body_bytes(
                'Branch.set_tags_bytes', args, bytes)
        except errors.UnknownSmartMethod:
            medium._remember_remote_is_before((1, 18))
            self._vfs_set_tags_bytes(bytes)

If the server doesn't support it, we do it over vfs and then try again by rpc.

So it's good the assertion caught this, but I also think it's a bit bad there's repeated code to do:

  if server older than X:
     do old method
  else:
    try it
    except not supported:
      server_is_older_than X

Andrew Bennetts (spiv) on 2009-08-27
Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
Andrew Bennetts (spiv) on 2009-08-27
Changed in bzr:
status: Confirmed → Fix Committed
Brian de Alwis (slyguy) wrote :

That does the trick. Thanks!

Andrew Bennetts (spiv) on 2009-10-13
Changed in bzr:
status: Fix Committed → Fix Released
Martin Pool (mbp) wrote :

Bug 528041 is similar and still open as of now

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers