Discussion:
'SyncEngine' object has no attribute 'partnerships'
Iain Buchanan
2008-05-29 02:43:39 UTC
Permalink
Hi all,

I'm testing out new Gentoo ebuilds for 0.11.1. So far everything is
good, except when I run sync-engine, I get some errors. This is the
last few lines:

2008-05-29 12:00:25,571 ERROR dbus.connection : Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 244, in _CBDeviceAuthStateChanged
self._ProcessAuth()
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 279, in _ProcessAuth
if self.partnerships != None:
AttributeError: 'SyncEngine' object has no attribute 'partnerships'
2008-05-29 12:00:30,023 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-29 12:00:30,024 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-29 12:00:30,024 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'
2008-05-29 12:00:30,024 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-29 12:00:30,024 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-29 12:00:30,025 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'
2008-05-29 12:00:30,025 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-29 12:00:30,025 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-29 12:00:30,025 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'

The Traceback is repeated a few times. list_partnerships acts as though
the device isn't connected:

$ list_partnerships.py
error: org.synce.SyncEngine.Error.Disconnected

however pls works, as does synce-kpm (without partnerships). All
versions are the latest 0.11.1 or the latest release available.

I'm stuck at this point! Any suggestions? thanks,
--
Iain Buchanan <iaindb at netspace dot net dot au>

Nuclear powered vacuuum cleaners will probably be a reality within 10 years.
-- Alex Lewyt (President of the Lewyt Corporation,
manufacturers of vacuum cleaners), quoted in The New York
Times, June 10, 1955.
Dr J A Gow
2008-05-29 16:02:19 UTC
Permalink
Post by Iain Buchanan
Hi all,
I'm testing out new Gentoo ebuilds for 0.11.1. So far everything is
good, except when I run sync-engine, I get some errors. This is the
File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 244, in _CBDeviceAuthStateChanged
self._ProcessAuth()
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 279, in _ProcessAuth
AttributeError: 'SyncEngine' object has no attribute 'partnerships'
I'll check this out tonight if I have a chance - I think I know where
the problem is.

John.
Dr J A Gow
2008-05-29 17:27:10 UTC
Permalink
Post by Iain Buchanan
Hi all,
I'm testing out new Gentoo ebuilds for 0.11.1. So far everything is
good, except when I run sync-engine, I get some errors. This is the
File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 244, in _CBDeviceAuthStateChanged
self._ProcessAuth()
File "/usr/lib/python2.5/site-packages/SyncEngine/kernel.py", line 279, in _ProcessAuth
Ok, try the latest SVN and let me know how you get on. I committed a fix
for a typo in r3467.

John.
Iain Buchanan
2008-05-30 05:51:41 UTC
Permalink
Hi,

thanks for the quick response.
Post by Dr J A Gow
Ok, try the latest SVN and let me know how you get on. I committed a fix
for a typo in r3467.
Thanks. I created a patch against 0.11.1:
--- SyncEngine/kernel.py 2008-05-30 14:54:51.000000000 +0930
+++ SyncEngine/kernel.py.2 2008-05-30 15:01:23.000000000 +0930
@@ -276,7 +276,7 @@
# if we suddenly need auth, first shut down all threads if they
# are running

- if self.partnerships != None:
+ if self.PshipManager.GetCurrentPartnership() != None:
self.OnDisconnect()

if auth.Authorize(self.devicePath,self.device,self.config.config_Global):

And I can't seem to see (or create properly) the partnerships.
list_partnerships just says:
error: org.synce.SyncEngine.Error.Disconnected

This is the output from sync-engine just after connecting the device:

2008-05-30 15:04:07,690 INFO engine.syncengine.kernel : _CBDeviceConnected: device connected at path /org/synce/odccm/Device/_2C343682_C645_9887_675F_401F60866DD0_
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : device IO2 connected
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:07,696 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
2008-05-30 15:04:07,696 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
2008-05-30 15:04:07,696 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:07,696 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
2008-05-30 15:04:07,697 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
2008-05-30 15:04:19,849 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:19,849 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:19,850 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-30 15:04:19,851 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'

I'm using synce-kpm to provide the password, which seems to work fine.
If I try synce-gnome I get this response from sync-engine:
2008-05-30 15:08:25,084 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:08:25,084 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
2008-05-30 15:08:25,084 INFO engine.syncengine.kernel : ProcessAuth: authorization not required for device 'IO2'

and list_partnerships still returns the error.


