Bug 53711 - "WARNING: The "blocking locks" option is deprecated" caused by shares created in UCS4.4
"WARNING: The "blocking locks" option is deprecated" caused by shares created...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Felix Botner
Florian Best
:
Depends on: 53782
Blocks: 53785
  Show dependency treegraph
 
Reported: 2021-08-27 13:16 CEST by Julia Bremer
Modified: 2022-03-23 10:15 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.017
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julia Bremer univentionstaff 2021-08-27 13:16:57 CEST
We removed the deprecated option "blocking locks" with #49898. 
After an update, this produces the following warning on each univention-s4search 
(or any other ldbadd, ldbsearch etc.)

"WARNING: The "blocking locks" option is deprecated"

This has no functional implications, but it lead some of our tests to fail and it might unsettle some costumers.
Comment 1 Florian Best univentionstaff 2021-08-30 12:37:03 CEST
We should remove sambaBlockingLocks from UDM shares/share:

management/univention-directory-manager-modules/modules/univention/admin/handlers/shares/share.py:mapping.register('sambaBlockingLocks', 'univentionShareSambaBlockingLocks', None, univention.admin.mapping.ListToString)
management/univention-directory-manager-modules/modules/univention/admin/handlers/shares/share.py:      'sambaBlockingLocks': univention.admin.property(
management/univention-directory-manager-modules/modules/univention/admin/handlers/shares/share.py:              ['sambaLocking', 'sambaBlockingLocks'],
management/univention-directory-manager-modules/modules/univention/admin/handlers/shares/share.py:mapping.register('sambaBlockingLocks', 'univentionShareSambaBlockingLocks', None, univention.admin.mapping.ListToString)

We should remove the evaluation in the listener:
services/univention-samba/samba-shares.py:                              ('univentionShareSambaBlockingLocks', 'blocking locks'),
services/univention-samba4/samba-shares.py:                             ('univentionShareSambaBlockingLocks', 'blocking locks'),

Also all references in:
test/ucs-test-tools/usr/share/ucs-test-tools/customer5000.ldif

Adjust the test cases:
test/ucs-test/tests/53_samba-common/61_share_hacking:                   'univentionShareSambaBlockingLocks': ['1'],
test/ucs-test/tests/64_udm-shares/01_create_fileshare:                          'univentionShareSambaBlockingLocks': [properties['sambaBlockingLocks']],
test/ucs-test/tests/64_udm-shares/02_create_fileshare_and_connect_via_samba:                            'univentionShareSambaBlockingLocks': [properties['sambaBlockingLocks']],
test/ucs-test/tests/53_samba-common/10samba-share-options:sambaBlockingLocks/blocking locks/1
test/ucs-test/tests/64_udm-shares/01_create_fileshare:                  'sambaBlockingLocks': random.choice(['0', '1']),
test/ucs-test/tests/64_udm-shares/01_create_fileshare:                          'univentionShareSambaBlockingLocks': [properties['sambaBlockingLocks']],
test/ucs-test/tests/64_udm-shares/02_create_fileshare_and_connect_via_samba:                    'sambaBlockingLocks': random.choice(['0', '1']),
test/ucs-test/tests/64_udm-shares/02_create_fileshare_and_connect_via_samba:                            'univentionShareSambaBlockingLocks': [properties['sambaBlockingLocks']],
Comment 2 Florian Best univentionstaff 2021-08-30 13:36:47 CEST
After removing this from the listener modules we should add a condition into the joinscript, which checks if there are shares with that option set and if yes, trigger a listener-resync of the listener module.
Comment 4 Arvid Requate univentionstaff 2021-08-30 14:17:11 CEST
Re: Comment 1:

> We should remove the evaluation in the listener:
> services/univention-samba/samba-shares.py:                              ('univentionShareSambaBlockingLocks', 'blocking locks'),
> services/univention-samba4/samba-shares.py:                             ('univentionShareSambaBlockingLocks', 'blocking locks'),

That's been done already in UCS 5, see https://git.knut.univention.de/univention/ucs/-/commit/1be1a7061d
Comment 5 Florian Best univentionstaff 2021-09-02 18:03:42 CEST
A simple "/usr/sbin/univention-directory-listener-ctrl resync samba-shares" after the upgrade to UCS 5.0 is enough to fix the problem.
Comment 6 Florian Best univentionstaff 2021-09-02 18:05:04 CEST
The listener.log contains:

02.09.21 08:08:33.245  LISTENER    ( ERROR   ) : could not set nt acl for dir /home/testou3565/groups/testou3565-v556ga (lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
lpcfg_do_service_parameter: WARNING: The "blocking locks" option is deprecated
)
Comment 7 Florian Best univentionstaff 2021-09-02 18:05:34 CEST
# grep 'blocking locks' /var/log/univention/listener.log | wc -l
3533
Comment 8 Felix Botner univentionstaff 2021-09-07 09:55:00 CEST
cba992486e16af37d2d6770264d17df8b2889e15 - univention-updater
* resync samba-shares too 

did not re-build the packages, i guess it is not necessary if we only want to change the postup for 5.0-0

copied to /mnt/build-storage/buildsystem/mirror/testing/dists/ucs500
-> updates-test.knut.univentio.de

and signed with
repo-ng-sign-release-file -i postup.sh.new -o postup.sh.new.gpg -k 8321745BB32A82C75BBD4BC2D293E501A055F562 -p /etc/archive-keys/ucs5.0.txt

QA
ucr set repository/online/server='updates-test.knut.univention.de'
please re-open after QA for the final release of the file
Comment 9 Florian Best univentionstaff 2021-09-07 11:31:47 CEST
OK: updater.log:
Custom postupdate script /var/lib/local-postup.sh not found
Object modified: cn=master206,cn=dc,cn=computers,dc=autotest206,dc=local
running univention-directory-listener-ctrl resync udm_extension ldap_extension samba-shares
listener shutdown done
univention-run-join-scripts: runs all join scripts existing on local computer.

OK: rgrep 'blocking' /etc/samba/

~FAIL?!: listener.log:
07.09.21 10:38:56.665  LISTENER    ( WARN    ) : initializing module samba-shares
Multifile: /etc/samba/smb.conf
Multifile: /etc/samba/smb.conf
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in handler
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in <listcomp>
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/python3.7/re.py", line 223, in findall
    return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
07.09.21 10:38:59.994  LISTENER    ( WARN    ) : handler: samba-shares (failed)
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in handler
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in <listcomp>
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/python3.7/re.py", line 223, in findall
    return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
07.09.21 10:39:00.615  LISTENER    ( WARN    ) : handler: samba-shares (failed)
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in handler
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/univention-directory-listener/system/samba-shares.py", line 293, in <listcomp>
    new_aces = set(sum([re.findall(re_ace, acl) for acl in new['univentionShareSambaBaseDirAppendACL']], []))
  File "/usr/lib/python3.7/re.py", line 223, in findall
    return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
07.09.21 10:39:01.301  LISTENER    ( WARN    ) : handler: samba-shares (failed)
07.09.21 10:39:01.305  LISTENER    ( WARN    ) : finished initializing module samba-shares with rv=0
Comment 10 Florian Best univentionstaff 2021-09-07 11:36:18 CEST
This is Bug #53458 - let's just put univention-samba4 also into the UCS@school repo.
Comment 11 Florian Best univentionstaff 2021-09-07 15:44:29 CEST
TODO:

sed -i '/univentionShareSambaBlockingLocks/d' test/ucs-test-tools/usr/share/ucs-test-tools/customer5000.ldif

I think we can for now leave the UDM modules as they are, and open a new bug to remove the properties (along with others) when 4.4 is out of maintenance.
Comment 12 Felix Botner univentionstaff 2021-09-08 10:21:37 CEST
(In reply to Florian Best from comment #9)
 
> ~FAIL?!: listener.log:
> 07.09.21 10:38:56.665  LISTENER    ( WARN    ) : initializing module
> samba-shares
> Multifile: /etc/samba/smb.conf
> Multifile: /etc/samba/smb.conf
> Traceback (most recent call last):
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in handler
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in <listcomp>
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/python3.7/re.py", line 223, in findall
>     return _compile(pattern, flags).findall(string)
> TypeError: cannot use a string pattern on a bytes-like object
> 07.09.21 10:38:59.994  LISTENER    ( WARN    ) : handler: samba-shares
> (failed)
> Traceback (most recent call last):
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in handler
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in <listcomp>
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/python3.7/re.py", line 223, in findall
>     return _compile(pattern, flags).findall(string)
> TypeError: cannot use a string pattern on a bytes-like object
> 07.09.21 10:39:00.615  LISTENER    ( WARN    ) : handler: samba-shares
> (failed)
> Traceback (most recent call last):
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in handler
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/univention-directory-listener/system/samba-shares.py", line
> 293, in <listcomp>
>     new_aces = set(sum([re.findall(re_ace, acl) for acl in
> new['univentionShareSambaBaseDirAppendACL']], []))
>   File "/usr/lib/python3.7/re.py", line 223, in findall
>     return _compile(pattern, flags).findall(string)
> TypeError: cannot use a string pattern on a bytes-like object
> 07.09.21 10:39:01.301  LISTENER    ( WARN    ) : handler: samba-shares
> (failed)
> 07.09.21 10:39:01.305  LISTENER    ( WARN    ) : finished initializing
> module samba-shares with rv=0

univention-samba4=9.0.6-1A~5.0.0.202104151055 in ucs_5.0-0 is broken, resync only works with 

  Versionstabelle:
     9.0.6-3A~5.0.0.202106221159 500
        500 http://updates-test.software-univention.de/5.0/maintained/component 5.0-0-errata-test/amd64/ Packages
        500 https://appcenter-test.software-univention.de/univention-repository/5.0/maintained/component ucsschool_20201208103021/amd64/ Packages
  Versionstabelle:
     9.0.6-3A~5.0.0.202106221159 500
        500 http://updates-test.software-univention.de/5.0/maintained/component 5.0-0-errata-test/amd64/ Packages
        500 https://appcenter-test.software-univention.de/univention-repository/5.0/maintained/component ucsschool_20201208103021/amd64/ Packages

which is installed after the update (and the postup call)

so i think we have to remove that samba-shares resync, or restrict the resync to school and somehow install version 9.0.6-3A~5.0.0.202106221159 during the update
Comment 13 Florian Best univentionstaff 2021-09-08 10:36:22 CEST
Yes, that's what I wrote in comment 10.
I pushed 9.0.6-3A~5.0.0.202106221159 into the test-appcenter UCS@school app. Shouldn't this be enough that it is installed exactly during the UCS 5.0 upgrade?
The traceback only happens with `univentionShareSambaBaseDirAppendACL` set, which is only used in UCS@school. So I think we can go with the current state.
Comment 14 Felix Botner univentionstaff 2021-09-08 13:52:21 CEST
(In reply to Florian Best from comment #13)
> Yes, that's what I wrote in comment 10.
> I pushed 9.0.6-3A~5.0.0.202106221159 into the test-appcenter UCS@school app.
> Shouldn't this be enough that it is installed exactly during the UCS 5.0
> upgrade?
> The traceback only happens with `univentionShareSambaBaseDirAppendACL` set,
> which is only used in UCS@school. So I think we can go with the current
> state.

for the 5.0-0 update we set 

[ -f /etc/apt/preferences.d/99ucs500.pref ] ||
cat >/etc/apt/preferences.d/99ucs500.pref <<__PREF__
Package: *
Pin: release l=Univention Corporate Server, v=5.0.0
Pin-Priority: 1001
__PREF__
[ -f /etc/apt/apt.conf.d/99ucs500 ] ||
	echo 'APT::Get::Allow-Downgrades "true";' >/etc/apt/apt.conf.d/99ucs500

what this means (as far as i understand) is, for all packages use the 5.0-0 release even if that is a downgrade or there are higher versions from other sources

that is why the univention package from the app's repo are not installed during the update to 5.0-0

just for testing i added 

Package: *
Pin: origin appcenter-test.software-univention.de
Pin-Priority: 1002


this works now.

But we have to discuss the correct solution internally.
Comment 15 Florian Best univentionstaff 2021-09-13 16:43:15 CEST
(In reply to Felix Botner from comment #14)
> But we have to discuss the correct solution internally.

This topic will be continued in Bug #53782.
Comment 16 Felix Botner univentionstaff 2021-09-13 22:03:10 CEST
(In reply to Florian Best from comment #11)
> TODO:
> 
> sed -i '/univentionShareSambaBlockingLocks/d'
> test/ucs-test-tools/usr/share/ucs-test-tools/customer5000.ldif
> 
> I think we can for now leave the UDM modules as they are, and open a new bug
> to remove the properties (along with others) when 4.4 is out of maintenance.

d8f2d701c30cc84fe41e0b505f052b375bd826fe
Comment 17 Florian Best univentionstaff 2021-09-14 09:18:45 CEST
OK: listener_resync
OK: postup.sh
OK: Bug #53785 for the removal
OK: ucs-test-tools
OK: Bug #53782 for the repository
Comment 18 Felix Botner univentionstaff 2021-09-14 09:48:47 CEST
release 
 * cp /var/univention/buildsystem2/mirror/ftp/dists/ucs500/
 * update_mirror

checked updated

-> ucr get repository/online/server 
updates.software-univention.de

-> univention-upgrade --ignoressh --ignoreterm --disable-app-updates

updater.log
running univention-directory-listener-ctrl resync udm_extension ldap_extension
listener shutdown done


so the postup still works.