LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bodhi (https://www.linuxquestions.org/questions/bodhi-92/)
-   -   swami won't start, shows this error (https://www.linuxquestions.org/questions/bodhi-92/swami-wont-start-shows-this-error-4175665524/)

kozaki 12-06-2019 10:05 AM

swami won't start, shows this error
 
Hi, info for anyone working on the 'swami' (GUI helper for system configuration) package.
Here swami won't start. AFAIK it seems it searches what looks like an application.desktop file from another Linux OS I have installed (Q4OS/Debian). Here's the system specs and the error itself.

- Bodhi linux 5
- kernel 4.9.0-6-686 i686 i686 GNU/Linux
- swami 2.0.0+svn389-5
- moksha 20191004bodhi30.3.1

Code:

$ sudo swami
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.enlightenment.wm.service was not provided by any .service files
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.enlightenment.wm.service was not provided by any .service files
Traceback (most recent call last):
  File "/usr/bin/swami", line 177, in <module>
    app = MainWin(launchArg)
  File "/usr/bin/swami", line 74, in __init__
    self.loadModules()
  File "/usr/bin/swami", line 130, in loadModules
    self.modules[imported] = imported.SwamiModule(self)
  File "/usr/lib/python2.7/dist-packages/swami_startupapps/swami_startupapps.py", line 94, in __init__
    with open(d) as desktopFile:
IOError: [Errno 2] No such file or directory: '/home/USER/.local/share/applications/kcm_lookswitcher_wrapper.desktop'


enigma9o7 12-06-2019 02:43 PM

For fun I tried to replicate, but didn't have the tool you're trying to use, and the one in repos appears to be music related.

Code:

bodhi@VPCF115FM:~$ sudo swami
[sudo] password for bodhi:
sudo: swami: command not found
bodhi@VPCF115FM:~$ apt list swami
Listing... Done
swami/bionic 2.0.0+svn389-5 amd64
bodhi@VPCF115FM:~$ apt show swami
Package: swami
Version: 2.0.0+svn389-5
Priority: optional
Section: universe/sound
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 714 kB
Depends: libswami0 (= 2.0.0+svn389-5), libc6 (>= 2.14), libfftw3-single3 (>= 3.3.5), libfluidsynth1 (>= 1.1.6-4~), libglib2.0-0 (>= 2.37.3), libgnomecanvas2-0 (>= 2.11.1), libgtk2.0-0 (>= 2.12.0), libinstpatch-1.0-0 (>= 1.0.0~)
Recommends: jackd
Breaks: libswami0 (<= 2.0.0+svn389-1~)
Replaces: libswami0 (<= 2.0.0+svn389-1~)
Homepage: http://swami.sf.net
Download-Size: 283 kB
APT-Sources: http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: MIDI instrument editor application
 Swami (Sampled Waveforms And Musical Instruments) is an application
 for editing and managing MIDI instruments, such as SoundFont files.
 A programming API is also provided for integration with other
 applications.


cordx 12-06-2019 06:16 PM

my swami runs just fine (without sudo as well). here's a copy of what i have if you want to compare to yours.

cordx 12-06-2019 06:25 PM

for what it's worth, i get those same two first lines (Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.enlightenment.wm.service was not provided by any .service files x2) when i start mine with sudo.

kozaki 12-07-2019 01:24 PM

Oops, I'll check without sudo ASAP.

cordx 12-08-2019 03:22 AM

1 Attachment(s)
enigma9o7 swami is a control panel application/program in bodhi. i use it to change my keyboard layout and work with startup applications, but it has other uses as well. i get the same output from apt show. i'm not sure what that is about. this is what swami looks like:
Attachment 32057

kozaki 12-08-2019 09:10 AM

Thank you cordx. I have got the exact same code as yours, but still
Code:

:~$ swami
Traceback (most recent call last):
  File "/usr/bin/swami", line 177, in <module>
    app = MainWin(launchArg)
  File "/usr/bin/swami", line 74, in __init__
    self.loadModules()
  File "/usr/bin/swami", line 130, in loadModules
    self.modules[imported] = imported.SwamiModule(self)
  File "/usr/lib/python2.7/dist-packages/swami_startupapps/swami_startupapps.py", line 94, in __init__
    with open(d) as desktopFile:
IOError: [Errno 2] No such file or directory: '/home/USER/.local/share/applications/kcm_lookswitcher_wrapper.desktop'

It says issue starts from this code
Code:

for d in desktopFiles:                                                     
            with open(d) as desktopFile:                                                 
                fileName = d.split("/")[-1]                                       
                icon = None                                                       
                for line in desktopFile:                                           
                    if line[:5] == "Name=":                                       
                        name = line[5:][:-1]                                       
                                                                                   
                    if line[:5] == "Icon=":                                       
                        icon = line[5:].strip()

in /usr/lib/python2.7/dist-packages/swami_startupapps/swami_startupapps.py .
Again, posting this for the dev (I'm a cmd line guy but I test the GUIs to be abble to speak with my relatives :-)

rbtylee 12-08-2019 10:55 AM

Swami should catch that error and continue, but it doesn't. Be easy to fix tho.

But anyways looks like kcm_lookswitcher_wrapper has been added to Moksha's startup but the app has been uninstalled or the desktop file removed and swami can't find it and crashes and burns at that point. To fix your system so swami works simply remove that entry from startup. Look in /.e/e/applications/startup/.order, if not there also look in the file startupcommands also located there.

For the record what version of Bodhi are you using?

kozaki 12-08-2019 04:26 PM

Using Bodhi 5, please see first post for the applis versions. No 'kcm_wrapper_switcher' in $HOME/.e/e/. This is a Q4OS (Debian, see first post) tool, located in ~/.local/share/applications/ and is a broken symlink when seen from non-Q4OS OS. Other OSes are installed on this machine, with *some* shared user config. Maybe we pin pointed what causes the error on my system far enough to make that a super low probability to happen elsewhere?
EDIT:
moving this desktop file away allows swami to launch indeed.
Seems the culprit was me not cleaning the ~/.local/share/applications directory as often as I should :¬\

rbtylee 12-09-2019 06:23 AM

Quote:

Originally Posted by kozaki (Post 6065911)
Using Bodhi 5, please see first post for the applis versions...

Sorry I was busy and merely skimmed the first few posts. Decided to post on the issue when I saw you say Again, posting this for the dev

I am not the developer of swami that would be Jeff, but I am a developer here so ...

From what you have indicated seems you are sharing your home directory (or at least parts of it) with other Linux installs, kinda risky behavior unless you know what you are doing. But anyway nothing wrong with doing that just be aware how stuff from other desktops is going to affect the desktop you are in.

Quote:

Originally Posted by kozaki (Post 6065911)
... Maybe we pin pointed what causes the error on my system far enough to make that a super low probability to happen elsewhere?...

Well the error message, swamis code and your comments above make it clear what has happened. Looking over swamis code there are alot of places where swami could crash and burn on a borked systems. A broken symlink is kinda a borked system to me. Regardless, a program, in theory, should handle 'bad input' gracefully. I am not going to go over swamis code and add error checks everywhere bad input could break it, but I will fix this particular error. It seems high probability enough to warrant a fix.

Therefore I updated swami in our repos and you can fix it by:

Code:

sudo apt update
sudo apt install swami-control

Note the name of the program is swami-control to avoid the name clash with the MIDI instrument editor app noted above.

Quote:

Originally Posted by kozaki (Post 6065911)
...moving this desktop file away allows swami to launch indeed...

Glad you have swami back to working. But you should be able to move the troublesome desktop file back if you do in fact need it. After updating swami as above swami startup apps should ignore it and any other broken symlinks located there. Swami will print a warning as in my test case:

Code:

Warning Startup Apps: Unable to open /home/ylee/.local/share/applications/link1.desktop
Anyway thanks for reporting this error.

Enjoy :)


All times are GMT -5. The time now is 01:57 AM.