When I turn off the password, and reconnect the device, everything seems
to be happy!

Any ideas would be appreciated! Thanks,
--
Iain Buchanan <iaindb at netspace dot net dot au>

Not every question deserves an answer.
Dr J A Gow
2008-05-30 09:14:09 UTC
Permalink
Post by Iain Buchanan
Hi,
thanks for the quick response.
Post by Dr J A Gow
Ok, try the latest SVN and let me know how you get on. I committed a fix
for a typo in r3467.
--- SyncEngine/kernel.py 2008-05-30 14:54:51.000000000 +0930
+++ SyncEngine/kernel.py.2 2008-05-30 15:01:23.000000000 +0930
@@ -276,7 +276,7 @@
# if we suddenly need auth, first shut down all threads if they
# are running
self.OnDisconnect()
And I can't seem to see (or create properly) the partnerships.
error: org.synce.SyncEngine.Error.Disconnected
2008-05-30 15:04:07,690 INFO engine.syncengine.kernel : _CBDeviceConnected: device connected at path /org/synce/odccm/Device/_2C343682_C645_9887_675F_401F60866DD0_
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : device IO2 connected
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
2008-05-30 15:04:07,694 INFO engine.syncengine.kernel : Failed to authorize - disconnect and reconnect device to try again
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : _CBDeviceAuthStateChanged: device authorization state changed: reauthorizing
2008-05-30 15:04:07,695 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog INTERNAL_GUI does not exist
Great, we're one step forward. Now I just need to know why sync-engine's
internal authorization is broken. Watch this space...

John.
Dr J A Gow
2008-05-30 10:42:52 UTC
Permalink
Post by Iain Buchanan
Hi,
thanks for the quick response.
The problem is simply that sync-engine is not, for some reason, finding
the authorization tool on your system.

Can you update again from SVN (to r3470 or greater) and re-run the test.
There will be no change in functionality, but I have altered a debug
message to highlight the absolute path to the authorization tool. The
line 'auth: auth prog INTERNAL_GUI does not exist' should now read
'auth: auth prog <filename> does not exist'. Can you check whether
<filename> is present on your system and let me know the result?

John.
Iain Buchanan
2008-06-05 02:16:36 UTC
Permalink
Hi again,

sorry I'm a bit slow at trying this out atm...
Post by Dr J A Gow
Post by Iain Buchanan
Hi,
thanks for the quick response.
The problem is simply that sync-engine is not, for some reason, finding
the authorization tool on your system.
Can you update again from SVN (to r3470 or greater) and re-run the test.
First thing: config/config.xml is still listed in setup.py - I think
it's change to config/syncengine.conf.xml and where is it supposed to go
now? /etc? I'm happy if you leave it out of setup.py, then the distro
can do it.
Post by Dr J A Gow
There will be no change in functionality, but I have altered a debug
message to highlight the absolute path to the authorization tool. The
line 'auth: auth prog INTERNAL_GUI does not exist' should now read
'auth: auth prog <filename> does not exist'. Can you check whether
<filename> is present on your system and let me know the result?
It says:

auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist

and there is no authgiu.py installed anywhere. Is this a packaging
thing?

I added
'tools/authgui.py',
to setup.py, which installed it into /usr/bin (not sure if this is the
right way), then changed AuthMethod in /etc/syncengine.conf.xml to
<AuthMethod>/usr/bin/authgui.py</AuthMethod>

But I see this from sync-engine:
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,701 INFO engine.syncengine.kernel : device IO2 connected
2008-06-05 11:36:14,702 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist

I checked the permissions on /etc/syncengine.conf.xml, and its readable
by everyone. I checked config.py and it seems to be building the
path /etc/syncengine.conf.xml.

Finally I copied authgui.py
to /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py and
ran sync-engine again. This time it worked - popping up the gui.

So in summarising, these are the questions I'm left with:
1. Where should syncengine.conf.xml go
2. Where should the internal authgui.py go
3. Why did I see "unable to open system config file"
4. Even without the internal auth gui, I was using synce-gnome to
authenticate - why didn't sync-engine like this?

thanks heaps,
--
Iain Buchanan <iaindb at netspace dot net dot au>

