Cant package Thonny Snap

Then what is wrong with my Lubuntu 22.04.2, problem with XDG-DATA_DIRS etc. ?? other snap are working flawlessly, is there any system group needed to run snaps i did remove something related to snap/lxd while purging lxd before the backup…

no, groups should not have any impact here …

I dont see anything problematic with snaps since firefox,thunderbird are launching successfully from terminal

Is this something with interface, how do i review a particular snaps interface…

well, perhaps you have set any environment variables manually somewhere that thonny picks up ? i have no idea, all i can say is that your snap is fine as is (there are surely issues further down the road that will need solving later, but it starts just fine)

so am pushing it to beta…

thonny from apt and even from the tar.gz upon which snap is build works fine…

make sure you have neither of these installed when testing though …

that it tries to open /home/sam/.config/Thonny instead of the correct dir in /home/sam/snap/thonny-ide indicates it picks up some wrong config or env variables from somewhere …

Hey there i want to acknowledge you of smothing weird, thonny-ide 's home snap folder is empty unlike of other snaps (/home/sam/snap/thonny-ide/) it contain three folders all are empty and they have no symlinks like other snaps folder…

I can definately say something is wrong at installation part, i.e, how will thonny-ide run when its folders are completely blank by default…

First time i tried it with nala purge thonny but it yielded same results

The folders are usually only populated on first start of the app, when it copies its default configuration in place … your setup seems to take a detour even before thonny populates anything it seems.

$ find snap/thonny-ide/current/
snap/thonny-ide/current/
snap/thonny-ide/current/.config
snap/thonny-ide/current/.config/Thonny
snap/thonny-ide/current/.config/Thonny/frontend_faults.log
snap/thonny-ide/current/.config/Thonny/configuration.ini
snap/thonny-ide/current/.config/Thonny/plugins
snap/thonny-ide/current/.config/Thonny/plugins/lib
snap/thonny-ide/current/.config/Thonny/plugins/lib/python3.10
snap/thonny-ide/current/.config/Thonny/plugins/lib/python3.10/site-packages
snap/thonny-ide/current/.config/Thonny/backend.log
snap/thonny-ide/current/.config/Thonny/frontend.log

here is mine after starting a freshly installed thonny-ide once …

Anything i can do to fix I checked bash profile, deleted thonny config of apt ver after purge, checked env var, nothing fishy everything is fine Is this a common problem with Lubuntu aka lxqt

Not that I have heard of… and I guess we’d have a lot more posts and questions from lubuntu users if that actually was the case.

Try creating a fresh test user and try to run it as that… if it fails then too, something is wrong with global settings… if it works there, it is an issue with the users defaults.

so any fix ??, you can take my sys as vanilla Lubuntu because i just did a backup to my first install ver of Lubuntu of January…

Hey ogra, i tried with a different user but same problem persists

Full log :-

Traceback (most recent call last):
  File "/snap/thonny-ide/9/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/snap/thonny-ide/9/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/snap/thonny-ide/9/lib/python3.10/site-packages/thonny/__main__.py", line 4, in <module>
    launch()
  File "/snap/thonny-ide/9/lib/python3.10/site-packages/thonny/__init__.py", line 234, in launch
    prepare_thonny_user_dir()
  File "/snap/thonny-ide/9/lib/python3.10/site-packages/thonny/__init__.py", line 280, in prepare_thonny_user_dir
    os.makedirs(THONNY_USER_DIR, mode=0o700, exist_ok=True)
  File "/snap/thonny-ide/9/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/sam/.config/Thonny'

The problem seems to be related with runpy.py

well, the problem is with THONNY_USER_DIR … which seems to properly point to SNAP_USER_DATA (or even HOME which normally defaults to SNAP_USER_DATA in snaps) for me on all test machines, but interestingly not for you …

you could try to add an environment: block to your apps: section to force THONNY_USER_DIR to point to SNAP_USER_DATA by default, that should even solve it for you.

also, what does:

$ env | grep THONNY

return on your system ?

hey ogra after intense research i came to the temporary solution, with this the app runs --> /snap/thonny-ide/current/bin/thonny, this needs to be fixed