Bug 38373

Summary: mirror.list is emptied if a repository server has network problems
Product: UCS Reporter: Daniel Orrego <orrego>
Component: Update - Repository administrationAssignee: UCS maintainers <ucs-maintainers>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: mai
Version: UCS 3.2   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=42450
What kind of report is it?: --- 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?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Daniel Orrego univentionstaff 2015-04-27 18:34:07 CEST
/etc/apt/mirror.list ends up as an empty file if a commit is performed while the server has no access to the proxy server.

"ProxyError: Proxy configuration error: port is closed"

Changing the setting of a UCRV triggered the commit of the mirror.list file in a moment when the UCS mirror had temporarily no access to the http proxy, resulting in all entries in mirror.list being overwritten by the traceback below.

If the server can't access the http proxy, the mirror.list file should still be kept in a consistent state.

Here the complete traceback:
#
# An error occurred during the repository check. The error message:
#   Traceback (most recent call last):
#     File "<stdin>", line 13, in <module>
#     File "/usr/lib/pymodules/python2.6/univention/updater/mirror.py", line 49, in __init__
#       UniventionUpdater.__init__(self, check_access)
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 554, in __init__
#       self.ucr_reinit()
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 609, in ucr_reinit
#       assert self.server.access('/univention-repository/')
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 481, in access
#       raise ProxyError(uri, reason)
#   ProxyError: Proxy configuration error: port is closed http://updates.software-univention.de/univention-repository/
#

# After fixing this issue, you should rewrite this file with the following command:
#   univention-config-registry commit /etc/apt/mirror.list
#


See also bug #17414 and bug #21933
Comment 1 Daniel Orrego univentionstaff 2015-07-01 14:39:48 CEST
More generally, mirror.list is overwritten with a traceback if the repository server has problems accessing the network.

Here the server can't resolve the hostnames in repository/online/.../server=*

**Configuration error: host is unresolvable**

# An error occurred during the repository check. The error message:
#   Traceback (most recent call last):
#     File "<stdin>", line 13, in <module>
#     File "/usr/lib/pymodules/python2.6/univention/updater/mirror.py", line 49, in __init__
#       UniventionUpdater.__init__(self, check_access)
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 556, in __init__
#       self.ucr_reinit()
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 611, in ucr_reinit
#       assert self.server.access('/univention-repository/')
#     File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 481, in access
#       raise ConfigurationError(uri, reason)
#   ConfigurationError: Configuration error: host is unresolvable
#

# After fixing this issue, you should rewrite this file with the following command:
#   univention-config-registry commit /etc/apt/mirror.list
#
Comment 2 Eduard Mai univentionstaff 2017-01-16 15:59:38 CET
Happened again with a UCS instance created by ucs-kt-get:

/etc/apt/sources.list.d/15_ucs-online-version.list:
# An error occurred during the repository check. The error message:
#   Traceback (most recent call last):
#     File "<stdin>", line 13, in <module>
#     File "/usr/lib/pymodules/python2.7/univention/updater/tools.py", line 579, in __init__
#       self.ucr_reinit()
#     File "/usr/lib/pymodules/python2.7/univention/updater/tools.py", line 660, in ucr_reinit
#       assert self.server.access(None, '') 
#     File "/usr/lib/pymodules/python2.7/univention/updater/tools.py", line 488, in access
#       raise ConfigurationError(uri, reason)
#   ConfigurationError: Configuration error: host is unresolvable
Comment 3 Stefan Gohmann univentionstaff 2017-06-16 20:38:20 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 4 Stefan Gohmann univentionstaff 2017-08-08 07:11:30 CEST
This issue has been filed against UCS 3.2.

UCS 3.2 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.