SMR3.1build11: Add OS image fails with "ValueError('malformed string',)" error

Bug #1608001 reported by sundarkh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Invalid
Critical
Abhay Joshi
R3.1
Fix Committed
Critical
Abhay Joshi

Bug Description

SMR3.1build11: Add OS image fails with "ValueError('malformed string',)" error

Seen with kilo/liberty/mitaka

{
    "image": [
        {
            "id": "ubuntu-14-04",
            "category": "image",
            "type": "ubuntu",
            "version": "ubuntu-14.04.4",
            "path": "/cs-shared/images/ubuntu-14.04.4-server-amd64.iso",
            "parameters" : {
                "kickstart": "/var/www/html/kickstarts/contrail-ubuntu_trusty.ks",
                "kickseed": "/var/www/html/kickstarts/contrail-ubuntu_trusty.seed"
            }
        }
    ]
}

server-manager-client add image -f /root/images/image144_root.json

{
    "return_code": 9,
    "return_data": null,
    "return_msg": "ValueError('malformed string',)"
}
root@nodeg19:~#

back trace in server manager debug log
---------------------------------------

"2016-07-30 09:28:01,556-DEBUG-server_mgr_main.py:1479-put_image(): add_image"
"2016-07-30 09:28:01,557-DEBUG-server_mgr_main.py:1138-validate_smgr_request(): validate_smgr_request"
"2016-07-30 09:28:01,558-INFO-server_mgr_main.py:261-merge_dict(): category already present in dict d1,Retaining value image against "
"2016-07-30 09:28:01,559-INFO-server_mgr_main.py:261-merge_dict(): kickstart already present in dict d1,Retaining value /var/www/html/kickstarts/contrail-ubuntu_trusty.ks against "
"2016-07-30 09:28:01,559-INFO-server_mgr_main.py:261-merge_dict(): kickseed already present in dict d1,Retaining value /var/www/html/kickstarts/contrail-ubuntu_trusty.seed against "
"2016-07-30 09:28:01,560-INFO-server_mgr_main.py:261-merge_dict(): version already present in dict d1,Retaining value ubuntu-14.04.4 against "
"2016-07-30 09:28:01,561-INFO-server_mgr_main.py:261-merge_dict(): path already present in dict d1,Retaining value /cs-shared/images/ubuntu-14.04.4-server-amd64.iso against "
"2016-07-30 09:28:01,561-INFO-server_mgr_main.py:261-merge_dict(): type already present in dict d1,Retaining value ubuntu against "
"2016-07-30 09:28:01,562-INFO-server_mgr_main.py:261-merge_dict(): id already present in dict d1,Retaining value ubuntu-14-04 against "
"2016-07-30 09:28:01,562-DEBUG-server_mgr_main.py:1163-validate_smgr_request(): ret_val_data returned: {'status': 1}"
"2016-07-30 09:28:01,563-ERROR-server_mgr_main.py:3342-log_trace(): *****TRACEBACK-START*****"
"2016-07-30 09:28:01,564-ERROR-server_mgr_main.py:3346-log_trace(): Traceback (most recent call last):
"
"2016-07-30 09:28:01,564-ERROR-server_mgr_main.py:3346-log_trace(): File "/opt/contrail/server_manager/server_mgr_main.py", line 1502, in put_image
    image_params = ast.literal_eval(image_params)
"
"2016-07-30 09:28:01,565-ERROR-server_mgr_main.py:3346-log_trace(): File "/usr/lib/python2.7/ast.py", line 80, in literal_eval
    return _convert(node_or_string)
"
"2016-07-30 09:28:01,565-ERROR-server_mgr_main.py:3346-log_trace(): File "/usr/lib/python2.7/ast.py", line 79, in _convert
    raise ValueError('malformed string')
"
"2016-07-30 09:28:01,566-ERROR-server_mgr_main.py:3346-log_trace(): ValueError: malformed string
"

Changed in juniperopenstack:
milestone: r3.1.0.0-fcs → none
Revision history for this message
Jeba Paulaiyan (jebap) wrote :

Looks like this bug got introduced and fixed by 2 commits against bug https://bugs.launchpad.net/juniperopenstack/+bug/1594994

http://github.org/Juniper/contrail-server-manager/commit/f19c8310cc036fb093e7d99e50383d046857e475 (introduced the bug)

http://github.org/Juniper/contrail-server-manager/commit/eaed9650752c54fedb926203b0570d3917c78a11 (fixed the bug)

R3.1-11 got built between these commits.

Following workaround seems to be working:

In /opt/contrail/server_manager/server_mgr_main.py, remove the following @line 1502

- image_params = ast.literal_eval(image_params)

Revision history for this message
Siva Gurumurthy (sgurumurthy) wrote :

This bug is already fixed with the review https://review.opencontrail.org/#/c/22659/

This bug was present only in R3.1 and not in master and hence invalidating it

Changed in juniperopenstack:
status: New → Invalid
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.