"'dict' object has no attribute 'encode'" error on commit

Bug #434034 reported by Tymek
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
QBzr
Status tracked in Trunk
0.14
Fix Released
Critical
Alexander Belchenko
Trunk
Fix Released
Critical
Alexander Belchenko

Bug Description

bzr: ERROR: exceptions.AttributeError: 'dict' object has no attribute 'encode'

Traceback (most recent call last):
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commit.py", line 664, in closeEvent
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commit.py", line 659, in _save_or_wipe_commit_data
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commit.py", line 565, in wipe_commit_data
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commit_data.py", line 179, in wipe
  File "bzrlib\config.pyo", line 701, in set_user_option
  File "bzrlib\config.pyo", line 970, in set_option
  File "bzrlib\remote.pyo", line 2669, in set_option
AttributeError: 'dict' object has no attribute 'encode'

bzr 2.0.0rc2 on python 2.5.4 (win32)
arguments: ['C:\\Program Files\\Bazaar\\bzr.exe', 'qcommit', '--ui-mode']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.0.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [0.8.1]
  extmerge C:\Program Files\Bazaar\plugins\extmerge [unknown]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.0.0rc2]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.0.0rc2]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.14.2]
  rebase C:\Program Files\Bazaar\plugins\rebase [0.5.3]
  svn C:\Program Files\Bazaar\plugins\svn [0.6.5]
  upload C:\Program Files\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.5]

Related branches

Revision history for this message
Tymek (maju7) wrote :

This happen when committing 46 files.

Files with no special signs (all in english). Folders with spaces.

Revision history for this message
Tymek (maju7) wrote :

Actually this happens now with any commit (1 file).

Bzr-explorer 0.8 in Windows

Bzr server in ubuntu.

I'm pretty sure this started happening with 2.0 RC1 and wasn't happening and is also happening with 2.0 RC2 1.

Commits looks successful.

Revision history for this message
Tymek (maju7) wrote :

And more data:

C:\test1>bzr add
adding b.txt

C:\test1>bzr qcommit
Committing to: bzr://192.168.56.102:1234/test1/
added b.txt
Committed revision 5.

The crash window is shown now (after "Committed revision 5")

C:\test1>bzr add
adding c.txt

C:\test1>bzr commit -m "Text"
Committing to: bzr://192.168.56.102:1234/test1/
added c.txt
Committed revision 6.

This is quite obvious but the above (commit, not qcommit) doesn't show any erros.

BTW. I don't have TortoiseBzr installed.

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

Workaround: either don't Cancel your commit, or use bound branches (heavyweight checkouts) instead of lightweight checkouts. Sorry, but actually the problem in bzr itself, see bug 430382.

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

Oh, you get error even on clean commit. Hmmm.
Perhaps we should not save commit data blindly if there is nothing to save.

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

Although this is clearly duplicate of bug 430382, but we can do better and avoid triggering this bug if there is no changes in commit_data.

Changed in qbzr:
assignee: nobody → Alexander Belchenko (bialix)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Tymek (maju7) wrote :

Ok I'm confused about two things:

1. I'm not using cancel at all. The problem is shown during commits.
2. What do you mean by a clean commit. The example commit adds one file so it's not an empty commit if this is what you mean.

Let me know if you need any more data.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 434034] Re: "'dict' object has no attribute 'encode'" error on commit

Tymek пишет:
> Ok I'm confused about two things:

Sorry, about this. I've mumbled to myself.

> 1. I'm not using cancel at all. The problem is shown during commits.
> 2. What do you mean by a clean commit. The example commit adds one file so it's not an empty commit if this is what you mean.

I mean you have successful commit without any errors (clean).

> Let me know if you need any more data.

No, I understand where the problem lies.

You have only one workaround right now: use heavyweight checkout.
You can transform your current (lightweight) checkout to heavyweight with following command:

bzr reconfigure --checkout

I will try to fix original problem. Though I can't promise it will be very fast.

Revision history for this message
Tymek (maju7) wrote :

We are using the heavyweight checkouts if I understand things correctly.

server: bzr repo-init repo --no-trees
server: bzr init repo/trunk
client: branch trunk branch1(well we did it through bzr explorer so I guess bzr qbranch)
client: checkout branch1
client: bzr add
client: bzr qcommit

Anyway, the point I think is that the commits work and I guess you know where the problem is.

Cheers
Tymek

BTW. Hehe "Tymek пишет" ;)

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

Tymek пишет:
> We are using the heavyweight checkouts if I understand things correctly.

Please, show me the result of running following command in your local checkout:

bzr info -v

You can edit sensitive paths if you wish, but keep intact other service information.

> Anyway, the point I think is that the commits work and I guess you know
> where the problem is.

I'm not sure now. If should not happens with heavyweight checkouts IIUC.

> BTW. Hehe "Tymek пишет" ;)

It's "Tymek wrote" in Russian. Is it problem for you?

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

Tymek пишет:
> We are using the heavyweight checkouts if I understand things correctly.
>
> server: bzr repo-init repo --no-trees
> server: bzr init repo/trunk
> client: branch trunk branch1(well we did it through bzr explorer so I guess bzr qbranch)
> client: checkout branch1

