Value for option url is not valid: invalid URI (inappropriate validation of rfc3986)

Bug #1635131 reported by Christoph Fiehe
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned
python-rfc3986 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have a fresh installed OpenStack Newton environment based on Ubuntu 16.04. I am facing a regression in the Nova module regarding URI parsing.

$ apt list --installed | grep -E 'nova|rfc'
nova-api/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed]
nova-common/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed,automatic]
nova-conductor/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed]
nova-consoleauth/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed]
nova-novncproxy/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed]
nova-scheduler/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed]
python-nova/xenial-updates,xenial-updates,now 2:14.0.1-0ubuntu1~cloud0 all [installed,automatic]
python-novaclient/xenial-updates,xenial-updates,now 2:6.0.0-0ubuntu1~cloud0 all [installed,automatic]
python-rfc3986/xenial,xenial,now 0.2.0-2 all [installed,automatic]

This is an excerpt from my nova.conf:
[neutron]
auth_type = password
auth_uri = http://os-identity:5000
auth_url = http://os-identity:35357
metadata_proxy_shared_secret = XYZ
password = XYZ
project_domain_name = default
project_name = service
region_name = RegionOne
service_metadata_proxy = true
url = http://os-network:9696
user_domain_name = default
username = neutron

The following error is stated in the log:
2016-10-20 08:28:40.251 19479 CRITICAL nova [req-26ab01e7-72b0-4792-a8a4-56454a4c390c - - - - -] ConfigFileValueError: Value for option url is not valid: invalid URI: 'http://os-network:9696'
2016-10-20 08:28:40.251 19479 ERROR nova Traceback (most recent call last):
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/bin/nova-api", line 10, in <module>
2016-10-20 08:28:40.251 19479 ERROR nova sys.exit(main())
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/nova/cmd/api.py", line 73, in main
2016-10-20 08:28:40.251 19479 ERROR nova launcher.wait()
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/oslo_service/service.py", line 568, in wait
2016-10-20 08:28:40.251 19479 ERROR nova self.conf.log_opt_values(LOG, logging.DEBUG)
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2626, in log_opt_values
2016-10-20 08:28:40.251 19479 ERROR nova _sanitize(opt, getattr(group_attr, opt_name)))
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 3057, in __getattr__
2016-10-20 08:28:40.251 19479 ERROR nova return self._conf._get(name, self._group)
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2668, in _get
2016-10-20 08:28:40.251 19479 ERROR nova value = self._do_get(name, group, namespace)
2016-10-20 08:28:40.251 19479 ERROR nova File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2711, in _do_get
2016-10-20 08:28:40.251 19479 ERROR nova % (opt.name, str(ve)))
2016-10-20 08:28:40.251 19479 ERROR nova ConfigFileValueError: Value for option url is not valid: invalid URI: 'http://os-network:9696'

The same problem was reported here:
https://bugs.launchpad.net/kolla/+bug/1629729

As it is stated there 'python-rfc3986' could not handle URI which has '-' characters in case of older versions of python-rfc3986 than 0.3.0.

A current workaround is to use e.g. the ip address instead of a hostname or alias that has a hyphen in its name.

The same problem exists in nova-compute on my compute node using:
[vnc]
enabled = true
novncproxy_base_url = https://os-cloud.mycompany.com:6080/vnc_auto.html
vncserver_listen = 0.0.0.0

The setting causes the same invalid uri exception as stated above.

We need a new version of 'python-rfc3986'.

Revision history for this message
György Szombathelyi (gyurco) wrote :

Yepp, please upgrade python-rfc3986

Revision history for this message
György Szombathelyi (gyurco) wrote :

And I think requirements.txt in Mitaka needs an update for python-rfc3986

Revision history for this message
György Szombathelyi (gyurco) wrote :

Sorry, not Mitaka, Newton

Revision history for this message
Christoph Fiehe (fiehe) wrote :

I think we need a package "python-rfc3986" in the Netwon APT cloud repository that has a version >= 0.3.0. In the offical Ubuntu repositories "python-rfc3986" is only available in version 0.2.0.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-rfc3986 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.