Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[CSO] "IndexError: list index out of range" CSO 4.1.1 installation error



Article ID: KB35289 KB Last Updated: 27 Nov 2019Version: 1.0

When the ./ script is executed while installing Contrail Services Organization (CSO) 4.1.1, the installation may fail with the "IndexError: list index out of range" error.

This article gives the reason for the error to be output and what must be done to resolve the error.


The following error logs are seen in the /root/Contrail_Service_Orchestration_4.1.1/logs/provision_vm_error.log:

Traceback (most recent call last):
  File "/root/Contrail_Service_Orchestration_4.1.1/provision_vm/", line 243, in <module>
  File "/root/Contrail_Service_Orchestration_4.1.1/provision_vm/", line 264, in setup_vm_environment
    load_images(host,server, space, vrr)
  File "/root/Contrail_Service_Orchestration_4.1.1/provision_vm/", line 171, in load_images
    vmlinuzz = kernel[1].split('/')[2]
IndexError: list index out of range

When you check the code file, the following line is shown to have failed:

---- Code Snip----
    out, err, ret = host.exec_cmd_with_ret_status('cd /root/disks/ && virt-builder --get-kernel ~/disks/ '.format(cloudimage))
    kernel = out.split()
    vmlinuzz = kernel[1].split('/')[2]

When we try to execute the above cd /root/disks/ and virt-builder --get-kernel <image.img> commands manually, messages similar to the following may be observed:

root@CFTSBNGCSO:~/disks# virt-builder --get-kernel ubuntu-14.04.5_163.img                           
virt-builder: libguestfs error: /usr/bin/supermin-helper exited with error status 1.

Note: To see the complete error message, you may need to enable debugging. If debugging is not enabled, no output will be seen when the above command (virt-builder --get-kernel <image.img>) is executed.


From the above error details, we can confirm that it is an issue with the package libguestfs-tools.


To resolve this issue, you need to install the package afresh or uninstall the existing one and re-install it.

But before implementing the resolution, you need to rename the corrupted sources.list in the Juniper repository and replace it with the latest sources.list obtained from the Internet. Remember to rename the new list from sources.list.bk to sources.list in the Juniper repository.

cp /etc/apt/sources.list  sources.list_old
cp /etc/apt/sources.list.bk  sources.list

After completing the above step, use the following commands to uninstall and install the libguestfs-tools package.

sudo apt-get remove libguestfs-tools
sudo apt-get install libguestfs-tools
sudo apt-get update
root@CFTSBNGCSO:~# dpkg -l | grep libguest*
ii  libguestfs-perl            1:1.24.5-1ubuntu0.1    amd64    guest disk image management system - Perl bindings
ii  libguestfs-tools           1:1.24.5-1ubuntu0.1    amd64    guest disk image management system - tools
ii  libguestfs0:amd64

The installation should proceed successfully now.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search