Bug 49518

Summary: update on repository server failed
Product: UCS Reporter: Christina Scheinig <scheinig>
Component: Update - univention-updaterAssignee: UCS maintainers <ucs-maintainers>
Status: RESOLVED DUPLICATE QA Contact: UCS maintainers <ucs-maintainers>
Severity: normal    
Priority: P5 CC: best
Version: UCS 4.4   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
What kind of report is it?: Bug Report What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?: Yes
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: 2019052121000207 Bug group (optional):
Max CVSS v3 score:

Description Christina Scheinig univentionstaff 2019-05-21 13:13:14 CEST
A customer reported, that an update failed on his repository server, with the following traceback.

Starting dist-update at Tue May 21 08:10:33 2019...
Starting package upgrade                                Traceback in univention-upgrade:
Traceback (most recent call last):
  File "/usr/sbin/univention-upgrade", line 441, in do_update
    update_available = performUpdate(options, checkForUpdates=options.check, silent=False)
  File "/usr/sbin/univention-upgrade", line 139, in performUpdate
    if func(options, checkForUpdates, silent):
  File "/usr/sbin/univention-upgrade", line 221, in do_package_updates
    os.environ['ADMINDIARY_CONTEXT'] = context_id
  File "/usr/lib/python2.7/os.py", line 473, in __setitem__
    putenv(key, item)
TypeError: putenv() argument 2 must be string, not None

The used command was the following:
ucr set local/repository=no && univention-upgrade --noninteractive --ignoressh && ucr set local/repository=yes

Do you need more information?
Comment 1 Florian Best univentionstaff 2019-05-21 13:27:24 CEST
Already fixed in Bug #49056.

*** This bug has been marked as a duplicate of bug 49056 ***
Comment 2 Florian Best univentionstaff 2019-05-21 14:06:58 CEST
Workaround (untested):
sed -i "s#os.environ['ADMINDIARY_CONTEXT'] = context_id#os.environ['ADMINDIARY_CONTEXT'] = str(context_id)#g" /usr/sbin/univention-upgrade /usr/sbin/univention-updater
Comment 3 Christina Scheinig univentionstaff 2019-05-28 10:49:24 CEST
Workaround worked:

sed -i "s/os.environ\['ADMINDIARY_CONTEXT'\] = context_id/os.environ\['ADMINDIARY_CONTEXT'\] = str(context_id)/g" /usr/sbin/univention-upgrade