Bug 55958 - univention-translog check --fix throws "self.needs_fill" AssertionError traceback in certain cases
univention-translog check --fix throws "self.needs_fill" AssertionError trace...
Status: NEW
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-12 13:49 CEST by Arvid Requate
Modified: 2023-04-12 15:49 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few 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.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2023-04-12 13:49:30 CEST
A user reported this traceback in univention-translog check --fix:

https://help.univention.com/t/solved-listener-error-notifier-wait-id-result-ldap-failed-no-such-object/21341

I was able to reproduce it by appending this to a transaction file:

=============================================================================
root@primary20:~# cp /var/lib/univention-ldap/notify/transaction /var/lib/univention-ldap/notify/transaction.orig

root@primary20:~# eval "$(ucr shell ldap/base)"; last_id=$(</var/lib/univention-ldap/last_id); echo -e "$((last_id + 2)) zoneName=xxx.intra,cn=dns,$ldap_base m\n\x00\x00\x00$((last_id + 4)) zoneName=xxx.intra,cn=dns,$ldap_base m" >> /var/lib/univention-ldap/notify/transaction

root@primary20:~# /usr/share/univention-directory-notifier/univention-translog \
                                                                  check  --fix
2023-04-12 13:43:17,229:ERROR:/var/lib/univention-ldap/notify/transaction:1967:'1968 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m\n': Hole after '1966 cn=backup21,cn=dc,cn=computers,dc=ucs50domain,dc=net m'
2023-04-12 13:43:17,229:ERROR:/var/lib/univention-ldap/notify/transaction:1968:'\x00\x00\x001970 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m\n': Binary zeros
2023-04-12 13:43:17,230:ERROR:/var/lib/univention-ldap/notify/transaction:1968:'\x00\x00\x001970 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m\n': Hole after '1968 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m'

/var/lib/univention-ldap/notify/transaction needs fixing:
- missing transactions in sequence
2023-04-12 13:43:17,244:ERROR:/var/lib/univention-ldap/notify/transaction:1969:'\x00\x00\x001970 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m\n': Binary zeros
2023-04-12 13:43:17,244:ERROR:/var/lib/univention-ldap/notify/transaction:1969:'\x00\x00\x001970 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m\n': Hole after '1968 zoneName=xxx.intra,cn=dns,dc=ucs50domain,dc=net m'
Traceback (most recent call last):
  File "/usr/share/univention-directory-notifier/univention-translog", line 1443, in <module>
    exit(main())
  File "/usr/share/univention-directory-notifier/univention-translog", line 417, in main
    return opt.func(opt) or 0
  File "/usr/share/univention-directory-notifier/univention-translog", line 696, in check
    translog.run()
  File "/usr/share/univention-directory-notifier/univention-translog", line 860, in run
    self.fixit()
  File "/usr/share/univention-directory-notifier/univention-translog", line 1119, in fixit
    self.fix_fill()
  File "/usr/share/univention-directory-notifier/univention-translog", line 1037, in fix_fill
    assert not self.needs_fill
AssertionError
=============================================================================

Apparently that happens if there is a "hole" in the index in addition to binary zeros.