If you created checkout via explorer then you got lightweight checkout, because explorer trying to
create light checkouts and call heavyweight checkouts as bound branches.

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

Alexander Belchenko пишет:
> Tymek пишет:
>> We are using the heavyweight checkouts if I understand things correctly.
>
> Please, show me the result of running following command in your local
> checkout:
>
> bzr info -v
>
> You can edit sensitive paths if you wish, but keep intact other service
> information.
>
>> Anyway, the point I think is that the commits work and I guess you know
>> where the problem is.
>
> I'm not sure now. If should not happens with heavyweight checkouts IIUC.

I've tried to reproduce this situation with simple bzr:// server running locally as

bzr serve --allow-writes --directory=.

and got normal commit with bound branch (heavyweight checkout) but error with lightweight checkout.
I suspect you actually have light checkout, so my workaround with reconfigure should help.

Revision history for this message
Tymek (maju7) wrote :

>It's "Tymek wrote" in Russian. Is it problem for you?
No, not at all - I'm Polish so I understood - It's just cool to see somthing not it English on launchpad:)

>If you created checkout via explorer then you got lightweight checkout, because explorer trying to
create light checkouts

Yep, the checkouts were created with the explorer. Thanks for the info!

Revision history for this message
Tymek (maju7) wrote :

Hm...

After running bzr reconfigure --checkout I get:

c:\test2>bzr reconfigure --checkout
bzr: ERROR: exceptions.AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x02
29B190> is not a RemoteBzrDir

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 842, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1037, in run_bzr
  File "bzrlib\commands.pyo", line 654, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 5330, in run
  File "bzrlib\reconfigure.pyo", line 332, in apply
  File "bzrlib\remote.pyo", line 501, in initialize
  File "bzrlib\remote.pyo", line 494, in _vfs_initialize
  File "bzrlib\remote.pyo", line 540, in open
AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x0229B190> is not a Remote
BzrDir

bzr 2.0rc2 on python 2.5.4 (Windows-Vista-6.0.6001-SP1)
arguments: ['bzr', 'reconfigure', '--checkout']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [0.8.1]
  extmerge C:\Program Files\Bazaar\plugins\extmerge [unknown]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.0rc2]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store
[2.0rc2]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.14.2]
  rebase C:\Program Files\Bazaar\plugins\rebase [0.5.3]
  svn C:\Program Files\Bazaar\plugins\svn [0.6.5]
  upload C:\Program Files\Bazaar\plugins\upload [1.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.5]

*** 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.

To investigate a bit more I tried "reconfigure --checkout) on a heavyweight checkout too:
(all from command line)
c:\>bzr checkout bzr://192.168.168.66:1234/test2 c:\test3

c:\>cd test3
c:\test3>bzr reconfigure --lightweight-checkout

c:\test3>bzr reconfigure --checkout
bzr: ERROR: exceptions.AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x0229B190> is not a RemoteBzrDir

Traceback (most recent call last):
(...)

1. Do you want a new bug for this?

2. As for the original qcommit problem we'll just create new checkouts with the command line for now.

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

Tymek пишет:
> Hm...
>
> After running bzr reconfigure --checkout I get:
>
> c:\test2>bzr reconfigure --checkout
> bzr: ERROR: exceptions.AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x02
> 29B190> is not a RemoteBzrDir
>
> Traceback (most recent call last):
> File "bzrlib\commands.pyo", line 842, in exception_to_return_code
> File "bzrlib\commands.pyo", line 1037, in run_bzr
> File "bzrlib\commands.pyo", line 654, in run_argv_aliases
> File "bzrlib\builtins.pyo", line 5330, in run
> File "bzrlib\reconfigure.pyo", line 332, in apply
> File "bzrlib\remote.pyo", line 501, in initialize
> File "bzrlib\remote.pyo", line 494, in _vfs_initialize
> File "bzrlib\remote.pyo", line 540, in open
> AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x0229B190> is not a Remote
> BzrDir

I suspect this is regression in core bzr.

> 1. Do you want a new bug for this?

Yes, please, a matter of urgency, file a bug against bzr project.

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

Tymek пишет:
> Hm...
>
> After running bzr reconfigure --checkout I get:
>
> c:\test2>bzr reconfigure --checkout
> bzr: ERROR: exceptions.AssertionError: <bzrlib.bzrdir.BzrDirMeta1 object at 0x02
> 29B190> is not a RemoteBzrDir

Workaround for this error:

bzr reconfigure --tree
bzr bind URL/to/master/branch

Revision history for this message
Ken Tang (ktlb) wrote :

This problem also happening in Bazaar 2.0.0-2 with Bazaar Explorer 0.8.2

Revision history for this message
Matteo Settenvini (tchernobog) wrote :

I can confirm this happening on at least 3 different Windows machines. I'm using this to commit to a Samba share on an Ubuntu machine, but that should be transparent for bazaar, I think.

Changed in qbzr:
importance: High → Critical
Changed in qbzr:
milestone: none → 0.14.5
status: Confirmed → Fix Released
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.