Menu

#662 afpstats fails with dbus exception "Could not get owner of name 'org.netatalk.AFPStats'"

None
wont-fix
nobody
None
1
2023-09-15
2020-09-25
Kay Wrobel
No

I am running Debian 10 on a virtual machine which acts as a file server for our company. We recently installed netatalk on it (version 3.1.12 as currently available in Debian repo). Our users are very happy with the performance they now receive via afp vs previous smb shares (especially when over VPN connections).

We would now like to get some status information of who is connected and what files are open, similar to smbstatus. But when I run afpstats, I get the following error message:

# afpstats
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.netatalk.AFPStats': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/afpstats", line 16, in main
    "/org/netatalk/AFPStats")
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.netatalk.AFPStats was not provided by any .service files

This was run a root. I tried this on a separate newly install VM with Debian 10 as well, and I get the same error.

Discussion

  • Daniel Markstedt

    Note: Any user can run afpstats.

    I also saw this exact error when I hadn't configured dbus correctly. The first hurdle was that on Debian, dbus sysconf lives in /etc while netatalk sysconf is /usr/local/etc by default. Use --with-dbus-sysconf-dir=/etc with configure to make sure netatalk install puts the requisite dbus config files int he right place.

    The second hurdle is to make sure afpstats is enabled in the first place. Add "afpstats = yes" to [Global] in afp.conf.

    On Debian you may need to install the python3-dbus package as well.

     
  • Daniel Markstedt

    • status: open --> wont-fix
    • Group: -->
     
  • Kay Wrobel

    Kay Wrobel - 2023-09-15

    Quick update: I had not seen this the first time, and now I feel like a fool.
    I added afpstats = yes to the afp.conf file and restarted the service. afpstats gives no more error messages.
    Sorry for wasting your time.

     

Log in to post a comment.