[Sugar-devel] "Permission denied" error in ReckonPrimer Activity

Christoph Derndorfer christoph.derndorfer at gmail.com
Wed Apr 27 19:23:50 EDT 2011


Hi all,

I'm running into an odd issue with the ReckonPrimer Activity some Austrian
students have developed for our pilot project.

Starting the activity works fine on just about every software version I've
tried but unfortunately fails on build 767 which is the one being used in
the school at the moment (yes, I'm well aware that's quite outdated hence
why I'm looking forward to 11.2.0 and its German support;-).

In the log it says "IOError: [Errno 13] Permission denied:
'/home/olpc/Activities/ReckonPrimer.activity/data/Collection.data'" (for the
complete log please see the end of this e-mail) whereby the offending
function is in collection.py (.xo file available at
http://derndorfer.eu/files/permanent/ReckonPrimer-7.xo):

    def set_data_in_pickle(self, root):
        """ Sets data in pickle file """
        path = os.path.join(os.getcwd(), "data/Collection.data")
        f = open(path, "wb")
        pickle.dump(root, f)
        f.close()

I really don't understand why this causes issues in 767 but none of the
other (newer) software versions and I'd appreciate any pointers, thoughts or
advice here. :-)

Thanks,
Christoph

--- log ---

reserved credentials (10002, 10003)
adding group: /usr/sbin/groupadd -o -g 10003 10003
groupadd: group 10003 exists
adding user: /usr/sbin/useradd -m -u 10002 -g 10003 -c
org.laptop.ReckonPrimerActivity.10002 -d
/home/olpc/isolation/1/uid_to_home_dir/10002 10002
dropping privilege to (10002, 10003)
chdir to /home/olpc/Activities/ReckonPrimer.activity
umask(0)
about to execve
argv: dbus.Array([dbus.UTF8String('sugar-activity'),
dbus.UTF8String('reckonprimeractivity.ReckonPrimerActivity'),
dbus.UTF8String('-b'), dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
dbus.UTF8String('-a'),
dbus.UTF8String('e87afe169311ef8a646ed22d22b3ef7781aeeed1')],
signature=dbus.Signature('s'))
env: dbus.Dictionary({dbus.UTF8String('LOGNAME'): dbus.UTF8String('olpc'),
'USER': '10002', dbus.UTF8String('HOME'):
'/home/olpc/isolation/1/uid_to_home_dir/10002', dbus.UTF8String('PATH'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/bin:/usr/share/sugar/activities/Journal.activity/bin:/usr/bin:/bin'),
dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'), dbus.UTF8String('LANG'):
dbus.UTF8String('en_US.UTF-8'), dbus.UTF8String('SHELL'):
dbus.UTF8String('/bin/bash'), dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
dbus.UTF8String('XDG_SESSION_COOKIE'):
dbus.UTF8String('32b86eabf9f0f1c7f62b5e224da37272-1303944446.109383-65640594'),
dbus.UTF8String('SESSION_MANAGER'):
dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1239,unix/unix:/tmp/.ICE-unix/1239'),
dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
dbus.UTF8String('ICEAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
dbus.UTF8String('SUGAR_BUNDLE_NAME'): dbus.UTF8String('Journal'),
dbus.UTF8String('SUGAR_BUNDLE_PATH'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
dbus.UTF8String('SUGAR_LOCALEDIR'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/locale'),
dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
'/home/olpc/isolation/1/uid_to_home_dir/10002',
dbus.UTF8String('GTK2_RC_FILES'):
dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
dbus.UTF8String('SUGAR_BUNDLE_ID'):
dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=9a03f600feaf4414f793f3354db89cfe'),
'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
dbus.UTF8String('XAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
dbus.UTF8String('GTK_IM_MODULE'): dbus.UTF8String('gtk-im-context-simple'),
dbus.UTF8String('XSERVERAUTH'):
dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'), dbus.UTF8String('PWD'):
dbus.UTF8String('/home/olpc'), dbus.UTF8String('SUGAR_BUNDLE_VERSION'):
dbus.UTF8String('99')}, signature=dbus.Signature('ss'))
closing all fds but (1, 2)
{dbus.UTF8String('LOGNAME'): dbus.UTF8String('olpc'), 'USER': '10002',
'PATH':
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/bin:/usr/share/sugar/activities/Journal.activity/bin:/usr/bin:/bin'),
dbus.UTF8String('HOME'): '/home/olpc/isolation/1/uid_to_home_dir/10002',
'DISPLAY': dbus.UTF8String(':0'), 'LANG': dbus.UTF8String('en_US.UTF-8'),
'TERM': 'linux', dbus.UTF8String('SHELL'): dbus.UTF8String('/bin/bash'),
dbus.UTF8String('TZ'): dbus.UTF8String('UTC'), 'XAUTHORITY':
'/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
dbus.UTF8String('SESSION_MANAGER'):
dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1239,unix/unix:/tmp/.ICE-unix/1239'),
dbus.UTF8String('SHLVL'): dbus.UTF8String('1'), 'ICEAUTHORITY':
'/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
dbus.UTF8String('SUGAR_BUNDLE_NAME'): dbus.UTF8String('Journal'),
dbus.UTF8String('SUGAR_BUNDLE_PATH'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
dbus.UTF8String('SUGAR_LOCALEDIR'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/locale'),
dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'), 'UPSTART_JOB':
'rainbow', 'UPSTART_JOB_ID': '3', dbus.UTF8String('SUGAR_BUNDLE_ID'):
dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
'DBUS_SESSION_BUS_ADDRESS':
dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=9a03f600feaf4414f793f3354db89cfe'),
'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
dbus.UTF8String('XDG_SESSION_COOKIE'):
dbus.UTF8String('32b86eabf9f0f1c7f62b5e224da37272-1303944446.109383-65640594'),
dbus.UTF8String('GTK_IM_MODULE'): dbus.UTF8String('gtk-im-context-simple'),
dbus.UTF8String('XSERVERAUTH'):
dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'),
dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
'/home/olpc/isolation/1/uid_to_home_dir/10002', dbus.UTF8String('PWD'):
dbus.UTF8String('/home/olpc'), dbus.UTF8String('SUGAR_BUNDLE_VERSION'):
dbus.UTF8String('99'), 'UPSTART_EVENT': 'started', 'GTK2_RC_FILES':
dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc')}
1303944657.208344 WARNING root: Activity directory lacks a MANIFEST file.
/usr/lib/python2.5/site-packages/sugar/graphics/combobox.py:93:
PangoWarning: error opening config file '/root/.pangorc': Permission denied

  self._model.append([action_id, text, pixbuf, False])
1303944663.328591 WARNING root: No gtk.AccelGroup in the top level window.
1303944663.368552 WARNING root: No gtk.AccelGroup in the top level window.
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)

/usr/lib/python2.5/site-packages/rainbow/service.py in
CreateActivity(self=<rainbow.service.Rainbow at / at 0xb744c96c>,
log_path=dbus.UTF8String('/home/olpc/.sugar/default/logs/org.laptop.ReckonPrimerActivity-1.log'),
env=dbus.Dictionary({dbus.UTF8String('LOGNAME'): dbu...TF8String('99')},
signature=dbus.Signature('ss')),
argv=dbus.Array([dbus.UTF8String('sugar-activity'), d...b3ef7781aeeed1')],
signature=dbus.Signature('s')),
bundle_path=dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
bundle_id=dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
success_cont=<function <lambda> at 0xb611109c>, error_cont=<function
<lambda> at 0xb6111144>)
    130                     os.dup2(log_fd, 2)
    131                     ret = inject.run(log, SPOOL, env, argv,
env['SUGAR_BUNDLE_PATH'], pset, (1, 2),
--> 132                             env.get('RAINBOW_STRACE_LOG'), 500, 500,
bundle_path, bundle_id, self.preloader_hint)
        env.get = <built-in method get of dbus.Dictionary object at
0xb739b1dc>
        bundle_path =
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity')
        bundle_id = dbus.UTF8String('org.laptop.ReckonPrimerActivity')
        self.preloader_hint = True
    133                 except Exception, e:
    134                     util.trace()

/usr/lib/python2.5/site-packages/rainbow/inject.py in run(log=<function log
at 0xb744f3e4>, spool='/home/olpc/isolation/1',
env=dbus.Dictionary({dbus.UTF8String('LOGNAME'): dbu...TF8String('99')},
signature=dbus.Signature('ss')),
argv=dbus.Array([dbus.UTF8String('sugar-activity'), d...b3ef7781aeeed1')],
signature=dbus.Signature('s')),
cwd=dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
pset=<rainbow.permissions.permlist.PermissionSet object at 0xb611054c>,
safe_fds=(1, 2), strace_hint=None, owner_uid=500, owner_gid=500,
bundle_path=dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
bundle_id=dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
preloader_hint=True)
    353     check_bundle_path(uid, gid, bundle_path)
    354
--> 355     launch(log, home, uid, gid, argv, env, cwd, pset, safe_fds,
strace_hint, preloader_hint)
        global launch = <function launch at 0xb7653924>
        log = <function log at 0xb744f3e4>
        home = '/home/olpc/isolation/1/uid_to_home_dir/10002'
        uid = 10002
        gid = 10003
        argv = dbus.Array([dbus.UTF8String('sugar-activity'),
dbus.UTF8String('reckonprimeractivity.ReckonPrimerActivity'),
dbus.UTF8String('-b'), dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
dbus.UTF8String('-a'),
dbus.UTF8String('e87afe169311ef8a646ed22d22b3ef7781aeeed1')],
signature=dbus.Signature('s'))
        env = dbus.Dictionary({dbus.UTF8String('LOGNAME'):
dbus.UTF8String('olpc'), 'USER': '10002', dbus.UTF8String('HOME'):
'/home/olpc/isolation/1/uid_to_home_dir/10002', dbus.UTF8String('PATH'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/bin:/usr/share/sugar/activities/Journal.activity/bin:/usr/bin:/bin'),
dbus.UTF8String('DISPLAY'): dbus.UTF8String(':0'), dbus.UTF8String('LANG'):
dbus.UTF8String('en_US.UTF-8'), dbus.UTF8String('SHELL'):
dbus.UTF8String('/bin/bash'), dbus.UTF8String('TZ'): dbus.UTF8String('UTC'),
dbus.UTF8String('XDG_SESSION_COOKIE'):
dbus.UTF8String('32b86eabf9f0f1c7f62b5e224da37272-1303944446.109383-65640594'),
dbus.UTF8String('SESSION_MANAGER'):
dbus.UTF8String('local/unix:@/tmp/.ICE-unix/1239,unix/unix:/tmp/.ICE-unix/1239'),
dbus.UTF8String('SHLVL'): dbus.UTF8String('1'),
dbus.UTF8String('ICEAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.ICEauthority',
dbus.UTF8String('WINDOWPATH'): dbus.UTF8String('3'),
dbus.UTF8String('SUGAR_BUNDLE_NAME'): dbus.UTF8String('Journal'),
dbus.UTF8String('SUGAR_BUNDLE_PATH'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
dbus.UTF8String('SUGAR_LOCALEDIR'):
dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity/locale'),
dbus.UTF8String('SUGAR_THEME'): dbus.UTF8String('sugar-xo'),
dbus.UTF8String('SUGAR_ACTIVITY_ROOT'):
'/home/olpc/isolation/1/uid_to_home_dir/10002',
dbus.UTF8String('GTK2_RC_FILES'):
dbus.UTF8String('/usr/share/sugar/data/sugar-xo.gtkrc'),
dbus.UTF8String('SUGAR_BUNDLE_ID'):
dbus.UTF8String('org.laptop.ReckonPrimerActivity'),
dbus.UTF8String('DBUS_SESSION_BUS_ADDRESS'):
dbus.UTF8String('unix:path=/tmp/olpc-session-bus,guid=9a03f600feaf4414f793f3354db89cfe'),
'TMPDIR': '/home/olpc/isolation/1/uid_to_home_dir/10002/tmp',
dbus.UTF8String('XAUTHORITY'):
'/home/olpc/isolation/1/uid_to_home_dir/10002/.Xauthority',
dbus.UTF8String('GTK_IM_MODULE'): dbus.UTF8String('gtk-im-context-simple'),
dbus.UTF8String('XSERVERAUTH'):
dbus.UTF8String('/var/tmp/olpc-auth/.Xserverauth'), dbus.UTF8String('PWD'):
dbus.UTF8String('/home/olpc'), dbus.UTF8String('SUGAR_BUNDLE_VERSION'):
dbus.UTF8String('99')}, signature=dbus.Signature('ss'))
        cwd = dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity')
        pset = <rainbow.permissions.permlist.PermissionSet object at
0xb611054c>
        safe_fds = (1, 2)
        strace_hint = None
        preloader_hint = True
    356
    357

/usr/lib/python2.5/site-packages/rainbow/inject.py in launch(log=<function
log at 0xb744f3e4>, home='/home/olpc/isolation/1/uid_to_home_dir/10002',
uid=10002, gid=10003, argv=dbus.Array([dbus.UTF8String('sugar-activity'),
d...b3ef7781aeeed1')], signature=dbus.Signature('s')),
env=dbus.Dictionary({dbus.UTF8String('LOGNAME'): dbu...TF8String('99')},
signature=dbus.Signature('ss')),
cwd=dbus.UTF8String('/home/olpc/Activities/ReckonPrimer.activity'),
pset=<rainbow.permissions.permlist.PermissionSet object at 0xb611054c>,
safe_fds=(1, 2), strace_hint=None, preloader_hint=True)
    291
    292         from sugar.activity import main
--> 293         main.main()
        main.main = <function main at 0xb61114fc>
    294     else:
    295         os.execvpe(argv[0], argv, env)

/usr/lib/python2.5/site-packages/sugar/activity/main.py in main()
    136         module.start()
    137
--> 138     create_activity_instance(activity_constructor, activity_handle)
        global create_activity_instance = <function create_activity_instance
at 0xb6111454>
        activity_constructor = <class
'reckonprimeractivity.ReckonPrimerActivity'>
        activity_handle = <sugar.activity.activityhandle.ActivityHandle
object at 0xb611f1cc>
    139
    140     gtk.main()

/usr/lib/python2.5/site-packages/sugar/activity/main.py in
create_activity_instance(constructor=<class
'reckonprimeractivity.ReckonPrimerActivity'>,
handle=<sugar.activity.activityhandle.ActivityHandle object at 0xb611f1cc>)
     31
     32 def create_activity_instance(constructor, handle):
---> 33     activity = constructor(handle)
        activity = undefined
        constructor = <class 'reckonprimeractivity.ReckonPrimerActivity'>
        handle = <sugar.activity.activityhandle.ActivityHandle object at
0xb611f1cc>
     34     activity.show()
     35

/home/olpc/Activities/ReckonPrimer.activity/reckonprimeractivity.py in
__init__(self=<ReckonPrimerActivity object at 0xb611e054 (SugarActivity at
0x9dcd038)>, handle=<sugar.activity.activityhandle.ActivityHandle object at
0xb611f1cc>)
     46         journal_object.destroy()
     47
---> 48         self.run_session()
        self.run_session = <bound method ReckonPrimerActivity.run_session of
<ReckonPrimerActivity object at 0xb611e054 (SugarActivity at 0x9dcd038)>>
     49
     50

/home/olpc/Activities/ReckonPrimer.activity/reckonprimeractivity.py in
run_session(self=<ReckonPrimerActivity object at 0xb611e054 (SugarActivity
at 0x9dcd038)>)
     50
     51     def run_session(self):
---> 52         session = Session("xo-user-name", self)
        session = undefined
        global Session = <class session.Session at 0xb612568c>
        self = <ReckonPrimerActivity object at 0xb611e054 (SugarActivity at
0x9dcd038)>
     53         session.setMode("Learner")
     54         session.run()

/home/olpc/Activities/ReckonPrimer.activity/session.py in
__init__(self=<session.Session instance at 0xb61343cc>, name='xo-user-name',
window=<ReckonPrimerActivity object at 0xb611e054 (SugarActivity at
0x9dcd038)>)
     20         self._learner = Learner(self._dis, self._co)
     21         self._author = Author()
---> 22         self._exstore = ExStore(self._dis, self._co)
        self._exstore = undefined
        global ExStore = <class exstore.ExStore at 0xb612559c>
        self._dis = <display.Display instance at 0xb613436c>
        self._co = <coach.Coach instance at 0xb613428c>
     23         #self._co.create_exercises() #TODO.WN091101 replace by
storing Exerc.s
     24         self._calcs = None #pop !

/home/olpc/Activities/ReckonPrimer.activity/exstore.py in
__init__(self=<exstore.ExStore instance at 0xb613438c>,
display=<display.Display instance at 0xb613436c>, coach=<coach.Coach
instance at 0xb613428c>)
    404
    405         # comment to save changes (order of the items) till the next
start
--> 406         self._root.set_data_in_pickle(self._root)
        self._root.set_data_in_pickle = <bound method
Collection.set_data_in_pickle of <collection.Collection instance at
0xb613ad8c>>
        self._root = <collection.Collection instance at 0xb613ad8c>
    407
    408         #Provisorium für impl. "treeView-Kollektion"
^^^^^^^^^^^^^^^^^^^^

/home/olpc/Activities/ReckonPrimer.activity/collection.py in
set_data_in_pickle(self=<collection.Collection instance at 0xb613ad8c>,
root=<collection.Collection instance at 0xb613ad8c>)
    148         """ Sets data in pickle file """
    149         path = os.path.join(os.getcwd(), "data/Collection.data")
--> 150         f = open(path, "wb")
        f = undefined
        global open = undefined
        path =
'/home/olpc/Activities/ReckonPrimer.activity/data/Collection.data'
    151         pickle.dump(root, f)
    152         f.close()

IOError: [Errno 13] Permission denied:
'/home/olpc/Activities/ReckonPrimer.activity/data/Collection.data'

-- 
Christoph Derndorfer
co-editor, olpcnews
url: www.olpcnews.com
e-mail: christoph at olpcnews.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110428/23cbd35a/attachment-0001.html>


More information about the Sugar-devel mailing list