bzr: ERROR: bzrlib.util.configobj.configobj.ParseError: Invalid line at line "1"

Bug #723691 reported by Angel Guzman Maeso
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
High
Unassigned
QBzr
Confirmed
Critical
Unassigned

Bug Description

This error should show more information on Exception like what file it is parsed.

When .bzr/branch/branch.conf dont exist o it is empty, show that error. Bazaar should try to create a initial configuration. Bzr Explorer fails totally and dont show any error on GUI for the user. The user only think "it is totally broken, I dont know how to fix".

I try to create a bazaar.conf but show the same problem (I dont have a backup). Although I reinstall Bazaar + Bazaar explorer, it is dont work yet. So I am stuck, because I cant use bzr explorer and I dont know how to fix.

Related to https://bugs.launchpad.net/bzr/+bug/502060

The traceback:
"C:\Archivos de programa\Bazaar2\bzr.exe" explore
r
bzr: ERROR: bzrlib.util.configobj.configobj.ParseError: Invalid line at line "1"
.

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 "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\commands.py", line
162, in run
  File "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\explorer.py", line
197, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\wt_browser.py", lin
e 48, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\wt_browser.py", lin
e 449, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\wt_browser.py", lin
e 678, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\explorer\lib\wt_browser.py", lin
e 624, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\qbzr\lib\treewidget.py", line 13
50, in __init__
  File "C:/Archivos de programa/Bazaar2/plugins\qbzr\lib\treewidget.py", line 16
86, in create_context_menu
  File "bzrlib\lazy_import.pyo", line 125, in __call__
  File "bzrlib\lazy_import.pyo", line 89, in _replace
  File "bzrlib\lazy_import.pyo", line 195, in _import
  File "C:/Archivos de programa/Bazaar2/plugins\qbzr\lib\diff.py", line 31, in <
module>
  File "C:/Archivos de programa/Bazaar2/plugins\qbzr\lib\util.py", line 122, in
get_option
  File "C:/Archivos de programa/Bazaar2/plugins\qbzr\lib\util.py", line 107, in
_load
  File "bzrlib\util\configobj\configobj.pyo", line 1223, in __init__
  File "bzrlib\util\configobj\configobj.pyo", line 1306, in _load
ParseError: Invalid line at line "1".

bzr 2.3.0 on python 2.6.6 (Windows-XP-5.1.2600-SP3)
arguments: ['C:\\Archivos de programa\\Bazaar2\\bzr.exe', 'explorer']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Archivos de programa\Bazaar2\plugins\bzrtools [2.3.1]
  colo C:\Archivos de programa\Bazaar2\plugins\colo [0.2.1]
  explorer C:\Archivos de programa\Bazaar2\plugins\explorer [1.1.2]
  fastimport C:\Archivos de programa\Bazaar2\plugins\fastimport [0.10.
0dev]
  launchpad C:\Archivos de programa\Bazaar2\plugins\launchpad [2.3.0]

  loom C:\Archivos de programa\Bazaar2\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Archivos de programa\Bazaar2\plugins\netrc_credentia
l_store [2.3.0]
  news_merge C:\Archivos de programa\Bazaar2\plugins\news_merge [2.3.0
]
  pipeline C:\Archivos de programa\Bazaar2\plugins\pipeline [1.1.0]
  qbzr C:\Archivos de programa\Bazaar2\plugins\qbzr [0.20.0]
  rewrite C:\Archivos de programa\Bazaar2\plugins\rewrite [0.6.2dev
]
  svn C:\Archivos de programa\Bazaar2\plugins\svn [1.0.5dev]
  upload C:\Archivos de programa\Bazaar2\plugins\upload [1.0.0]
  xmloutput C:\Archivos de programa\Bazaar2\plugins\xmloutput [0.8.7.
dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Jelmer Vernooij (jelmer)
affects: bzr → qbzr
Revision history for this message
Alexander Belchenko (bialix) wrote :

I'm unable to reproduce your problem if I don't have any of config files we supposedly trying to read. I suspect you have some config file broken (i.e. garbage inside). Can you please send me or attach to the bug report archive with files from C:\Document and Settings\USERNAME\Application Data\bazaar\2.0 directory (adjust its name to your system). The information in the bug report is enough to provide a some fix, but I'd like to understand what's going on.

Changed in qbzr:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Vincent Ladeuil (vila) wrote :

Re-adding bzr as it should be fixed in core:
- emit a warning mentioning the file path,
- continue as if the file was empty (optionally failing but I think it's overkill)

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

> - continue as if the file was empty (optionally failing but I think it's overkill)

Almost.

There are two cases:

read access only:
----------------------

Proceed as if the file was empty with a warning.

read-write access:
-----------------------

Rename the existing file adding '~N' as we do for other backups and creates a new config file when required (mentioning it in the warning or in a new warning whatever works best).

I may be missing edge cases were this leads to surprising results for the user but hopefully the overall result will be better than: "I can't read one of your config files, find it or I'll refuse to work for you".

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

Attached the requested folder and files. Thanks.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 723691] Re: bzr: ERROR: bzrlib.util.configobj.configobj.ParseError: Invalid line at line "1"

Angel Guzman Maeso пишет:
> Attached the requested folder and files. Thanks.
>
> ** Attachment added: "Bazaar 2.0 folder"
> https://bugs.launchpad.net/qbzr/+bug/723691/+attachment/1869302/+files/2.0.zip

Many thanks!

It's very interesting indeed. You have broken qbzr.conf file with size
1208 bytes and all those bytes are zeroes. I suppose you had some disk
failure, perhaps windows scandisk has tried to restore the file and
eventually it ended up filled with the zeroes. I saw similar behavior on
my some my old machines.

So, to repair your bzr install you just need to delete qbzr.conf file,
and it will be created automatically for you with normal content.

I'll provide a corresponding guard check to qbzr itself as well.

--
All the dude wanted was his rug back

Revision history for this message
Alexander Belchenko (bialix) wrote :

@Vincent: this specific bug only affects qbzr, but you're right in the general.

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

Alexander Belchenko, Maybte it is not a disk failure. I have a university student connection with a policy of two hours connection, after that, I have to enter a user and passwords again and it redirect all the existent connections to 10.35.0.1/somefile.html (like a proxy). So, my though is that when I did a push/commit the time expired and the connection take that .html file or some bytes that it was converted to zeroes.

It is weird, but I think that it is the real problem.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Angel Guzman Maeso пишет:
> It is weird, but I think that it is the real problem.

What do you mean by "the real problem"?

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

I mean, that I don't have a disk failure that it produces zeroes and the proxy makes that errors.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Angel Guzman Maeso пишет:
> I mean, that I don't have a disk failure that it produces zeroes and the
> proxy makes that errors.

Anyway, I don't see how bzr can prevent this error. We only can make
sure bzr/qbzr don't fail with traceback. But you'd better avoid such
problems to ensure your files are not corrupted.

--
All the dude wanted was his rug back

Revision history for this message
Angel Guzman Maeso (shakaran) wrote :

Thanks Alexander Belchenko, I know this connection sucks. it is enough with bzr dont failing with a traceback o moving the corrupt file and generating another with a warning (Message dialog o maybe QDialog)

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

So, the action here needs to be to catch errors coming from ConfigObj._load and report them in a useful manner? That seems to be what bug 502060 is asking for as well.

Revision history for this message
Alexander Belchenko (bialix) wrote :

I've made this bug separate (not dupe) again because it seems it still hits people who uses qbzr/explorer

Changed in bzr:
status: Confirmed → Invalid
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

Remote bug watches

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