Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-542

NullPointerException if PUT /certificate_status does not specify desired_state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: SERVER 1.0.8, SERVER 2.0.0
    • Fix Version/s: SERVER 2.4.0
    • Component/s: Puppet Server
    • Labels:
      None
    • Template:
    • Sub-team:
    • Story Points:
      1
    • Sprint:
      Server Jade 2016-03-09

      Description

      If a PUT request is made to /certificate_status that does not include a desired_state parameter, a null pointer exception gets thrown.

      $ curl -k -i --cert /etc/puppetlabs/puppet/ssl/certs/precise64-1.localdomain.pem --key /etc/puppetlabs/puppet/ssl/private_keys/precise64-1.localdomain.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -X PUT -H "Content-Type: application/json" -d '{"foo_state": "signed"}' https://localhost:8140/puppet-ca/v1/certificate_status/bar
      HTTP/1.1 500 Server Error
      Date: Fri, 10 Apr 2015 00:33:50 GMT
      X-Puppet-Version: 4.0.0-rc2
      Content-Type: text/plain; charset=ISO-8859-1
      Content-Length: 53
      Server: Jetty(9.1.z-SNAPSHOT)
       
      Internal Server Error: java.lang.NullPointerException
      

      This is due to: https://github.com/rlinehan/puppet-server/blob/master/src/clj/puppetlabs/services/ca/certificate_authority_core.clj#L196

      This is an issue in both Puppet Server 1.0.x and Puppet Server 2.0.0 (both stable and master branches of Puppet Server).

        Attachments

          Activity

            People

            Assignee:
            erik Erik Dasher
            Reporter:
            ruth Ruth Linehan
            QA Contact:
            Erik Dasher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support