UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 105: invalid continuation byte

Bug #797246 reported by Libor Jelinek
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

Dear Bazaar developers,
what does this error mean? I did nothing expect normal work (added some files, modified others). Absolutely don't understand what happened but it seems my branch is corrupted now. Please I need your urgent help.

Working on W7 64bit if applicable for your troubleshooting.

Tags: config

Related branches

Revision history for this message
Libor Jelinek (ljelinek) wrote :
Revision history for this message
Libor Jelinek (ljelinek) wrote :

Additional information:

My branch was binded. When I unbind it, then commit with the exactly same new added and changed files is successful.

When I will try to push new local revision back to branch on our central repository server, I will receive above error. I am push via bzr+ssh. Server file system is ext4 on Ubuntu 10.04 32bit.

Revision history for this message
Libor Jelinek (ljelinek) wrote :
Download full text (3.3 KiB)

** Output from push to server: ***

Run command: bzr push bzr+ssh://10.120.34.25/var/bzr-repos/reprodb/betterjtable/
bzr: ERROR: exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 105: invalid continuation byte

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 923, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1123, in run_bzr
  File "bzrlib\commands.pyo", line 691, in run_argv_aliases
  File "bzrlib\commands.pyo", line 710, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "D:/dev/Bazaar/plugins\qbzr\lib\commands.py", line 788, in run
  File "D:/dev/Bazaar/plugins\qbzr\lib\subprocess.py", line 888, in run_subprocess_command
  File "bzrlib\commands.pyo", line 1123, in run_bzr
  File "bzrlib\commands.pyo", line 691, in run_argv_aliases
  File "bzrlib\commands.pyo", line 710, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "C:/Users/adminaerocan/AppData/Roaming/bazaar/2.0/plugins\push_and_update\__init__.py", line 75, in run
  File "bzrlib\builtins.pyo", line 1132, in run
  File "bzrlib\push.pyo", line 79, in _show_push_branch
  File "bzrlib\transport\__init__.pyo", line 1615, in get_transport
  File "bzrlib\transport\__init__.pyo", line 1638, in _try_transport_factories
  File "bzrlib\transport\remote.pyo", line 110, in __init__
  File "bzrlib\transport\remote.pyo", line 518, in _build_medium
  File "bzrlib\config.pyo", line 1499, in get_user
  File "bzrlib\config.pyo", line 1366, in get_credentials
  File "bzrlib\config.pyo", line 1309, in _get_config
  File "bzrlib\config.pyo", line 149, in ConfigObj
  File "bzrlib\util\configobj\configobj.pyo", line 1223, in __init__
  File "bzrlib\util\configobj\configobj.pyo", line 1276, in _load
  File "bzrlib\util\configobj\configobj.pyo", line 1412, in _handle_bom
  File "bzrlib\util\configobj\configobj.pyo", line 1472, in _decode
  File "encodings\utf_8.pyo", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 105: invalid continuation byte

bzr 2.3.0 on python 2.6.6 (Windows-7-6.1.7600)
arguments: ['D:\\dev\\Bazaar\\bzr.exe', 'qsubprocess', '--bencode', 'l4:push58:bzr+ssh://10.120.34.25/var/bzr-repos/reprodb/betterjtable/e']
encoding: 'cp1250', fsenc: 'mbcs', lang: None
plugins:
  bzrtools D:\dev\Bazaar\plugins\bzrtools [2.3.1]
  colo D:\dev\Bazaar\plugins\colo [0.2.1]
  explorer D:\dev\Bazaar\plugins\explorer [1.1.2]
  fastimport D:\dev\Bazaar\plugins\fastimport [0.10.0dev]
  launchpad D:\dev\Bazaar\plugins\launchpad [2.3.0]
  loom D:\dev\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store D:\dev\Bazaar\plugins\netrc_credential_store [2.3.0]
  news_merge D:\dev\Bazaar\plugins\news_merge [2.3.0]
  pipeline D:\dev\Bazaar\plugins\pipeline [1.1.0]
  push_and_update C:\Users\adminaerocan\AppData\Roaming\bazaar\2.0\plugins\push_and_update [0.2.0dev]
  qbzr D:\dev\Bazaar\plugins\qbzr [0.20.0]
  rewrite D:\dev\Bazaar\plu...

Read more...

Revision history for this message
Vincent Ladeuil (vila) wrote :

Shooting in the dark: the traceback seems to point to a config file whose content is not encoded in utf-8. Probably authentication.conf on your client.

Changed in bzr:
status: New → Incomplete
Revision history for this message
Libor Jelinek (ljelinek) wrote :

Vicent, perfect! You was right! You saved my ass :-)

But how did you observe it? Nowhere in traceback is any indication then error is caused by not UTF8 in authentication.conf?

I had Czech language letters in ANSI-8 (I suppose it's Windows-1250) encoding. Saved in UTF8 and error disappeared!

Thanks a lot!

Libor Jelinek (ljelinek)
Changed in bzr:
status: Incomplete → Fix Released
status: Fix Released → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Vincent Ladeuil (vila) wrote : Re: [Bug 797246] Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 105: invalid continuation byte

>>>>> Libor Jelinek <email address hidden> writes:

    > Vicent, perfect! You was right! You saved my ass :-) But how did
    > you observe it? Nowhere in traceback is any indication then error
    > is caused by not UTF8 in authentication.conf?

Well, the traceback hinted authentication.conf:

 File "bzrlib\config.pyo", line 1366, in get_credentials

then

  File "bzrlib\util\configobj\configobj.pyo", line 1276, in _load
  File "bzrlib\util\configobj\configobj.pyo", line 1412, in _handle_bom
  File "bzrlib\util\configobj\configobj.pyo", line 1472, in _decode

pretty much says 'loading the file content and decoding'.

mgz later mark this bug as a dupe, 'cause we encountered the issue in the
past. But that was in other config files which use a different code path
so we may want to de-dupe this one to provide a better error message for
authentication.conf.

Changed in bzr:
status: Incomplete → Confirmed
importance: Undecided → Medium
tags: added: config
Revision history for this message
Martin Packman (gz) wrote :

There are multiple codepaths currently, but isn't part of the reason for your config rewrite to rationalise that Vincent? See also bug 691642 which was also on the authentication.conf path.

Revision history for this message
Martin Packman (gz) wrote :

To put that another way, I can fix this bug, and bug 502060, by adding the same try/except code in three places in bzrlib.config but presumably that will conflict with the rewrite anyway.

Revision history for this message
Martin Pool (mbp) wrote :

On 14 June 2011 11:39, Martin [gz] <email address hidden> wrote:
> To put that another way, I can fix this bug, and bug 502060, by adding
> the same try/except code in three places in bzrlib.config but presumably
> that will conflict with the rewrite anyway.

If you want to do a patch for it, go ahead, and we'll deal with
conflicts when they happen.

Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> Martin [gz] <email address hidden> writes:

    > There are multiple codepaths currently, but isn't part of the
    > reason for your config rewrite to rationalise that Vincent?

Huh. You're right, it's just that I, temporarily, forgot that
authentication.conf should indeed use the new implementation.

But I agree with poolie, if you have a patch to fix this (and the
related ones), no need to wait, I'll take care of the conflicts if/when
they occur and if you add tests for that, their essence should survive
the refactoring too ;)

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b5
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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