As part of the conversion, computer specialists rewrote 1,500 programs;
a process that traditionally requires some debugging.
-- USA Today, referring to the Internal Revenue Service
conversion to a new computer system.
Dr J A Gow
2008-06-05 11:36:56 UTC
Permalink
Post by Iain Buchanan
Hi again,
sorry I'm a bit slow at trying this out atm...
No problem - many thanks for your comprehensive analysis.
Post by Iain Buchanan
First thing: config/config.xml is still listed in setup.py - I think
it's change to config/syncengine.conf.xml and where is it supposed to go
now? /etc? I'm happy if you leave it out of setup.py, then the distro
can do it.
Mea culpa! Again :)

Not being a packager I tend to forget setup.py. I'll change this in the
next bunch of commits I have planned. That is right - it should go
in /etc to form the systemwide config.
Post by Iain Buchanan
Post by Dr J A Gow
There will be no change in functionality, but I have altered a debug
message to highlight the absolute path to the authorization tool. The
line 'auth: auth prog INTERNAL_GUI does not exist' should now read
'auth: auth prog <filename> does not exist'. Can you check whether
<filename> is present on your system and let me know the result?
auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist
and there is no authgiu.py installed anywhere. Is this a packaging
thing?
It should be installed. It resides in 'tools'. Maybe this is not the
best place to put it as it is strictly called from sync-engine and not a
tool that can be called directly from the CLI, although it is a separate
program in its own right.
Post by Iain Buchanan
I added
'tools/authgui.py',
to setup.py, which installed it into /usr/bin (not sure if this is the
right way), then changed AuthMethod in /etc/syncengine.conf.xml to
<AuthMethod>/usr/bin/authgui.py</AuthMethod>
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,701 INFO engine.syncengine.kernel : device IO2 connected
2008-06-05 11:36:14,702 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist
I checked the permissions on /etc/syncengine.conf.xml, and its readable
by everyone. I checked config.py and it seems to be building the
path /etc/syncengine.conf.xml.
Finally I copied authgui.py
to /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py and
ran sync-engine again. This time it worked - popping up the gui.
1. Where should syncengine.conf.xml go
The systemwide file in /etc and the user file in ~/.synce
Post by Iain Buchanan
2. Where should the internal authgui.py go
At the moment it sits in 'tools' and sync-engine expects it there. The
fact it is not installed sounds like a packaging problem combined with
the hardcoded relative path in sync-engine.

