Bug 46468 - univention-samba4-backup fails due to tdbbackup errors
univention-samba4-backup fails due to tdbbackup errors
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.3
Other Linux
: P5 normal with 3 votes (vote)
: UCS 4.3-2-errata
Assigned To: Felix Botner
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-02 15:57 CET by Eduard Mai
Modified: 2018-10-10 12:31 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 4: Will affect most installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.320
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eduard Mai univentionstaff 2018-03-02 15:57:45 CET
Running univention-samba4-backup on a UCS DC with Samba 4.7.5 produces following errors:

$ univention-samba4-backup 
tdb_mutex_open_ok[./private/netlogon_creds_cli.tdb]: Can use mutexes only with MUTEX_LOCKING or NOLOCK
Failed to open ./private/netlogon_creds_cli.tdb
Error while backing up ./private/netlogon_creds_cli.tdb with tdbbackup - status 1

Adding -l to the tdbbackup call in univention-samba4-backup makes the error disappear. The manual advises against doing this on databases that could be open in other processes. 

$ man tdbbackup
[...]
       -l
           This options disables any locking, by passing TDB_NOLOCK to tdb_open_ex(). Only use this for database files which are not used by any other process! And also only if it is otherwise not possible
           to open the database, e.g. databases which were created with mutex locking.
[...]
Comment 1 Ingo Steuwer univentionstaff 2018-04-06 12:35:28 CEST
Also seen on UCS 4.3 DC Master since Update from UCS 4.2.
Comment 2 office 2018-06-25 10:17:44 CEST
There is a thread in the help forums regarding this. 
It gives a hint, how to filter this message away ...

https://help.univention.com/t/univention-samba4-backup-error-mutex-locking-or-nolock/8403
Comment 3 Ingo Steuwer univentionstaff 2018-08-27 14:10:06 CEST
change "affected by", seems like this happens in many environments
Comment 4 Ingo Steuwer univentionstaff 2018-08-27 16:15:47 CEST
Set typ to "7 Crash..." as the backup might be broken
Comment 5 Felix Botner univentionstaff 2018-09-18 14:31:44 CEST
univention-samba4: f42094dbde7b52deabbf659b564e9b6a5c89ac36
yaml: 1d14b37c93cc1bfaa49088cb329373e5e7a60907

Easily reproducible by starting a smbclient session

 -> smbclient  //master/Administrator -UAdministrator%univention

and simultaneously running the backup scrpiut

 ->  /usr/sbin/univention-samba4-backup

 tdb_mutex_open_ok[./private/netlogon_creds_cli.tdb]: Can use mutexes only 
 with  MUTEX_LOCKING or NOLOCK
 Failed to open ./private/netlogon_creds_cli.tdb
 Error while backing up ./private/netlogon_creds_cli.tdb with tdbbackup - 
 status 1

This seems to happen for netlogon_creds_cli.tdb only, at least on this bug and https://help.univention.com/t/univention-samba4-backup-error-mutex-locking-or-nolock/8403.

Found https://bugzilla.samba.org/show_bug.cgi?id=13088 with the same problem and the answer is "You don't need to back up that tdb....", so i guess we can ignore the netlogon_creds_cli.tdb.

So univention-samba4-backup now ignores the netlogon_creds_cli.tdb database.
Comment 6 Arvid Requate univentionstaff 2018-10-06 18:46:29 CEST
Ok, but now the script outputs a line per file, which may be annoying since it's called by cron.
Comment 7 Felix Botner univentionstaff 2018-10-08 10:00:20 CEST
(In reply to Arvid Requate from comment #6)
> Ok, but now the script outputs a line per file, which may be annoying since
> it's called by cron.

yeah, that is wrong, removed the line

d705c7dea3beab34e1a578931485d732cebf1c33 - univention-samba4
e2d53cd5fb94fe3beac58a0ce1862f9f61275afb - yaml
Comment 8 Arvid Requate univentionstaff 2018-10-08 16:08:39 CEST
Package update and basic functional test: Ok
Advisory: Ok
Comment 9 Arvid Requate univentionstaff 2018-10-10 12:31:35 CEST
<http://errata.software-univention.de/ucs/4.3/267.html>