Skip to content

Commit

Permalink
Fix bug: BiT does not start with DBus exception NameHasNoOwner, also …
Browse files Browse the repository at this point in the history
…fix Arch Linux build error (#1335)

* Partially resolve bug #921 (BiT CLI side, serviceHelper system D-Bus daemon issues are still under investigation)
* Fix #1233: Arch Linux build test and installation failure
* Fix #1333: Backintime fails to build on Arch
* Add better documentation for installation on Arch using AUR package

Authored-by: aryoda <11374410+aryoda@users.noreply.github.com>
  • Loading branch information
aryoda authored Oct 21, 2022
1 parent d5032ed commit ad4e91c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
22 changes: 15 additions & 7 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@ Back In Time

Upcoming Release
* New feature: Command line argument "--diagnostics" to show helpful info for better issue support (#1100)
* GUI change: remove Exit button from the toolbar (#172)
* GUI change: define accelerator keys for menu bar and tabs, as well as toolbar shortcuts (#1104)
* Desktop integration: update .desktop file to mark Back In Time as a single main window program (#1258)
* GUI change: Remove Exit button from the toolbar (#172)
* GUI change: Define accelerator keys for menu bar and tabs, as well as toolbar shortcuts (#1104)
* Desktop integration: Update .desktop file to mark Back In Time as a single main window program (#1258)
* Bugfix: AttributeError in "Diff Options" dialog (#898)
* Bugfix: Settings GUI: "Save password to Keyring" was disabled due to "no appropriate keyring found" (#1321)
* Bugfix: Back in Time did not start with D-Bus error
"dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner:
Could not get owner of name 'net.launchpad.backintime.serviceHelper': no such name"
(fixes client-side part of #921 - system D-Bus part of the Udev serviceHelper is still under investigation).
* Bugfix: Avoid logging errors while waiting for a target drive to be mounted (#1142, #1143, #1328)
* Bugfix: [Arch Linux] AUR pkg "backintime-git": Build tests fails and installation is aborted (#1233, fixed with #921)
* Bugfix: Wrong systray icon showing in Wayland (#1244)
* Documentation update: correct description of profile<N>.schedule.time in backintime-config manpage (#1270)
* Documentation update: Correct description of profile<N>.schedule.time in backintime-config manpage (#1270)
* Translation update: Brazilian Portuguese (#1267)
* Translation update: Italian (#1110, #1123)
* Translation update: French (#1077)
* Testing: fix a test fail when dealing with an empty crontab (#1181)
* Testing: fix a test fail when dealing with an empty config file (#1305)
* Testing: numerous fixes and extensions to testing (#1115, #1213, #1279, #1280, #1281, #1285, #1288, #1290, #1293, #1309)
* Testing: Fix a test fail when dealing with an empty crontab (#1181)
* Testing: Fix a test fail when dealing with an empty config file (#1305)
* Testing: Skip "test_quiet_mode" (does not work reliably)
* Testing: Improve "test_diagnostics_arg" (introduced with #1100) to no longer fail
when JSON output was mixed with logging output (part of #921, fixes #1233)
* Testing: Numerous fixes and extensions to testing (#1115, #1213, #1279, #1280, #1281, #1285, #1288, #1290, #1293, #1309)

Version 1.3.2 (2022-03-12)
* Fix bug: Tests no longer work with Python 3.10 (https://github.com/bit-team/backintime/issues/1175)
Expand Down
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ repositories.
We provide a PPA (Private Package Archive) with current stable version
(ppa:bit-team/stable) and a testing PPA (ppa:bit-team/testing)

**Important:** Until version 1.3.2 there was a bug that caused
`backintime` failed to start if the package `backintime-qt` was not installed.
As work-around also install `backintime-qt` because the missing
Udev `serviceHelper` system D-Bus daemon is packaged there.

sudo add-apt-repository ppa:bit-team/stable
sudo apt-get update
sudo apt-get install backintime-qt
Expand All @@ -159,16 +164,33 @@ or

##### ArchLinux

Back In Time is available through AUR. You need to import a public key once
before installing
Back In Time is available through the AUR package [`backintime`](https://aur.archlinux.org/packages/backintime)
that also includes the GUI (`backintime-qt`).

**Important:** Until version 1.3.2 there was a bug that prevented the
successful **first-time** installation due to a unit test failure when
building with the PKGBUILD script (see [#1233](https://github.com/bit-team/backintime/issues/1233))
and required to edit the PKGBUILD file for a sucessful installation
(see description in [#921](https://github.com/bit-team/backintime/issues/921#issuecomment-1276888138)).

# You need to import a public key once before installing
gpg --keyserver pgp.mit.edu --recv-keys 615F366D944B4826
# Fingerprint: 3E70 692E E3DB 8BDD A599 1C90 615F 366D 944B 4826

wget https://aur.archlinux.org/cgit/aur.git/snapshot/backintime.tar.gz
tar xvzf backintime.tar.gz
cd backintime
makepkg -srci

An alternative way of installation [clones the AUR package](https://averagelinuxuser.com/install-aur-manually-helpers/) which has the
advantage to use `git pull` instead of downloading `backintime.tar.gz`
to be prepared to build an updated version of the package:

git clone https://aur.archlinux.org/backintime.git
# Optional: Edit PKGBUILD to comment the `make test` line for the first-time installation of version 1.3.2 or less
cd backintime
makepkg -si

### From sources

To build and install from the source code do a `git clone https://github.com/bit-team/backintime.git`
Expand Down
9 changes: 8 additions & 1 deletion common/test/test_backintime.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import re
import subprocess
import sys
import unittest
from test import generic
import json

Expand All @@ -35,6 +36,7 @@ class TestBackInTime(generic.TestCase):
def setUp(self):
super(TestBackInTime, self).setUp()

@unittest.skip("--quiet is broken due to some non-filtered logger output")
def test_quiet_mode(self):
output = subprocess.getoutput("python3 backintime.py --quiet")
self.assertEqual("", output)
Expand Down Expand Up @@ -176,7 +178,12 @@ def test_local_snapshot_is_successful(self):

def test_diagnostics_arg(self):

output = subprocess.getoutput("./backintime --diagnostics")
# "output" from stdout may currently be polluted with logging output
# lines from INFO and DEBUG log output.
# Logging output of WARNING and ERROR is already written to stderr
# so `check_output` does work here (returns only stdout without stderr).
output = subprocess.check_output(["./backintime", "--diagnostics"])
# output = subprocess.getoutput("./backintime --diagnostics")

diagnostics = json.loads(output)
self.assertEqual(diagnostics["backintime"]["name"], config.Config.APP_NAME)
Expand Down
19 changes: 13 additions & 6 deletions common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1886,12 +1886,19 @@ def __init__(self):
conn = bus.get_object(SetupUdev.CONNECTION, SetupUdev.OBJECT)
self.iface = dbus.Interface(conn, SetupUdev.INTERFACE)
except dbus.exceptions.DBusException as e:
if e._dbus_error_name in ('org.freedesktop.DBus.Error.NameHasNoOwner',
'org.freedesktop.DBus.Error.ServiceUnknown',
'org.freedesktop.DBus.Error.FileNotFound'):
conn = None
else:
raise
# Only DBusExceptions are handled to do a "graceful recovery"
# by working without a serviceHelper D-Bus connection...
# All other exceptions are still raised causing BiT
# to stop during startup.
# if e._dbus_error_name in ('org.freedesktop.DBus.Error.NameHasNoOwner',
# 'org.freedesktop.DBus.Error.ServiceUnknown',
# 'org.freedesktop.DBus.Error.FileNotFound'):
logger.warning("Failed to connect to Udev serviceHelper daemon via D-Bus: " + e.get_dbus_name())
logger.warning("D-Bus message: " + e.get_dbus_message())
logger.warning("Udev-based profiles cannot be changed or checked due to Udev serviceHelper connection failure")
conn = None
# else:
# raise
self.isReady = bool(conn)

def addRule(self, cmd, uuid):
Expand Down

0 comments on commit ad4e91c

Please sign in to comment.