[barbican][OC4.0] lbaas creation fails for non-admin user in non-default domain

Bug #1791689 reported by Inessa Vasilevskaya
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenContrail
New
Undecided
Unassigned

Bug Description

Env: OS pike, opencontrail 4.0, barbican, keystone domain.

Steps to reproduce:

- Create some users in keystone domain.
- Follow instructions on lbaas creation [1]

Follow the steps from the link below with following difference.
https://wiki.openstack.org/wiki/Network/LBaaS/docs/how-to-create-tls-loadbalancer
1 Make sure you are using user from non-default domain with member and creator role to upload secret with ssl certificate.
2 Make sure when you create lbaas VIP you are doing this in non-default domain project and user is also not;

Expected result:
VIP with https is created and ssl certificate is installed.
Actual result:
lbaas is not able to download secret created by user in any project other than the project where opencontrail_barbican_user has admin privileges.

/var/log/contrail/contrail-lbaas-haproxy-stdout.log from compute

08/13/2018 20:31:31 ERROR Exception in Createing haproxy config for Loadbalancer-ID ee51ff08-8205-4c45-9261-8e12b4a5a3cf
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/opencontrail_vrouter_netns/haproxy_process.py", line 189, in start_update_haproxy
    haproxy_cfg_file = get_haproxy_config_file(cfg_file, dir_name)
  File "/usr/lib/python2.7/dist-packages/opencontrail_vrouter_netns/haproxy_process.py", line 91, in get_haproxy_config_file
    provider, haproxy_config, lbaas_auth_conf, dir_name)
  File "/usr/lib/python2.7/dist-packages/opencontrail_vrouter_netns/cert_mgr/cert_manager.py", line 25, in update_ssl_config
    update_ssl_config(haproxy_config, dest_dir)
  File "/usr/lib/python2.7/dist-packages/opencontrail_vrouter_netns/cert_mgr/barbican_cert_manager.py", line 129, in update_ssl_config
    pem_file_name = tls.create_pem_file(dest_dir)
  File "/usr/lib/python2.7/dist-packages/opencontrail_vrouter_netns/cert_mgr/tls.py", line 41, in create_pem_file
    pem_file_name = dest_dir + '/'+ self.primary_cn + '.pem'
TypeError: cannot concatenate 'str' and 'NoneType' objects
08/13/2018 20:31:31 ERROR <type 'exceptions.TypeError'>
08/13/2018 20:31:31 ERROR Inappropriate argument type.
08/13/2018 20:31:31 ERROR cannot concatenate 'str' and 'NoneType' objects
08/13/2018 20:31:31 MSG Stopping haproxy for Loadbalancer-ID

From what I see in the code it is a by design behavior as all resources are accessed as contrail admin https://github.com/Juniper/contrail-controller/blob/master/src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/cert_mgr/barbican_cert_manager.py#L28

Revision history for this message
Pavlo Shchelokovskyy (pshchelo) wrote :

looking at the code, the same bug should affect OpenContrail 3.x as well

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.