Overdr0ne / sfs

Search File System for Emacs
GNU General Public License v3.0
25 stars 0 forks source link

dbus-call-method: D-Bus error: "The name com.sfs.SearchService was not provided by any .service files" #1

Open novoid opened 4 years ago

novoid commented 4 years ago

Hi, I wanted to test-run your cool project. I've set up recoll which I'm able to use within the recoll GUI.

I installed the dependencies: sudo pip3 install dbus-python PyGObject

Then I cloned your repo and evaluated everything in sfs-recoll.el. I had to hard-code the path of service.py since load-file-name was empty when using my method of manually evaluating everything. With this workaround, the server started without an error.

Then I did M-x sfs-recoll and I got: dbus-call-method: D-Bus error: "The name com.sfs.SearchService was not provided by any .service files" just like the person who wrote this comment: https://www.reddit.com/r/emacs/comments/hf6bdr/prototype_sfs_search_file_system/fvw0i8m/

The buffer *recoll-server* contains following error:

Traceback (most recent call last):
  File "/home/vk/fromweb/src/sfs/service.py", line 1, in <module>
    from gi.repository import GLib
ImportError: No module named gi.repository

Process recoll-server exited abnormally with code 1

According to https://stackoverflow.com/questions/31151785/error-importing-glib the line seems correct. However, I can confirm that within an interactive python session, I can't import it as well. Is this a missing dependency?

pip3 search GLib returns potential candidates:

asyncio-glib (0.1)                    - GLib event loop integration for asyncio
avocado-framework-plugin-glib (80.0)  - Avocado Plugin for Execution of GLib Test Framework tests
apyref-json-glib (0.1.1)              - Reserve names for currrent development items until release.
gwebsockets (0.7)                     - GLib based websockets server
gshell.py (0.0.4)                     - A straight port of glib/gshell.c to Python
gpotato (0.1)                         - GLib event loop for tulip (PEP 3156)
gbulb (0.6.1)                         - GLib event loop for tulip (PEP 3156)
python-appstream (0.8)                - Parse AppStream files when you don't have libappstream-glib
pypoppler (0.12.2)                    - Python bindings for poppler-glib, unofficial branch including bug fixes, and removal of gtk dependencies
pygel (0.6.5)                         - An implementation of some functionalities of gobject/glib/gio in pure python, but adding a lot of new features.

Thanks for any help!

Overdr0ne commented 4 years ago

Hey, so sorry for not getting back sooner. This is my first issue on github! So I wasn't really paying attention...

Yes, you are missing a dependency, and this is causing the python service to fail to start.

"gi" stands for GObject Introspection. You can pick up that dependency from the "PyGObject" package in pip.

I've added that to the installation section, but I really do need some kind of automated packaging solution here. I'll wait to close this until I come up with something. Thank you for trying this out!

novoid commented 4 years ago

Hey, so sorry for not getting back sooner. This is my first issue on github! So I wasn't really paying attention...

;-)

Congrats!

"gi" stands for GObject Introspection. You can pick up that dependency from the "PyGObject" package in pip.

I found the source of my error.

Following lines had to be modified by myself in order to make it run:

(start-process
 "recoll-server"
 "*recoll-server*"
; "python" ;; ORIGINAL line
 "python3"
; (concat (file-name-directory load-file-name) "service.py") ;; ORIGINAL line
 (concat "/home/vk/fromweb/src/sfs/" "service.py")
 )
  1. The file-name-directory load-file-name did not work at my side since it was nil. I had to hard-code my path to the service.py file.
  2. PyGObject was installed with my python3 whereas your script was calling python which still links to python2 at my machine.

Maybe you can think of a general fix for that.

Please close this issue whenever you think it's appropriate.