Bug 53181 - Join via UMC module for backup/replica/managed node not possible due to failed version check
Join via UMC module for backup/replica/managed node not possible due to faile...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Domain join
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Jürn Brodersen
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-28 11:20 CEST by Johannes Keiser
Modified: 2021-06-10 08:08 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
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.069
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 Johannes Keiser univentionstaff 2021-04-28 11:20:04 CEST
When trying to join a backup/replica/managed node via the UMC "Domain join" module
the following error occurs even if primary has same version.
The primary and other nodes where all fresh 5.0 installations.

----
The system join process could not be completed:
	
Please visit https://help.univention.com/t/8842 for common problems during the join and how to fix them -- Warning: UCS version on master70.mydomain.intranet is lower () than local version (). This constellation is not supported.
	
More details can be found in the log file /var/log/univention/join.log.
Please retry after resolving any conflicting issues.
----

The strings for the version are empty.
Comment 2 Ingo Steuwer univentionstaff 2021-06-01 09:39:51 CEST
https://help.univention.com/t/join-error-an-unexpected-error-occurred-a-bytes-like-object-is-required-not-str/17926/5 might be related, even if it occures on a Backup Node.
Comment 3 Florian Best univentionstaff 2021-06-01 09:47:27 CEST
(In reply to Ingo Steuwer from comment #2)
> https://help.univention.com/t/join-error-an-unexpected-error-occurred-a-
> bytes-like-object-is-required-not-str/17926/5 might be related, even if it
> occures on a Backup Node.
No, it's a different bug but I think it's okay to fix it here.

The patch:
diff --git management/univention-join/umc/python/join/__init__.py management/univention-join/umc/python/join/__init__.py
index 4952c34730..bc103b6dfc 100644
--- management/univention-join/umc/python/join/__init__.py
+++ management/univention-join/umc/python/join/__init__.py
@@ -178,7 +178,7 @@ def run_join_scripts(
                cmd = ['/usr/sbin/univention-run-join-scripts']
                if username and password:
                        # credentials are provided
-                       passwordFile.write(password)
+                       passwordFile.write(password.encode('UTF-8'))
                        passwordFile.flush()
                        cmd += ['-dcaccount', username, '-dcpwd', passwordFile.name]
Comment 4 Florian Best univentionstaff 2021-06-01 11:18:05 CEST
MODULE      ( WARN    ) : Exception during running join scripts:
   File "/usr/lib/python3/dist-packages/notifier/threads.py", line 80, in _run
    result = self._function()
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/join/__init__.py", line 483, in _thread
    critical_handler=self.progress_state.critical_handler,
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/join/__init__.py", line 181, in run_join_scripts
    passwordFile.write(password)
  File "/usr/lib/python3.7/tempfile.py", line 620, in func_wrapper
    return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'
Comment 5 Jürn Brodersen univentionstaff 2021-06-02 12:34:22 CEST
I had to change univention-ssh to get this working again:
https://git.knut.univention.de/univention/ucs/-/merge_requests/103

@QA Please reopen for merge and yaml
Comment 6 Jürn Brodersen univentionstaff 2021-06-07 15:35:26 CEST
This has been fixed in python-daemon:
------------------------------------------------------------------------
r19379 | jbroders | 2021-06-07 13:50:14 +0200 (Mo, 07 Jun 2021) | 1 line

Bug #53181: patch -> quilt
------------------------------------------------------------------------
r19378 | jbroders | 2021-06-07 13:48:41 +0200 (Mo, 07 Jun 2021) | 1 line

Bug #53181: fix std-stream handling (python >= 3.4)
------------------------------------------------------------------------

python-daemon closed all file descriptors and reopened the standard streams but these were not inheritable (as they should have been). The univention-ssh subprocess was then opened without any standard streams from within the daemon context which broke the output from ssh.

[5.0-0 1a995de044] Bug #53181: yaml
[5.0-0 8fa4d61f9d] Bug #53181: fix password encoding
[5.0-0 cc1de3d1c2] Bug #53181: changelog
[5.0-0 704f042131] Bug #53181: yaml
[5.0-0 bade72c2ff] Bug #53181: yaml
Comment 7 Dirk Wiesenthal univentionstaff 2021-06-08 11:20:08 CEST
Functional: OK, join is possible again
Code changes: OK
YAML: OK
Comment 9 Philipp Hahn univentionstaff 2021-06-10 08:08:11 CEST
(In reply to Jürn Brodersen from comment #6)
> This has been fixed in python-daemon:
> ------------------------------------------------------------------------
> r19379 | jbroders | 2021-06-07 13:50:14 +0200 (Mo, 07 Jun 2021) | 1 line

Files new upstream issue <https://pagure.io/python-daemon/issue/57> and <https://pagure.io/python-daemon/pull-request/58>