Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34495

Plugin fails to resolve image ID

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • openstack-cloud-plugin
    • None
    • Jenkins v1.609.1
      OpenStack Cloud plugin v2.3
      OS: SLES 11 SP3

    Description

      I've set up and configured the OpenStack Cloud plugin with one template. When I try to launch a slave based on that template (via Manage nodes) all I get is: "Error. Boot failed".

      After studying the logs and the network traffic I found the cause. The plugin tries to resolve the image ID based on the Image name that I configured. (See jenkins.plugins.openstack.compute.internal.OpenStack.getImageIdFor(String name)).

      This results is an API call to the images API:
      HTTP/1.1 GET v1/images?status=ACTIVE&name=My_Image
      The API however expects a lowercase status instead of uppercase (see also http://developer.openstack.org/api-ref-image-v1.html). So the response body is:
      {"images": []}.

      The result of this is that the plugin tries to provision an instance via the API without providing an imageRef.

      So there are essentially two issues:
      1. The plugin makes the wrong API call
      2. The plugin doesn't handle the situation where no images are returned correctly.

      This bug was introduced with commit 50dd47d798bcd79a99ebfb62e51cb2c2d057777f.

      Attachments

        Activity

          Thanks for reporting this. It is strange but my openstack does not eliminate the images because of case mismatch in status field. Can you run Jenkins.instance.clouds[0].openstack.@client.images().listAll(['status':'active']) (vs. ACTIVE) from JENKINS_URL/script to verify?

          You are right that there si a lot to catch up in case a mandatory field is left null. Plugin should at least report (if not abort the provisioning) in case some of the required fields is not configured (or resolved as in this case).

          olivergondza Oliver Gondža added a comment - Thanks for reporting this. It is strange but my openstack does not eliminate the images because of case mismatch in status field. Can you run Jenkins.instance.clouds [0] .openstack.@client.images().listAll( ['status':'active'] ) (vs. ACTIVE ) from JENKINS_URL/script to verify? You are right that there si a lot to catch up in case a mandatory field is left null. Plugin should at least report (if not abort the provisioning) in case some of the required fields is not configured (or resolved as in this case).
          jaapcoomans Jaap Coomans added a comment -

          Thank you for the quick response olivergondza. I tried to run the script for both ACTIVE and active and the result is as I expected based on my earlier findings:

          • ACTIVE: Returns Result: []
          • active: Returns a list of all 6 available images
          jaapcoomans Jaap Coomans added a comment - Thank you for the quick response olivergondza . I tried to run the script for both ACTIVE and active and the result is as I expected based on my earlier findings: ACTIVE: Returns Result: [] active: Returns a list of all 6 available images

          That means you ware right. The fix should be trivial.

          olivergondza Oliver Gondža added a comment - That means you ware right. The fix should be trivial.

          Fixed in 2.4.

          olivergondza Oliver Gondža added a comment - Fixed in 2.4.
          jaapcoomans Jaap Coomans added a comment -

          Great! Thank you for the quick response and release

          jaapcoomans Jaap Coomans added a comment - Great! Thank you for the quick response and release

          People

            olivergondza Oliver Gondža
            jaapcoomans Jaap Coomans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: