Univention Bugzilla – Bug 31006
InvalidURL: nonnumeric port
Last modified: 2015-11-17 12:11:37 CET
Due to a quite stupid copy&paste error I had a full url in repository/online/server (including slashes and stuff like that ;) ) which leads to a traceback while parsing. " root@master:~# univention-upgrade Starting univention-upgrade. Current UCS version is 3.1-0 errata82 Checking for local repository: none An error occurred - stopping here. " updater.log: ####################################################################### " Traceback (most recent call last): File "/usr/sbin/univention-upgrade", line 353, in main performUpdate(options.updateto, ignoressh=options.ignoressh, ignoreterm=options.ignoreterm, interactive=not options.noninteractive, silent=False) File "/usr/sbin/univention-upgrade", line 129, in performUpdate updater = UniventionUpdater() File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 522, in __init__ self.ucr_reinit() File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 578, in ucr_reinit assert self.server.access('/univention-repository/') File "/usr/lib/pymodules/python2.6/univention/updater/tools.py", line 403, in access res = UCSHttpServer.opener.open(req) File "/usr/lib/python2.6/urllib2.py", line 391, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 409, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1184, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1130, in do_open h = http_class(host, timeout=req.timeout) # will parse host:port File "/usr/lib/python2.6/httplib.py", line 661, in __init__ self._set_hostport(host, port) File "/usr/lib/python2.6/httplib.py", line 686, in _set_hostport raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) InvalidURL: nonnumeric port: '' " ####################################################################### After looking for bugs which describe this error message "An error occurred - stopping here." it seems that this is shown every time a traceback occurs. From my point of view at least this message should be improved. "An unexpected error occured - please have a look at /var/log/univention/updater.log" or something like this.
Perhaps even the exception message could be passed through?
This was also reported via UMC Traceback: Ticket #2014030321012616
Good news: Since r64693 repository/{mirror,online{/component/*}}/server now accepts an URI like 'http://updates.software-univention.de/' or 'https://updates.software-univention.de:443/univention-repository/'. '*/port' and '*/prefix' are then ignored, as they are parsed from the URI. I also changed the error message to print the file name. r64866 | Bug #31006 Up: Improve error message Package: univention-updater Version: 11.0.4-2.1419.201510261725 Branch: ucs_4.1-0 r64868 | Bug #31006 Up: Improve error message CL 2 r64867 | Bug #31006 Up: Improve error message CL The fatal error message in <command>univention-upgrade</command> now references the logfile <filename>/var/log/univention/updater.log</filename> for further details (<u:bug>31006</u:bug>).
root@master94:~# ucr set repository/online/server=\ 'https://updates-test.software-univention.de:foo' Setting repository/online/server File: /etc/apt/sources.list.d/20_ucs-online-component.list File: /etc/apt/mirror.list File: /etc/apt/sources.list.d/15_ucs-online-version.list root@master94:~# univention-upgrade Starting univention-upgrade. Current UCS version is 4.1-0 errata0 Checking for local repository: none An error occurred - see "/var/log/univention/updater.log" for details root@master94:~# tail -n 22 /var/log/univention/updater.log Starting univention-upgrade. Current UCS version is 4.1-0 errata0 Checking for local repository: none Traceback in univention-upgrade: Traceback (most recent call last): File "/usr/sbin/univention-upgrade", line 499, in main performUpdate(options, silent=False) File "/usr/sbin/univention-upgrade", line 137, in performUpdate updater = UniventionUpdater() 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 623, in ucr_reinit self.config_repository() File "/usr/lib/pymodules/python2.7/univention/updater/tools.py", line 584, in config_repository self.repourl = UcsRepoUrl(self.configRegistry, 'repository/online') File "/usr/lib/pymodules/python2.7/univention/updater/repo_url.py", line 62, in __init__ port = url.port File "/usr/lib/python2.7/urlparse.py", line 110, in port port = int(port, 10) ValueError: invalid literal for int() with base 10: 'foo' root@master94:~# cat /etc/apt/sources.list.d/15_ucs-online-version.list #Warning: This file is auto-generated and might be overwritten by […] # 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 623, in ucr_reinit # self.config_repository() # File "/usr/lib/pymodules/python2.7/univention/updater/tools.py", line 584, in config_repository # self.repourl = UcsRepoUrl(self.configRegistry, 'repository/online') # File "/usr/lib/pymodules/python2.7/univention/updater/repo_url.py", line 62, in __init__ # port = url.port # File "/usr/lib/python2.7/urlparse.py", line 110, in port # port = int(port, 10) # ValueError: invalid literal for int() with base 10: 'foo' # root@master94:~# ucr set repository/online/server='https:://updates-test.software-univention.de:foo' Setting repository/online/server File: /etc/apt/sources.list.d/20_ucs-online-component.list File: /etc/apt/mirror.list File: /etc/apt/sources.list.d/15_ucs-online-version.list root@master94:~# sed -nre '10,21p' /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 652, 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 # I think this is ok for now, but later on we should add a rough check if the given URL seems to be valid (port is an integer, hostname is not empty, protocol is given, ...). OK: code change OK: functional test OK: changelog.xml
UCS 4.1 has been released: https://docs.software-univention.de/release-notes-4.1-0-en.html https://docs.software-univention.de/release-notes-4.1-0-de.html If this error occurs again, please use "Clone This Bug".