Bug 54716 - ucs-school-user-logonscript-daemon.log: 'NoneType' object has no attribute 'rpartition'
ucs-school-user-logonscript-daemon.log: 'NoneType' object has no attribute 'r...
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-05 16:44 CEST by Arvid Requate
Modified: 2023-03-31 09:52 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
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.046
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 Arvid Requate univentionstaff 2022-05-05 16:44:30 CEST
After setting up a UCS@school single server I see these repeated error messages getting logged:
```
==> /var/log/univention/ucs-school-user-logonscript-daemon.log <==
2022-05-05 16:41:21,980 [INFO]  updating logon script for uid=demo_student,cn=schueler,cn=users,ou=DEMOSCHOOL,dc=autotest201,dc=local
2022-05-05 16:41:21,985 [ERROR]  An error occured while processing "uid=demo_student,cn=schueler,cn=users,ou=DEMOSCHOOL,dc=autotest201,dc=local": AttributeError("'NoneType' object has no attribute 'rpartition'")

==> /var/log/univention/ucs-school-user-logonscript-daemon.log <==
2022-05-05 16:41:52,090 [INFO]  updating logon script for uid=join-backup,cn=users,dc=autotest201,dc=local
2022-05-05 16:41:52,096 [ERROR]  An error occured while processing "uid=join-backup,cn=users,dc=autotest201,dc=local": AttributeError("'NoneType' object has no attribute 'rpartition'")

==> /var/log/univention/ucs-school-user-logonscript-daemon.log <==
2022-05-05 16:41:57,111 [INFO]  updating logon script for uid=Administrator,cn=users,dc=autotest201,dc=local
2022-05-05 16:41:57,119 [ERROR]  An error occured while processing "uid=Administrator,cn=users,dc=autotest201,dc=local": AttributeError("'NoneType' object has no attribute 'rpartition'")
```

This happened in a manually installed system as well as on a reference system created via:

REPLACE=true KVM_BUILD_SERVER=ranarp.knut.univention.de DOCKER=true ./utils/start-test.sh scenarios/autotest-201-ucsschool-singleserver-s4.cfg
Comment 1 Arvid Requate univentionstaff 2022-05-05 17:18:41 CEST
root@master201:~# univention-app info
UCS: 5.0-0 errata0
Installed: cups=2.2.1 radius=5.0 samba4=4.13 self-service-backend=5.0 squid=3.5 ucsschool=5.0 v1 4.4/ucsschool-veyon-proxy=1.1
Upgradable:
Comment 2 Florian Best univentionstaff 2022-07-14 09:43:43 CEST
happens when `ucsschool/userlogon/my_files_link_icon` or `ucsschool/userlogon/other_links_icon` is not set via UCR.
So this happens when the script is called before the package postinst was executed.

Fix might be just:
diff --git ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript-daemon ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript-daemon
index 917e14a8d..23b7d233a 100755
--- ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript-daemon
+++ ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript-daemon
@@ -656,11 +656,13 @@ class QueueHandler:
         )  # '%SystemRoot%\system32\imageres.dll,143'
         self.my_files_link_name = self.ucr.get("ucsschool/userlogon/my_files_link_name", "Meine Dateien")
         self.my_files_link_icon = self.ucr.get(
-            "ucsschool/userlogon/my_files_link_icon"
-        )  # '%SystemRoot%\system32\imageres.dll,207'
+            "ucsschool/userlogon/my_files_link_icon",
+            r'%SystemRoot%\system32\imageres.dll,207'
+        )
         self.other_links_icon = self.ucr.get(
-            "ucsschool/userlogon/other_links_icon"
-        )  # '%SystemRoot%\system32\imageres.dll,193'
+            "ucsschool/userlogon/other_links_icon",
+            r'%SystemRoot%\system32\imageres.dll,193'
+        )
         self.myshares_name = self.ucr.get("ucsschool/userlogon/myshares/name", "Eigene Dateien")
         self.mypictures_name = self.ucr.get("ucsschool/userlogon/mypictures/name", "Eigene Bilder")
         self.create_drive_mappings = self.ucr.is_true("ucsschool/userlogon/create_drive_mappings", True)
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2022-07-14 11:08:39 CEST
(In reply to Florian Best from comment #2)
> happens when `ucsschool/userlogon/my_files_link_icon` or
> `ucsschool/userlogon/other_links_icon` is not set via UCR.
> So this happens when the script is called before the package postinst was
> executed.

Having no icon set is a valid setting. So enforcing a default value is unfortunately no solution.

I think the origin of the traceback is in fix_win10_icon_index(self, icon_path) which should not fail if icon_path is None.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2022-07-14 11:11:37 CEST
By default the 2 variables are already set. So it affects only a smaller group of customers.

Workaround: set the UCR variable to set a icon