Packagers: Can any of the packagers reading this tell me where you would
prefer to place it? I can then adapt sync-engine to be able to see it.
Mark Ellis
2008-06-05 18:15:10 UTC
Permalink
Post by Dr J A Gow
Post by Iain Buchanan
Hi again,
sorry I'm a bit slow at trying this out atm...
No problem - many thanks for your comprehensive analysis.
Post by Iain Buchanan
First thing: config/config.xml is still listed in setup.py - I think
it's change to config/syncengine.conf.xml and where is it supposed to go
now? /etc? I'm happy if you leave it out of setup.py, then the distro
can do it.
Mea culpa! Again :)
Not being a packager I tend to forget setup.py. I'll change this in the
next bunch of commits I have planned. That is right - it should go
in /etc to form the systemwide config.
Post by Iain Buchanan
Post by Dr J A Gow
There will be no change in functionality, but I have altered a debug
message to highlight the absolute path to the authorization tool. The
line 'auth: auth prog INTERNAL_GUI does not exist' should now read
'auth: auth prog <filename> does not exist'. Can you check whether
<filename> is present on your system and let me know the result?
auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist
and there is no authgiu.py installed anywhere. Is this a packaging
thing?
It should be installed. It resides in 'tools'. Maybe this is not the
best place to put it as it is strictly called from sync-engine and not a
tool that can be called directly from the CLI, although it is a separate
program in its own right.
Post by Iain Buchanan
I added
'tools/authgui.py',
to setup.py, which installed it into /usr/bin (not sure if this is the
right way), then changed AuthMethod in /etc/syncengine.conf.xml to
<AuthMethod>/usr/bin/authgui.py</AuthMethod>
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,699 INFO engine.config.Config : UpdateConfig - unable to open system config file - using defaults
2008-06-05 11:36:14,701 INFO engine.syncengine.kernel : device IO2 connected
2008-06-05 11:36:14,702 INFO engine.syncengine.kernel : ProcessAuth : processing authorization for device 'IO2'
auth: auth prog /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py does not exist
I checked the permissions on /etc/syncengine.conf.xml, and its readable
by everyone. I checked config.py and it seems to be building the
path /etc/syncengine.conf.xml.
Finally I copied authgui.py
to /usr/lib/python2.5/site-packages/SyncEngine/../tools/authgui.py and
ran sync-engine again. This time it worked - popping up the gui.
1. Where should syncengine.conf.xml go
The systemwide file in /etc and the user file in ~/.synce
Or for the source package stick it in somewhere
like /usr/share/sync-engine-doc, so it's available but not installed by
default. Or not, doesn't really matter.
Post by Dr J A Gow
Post by Iain Buchanan
2. Where should the internal authgui.py go
At the moment it sits in 'tools' and sync-engine expects it there. The
fact it is not installed sounds like a packaging problem combined with
the hardcoded relative path in sync-engine.
Packagers: Can any of the packagers reading this tell me where you would
prefer to place it? I can then adapt sync-engine to be able to see it.
Dr J A Gow
2008-06-05 21:39:42 UTC
Permalink
Post by Mark Ellis
Or for the source package stick it in somewhere
like /usr/share/sync-engine-doc, so it's available but not installed by
default. Or not, doesn't really matter.
This seems a sane approach - one for the packagers to implement.
Post by Mark Ellis
Post by Iain Buchanan
2. Where should the internal authgui.py go
I'd say anywhere in the engine module tree. Although it's technically a
separate program it's very much part of sync-engine.
Agreed. I'll change this in the next bunch of commits.
Post by Mark Ellis
Post by Iain Buchanan
3. Why did I see "unable to open system config file"
Normally should be because you don't have syncengine.conf.xml in /etc.
But you do :) So I should be able to repeat this problem and fix it.
Permissions ?
But these were checked and were world r/w according to the original
message. It's worth me giving the code a once-over for hamfistedness :~)
Post by Mark Ellis
Post by Iain Buchanan
4. Even without the internal auth gui, I was using synce-gnome to
authenticate - why didn't sync-engine like this?
I will have to investigate this. If sync-engine sees a pre-authenticated
device it should not try to re-authenticate. I am a kde user and do not
use gnome - could you elaborate on how synce-gnome authenticates (from a
user's perspective? I may pick up some clues from this.
Not much time to investigate, so I'll take a guess at this.
Device is plugged in, sync-engine and synce-gnome see it needs a
password. synce-gnome provides the password, and unlocks the device.
Meanwhile, sync-engine fails to authenticate directly via _ProcessAuth,
but does see the auth state changes, and some confusion results ?
Could be. I have never seen this behaviour with kde so I may have to
attempt to run it under a gnome environment to debug it. If you can
repeat this I would be interested to know, and to have a copy of your
log.

John.
John Carr
2008-06-05 21:59:30 UTC
Permalink
Post by Dr J A Gow
Post by Mark Ellis
Device is plugged in, sync-engine and synce-gnome see it needs a
password. synce-gnome provides the password, and unlocks the device.
Meanwhile, sync-engine fails to authenticate directly via _ProcessAuth,
but does see the auth state changes, and some confusion results ?
Could be. I have never seen this behaviour with kde so I may have to
attempt to run it under a gnome environment to debug it. If you can
repeat this I would be interested to know, and to have a copy of your
log.
John.
Just sticking my nose in. synce-gnome is tiny tiny tiny. It does
practically nothing, so you don't really need a GNOME setup to
experience it. It only depends on python, dbus and a tiny bit of gtk
to show a password box. Oh, and libnotify.

I'd actually like to see synce-gnome die and merge into tray icon or a
gnome GUI to synce-kpm.

John
Dr J A Gow
2008-06-05 22:11:52 UTC
Permalink
Post by John Carr
Just sticking my nose in. synce-gnome is tiny tiny tiny. It does
practically nothing, so you don't really need a GNOME setup to
experience it. It only depends on python, dbus and a tiny bit of gtk
to show a password box. Oh, and libnotify.
I'd actually like to see synce-gnome die and merge into tray icon or a
gnome GUI to synce-kpm.
Hmm, interesting! I'll give it a try under kde and see if I can repeat
the problem.

John.

Iain Buchanan
2008-05-30 07:07:03 UTC
Permalink
Hi Iain,
I've got an ebuild for synce-kio-rapip flying around here.
I simply forgot whether I crafted that one myself or just tweaked it for
my needs.
All I remember was adding the 'arts' USE flag to make it build when arts
is not installed (I don't).
Ebuild attached.
thanks, I'll try to have a look at it this weekend. keep bugging me :)

Don't you have commit access?

cya,
--
Iain Buchanan <iaindb at netspace dot net dot au>

Even a hawk is an eagle among crows.
Loading...