puppet-jenkins icon indicating copy to clipboard operation
puppet-jenkins copied to clipboard

Does PuppetX::Jenkins::Provider::Cli need to handle more exception types?

Open jhoblitt opened this issue 9 years ago • 2 comments

At present, PX::J::P::Cli only retries the CLI jar if the exception script matches one of the known authentication error strings. However, I occasionally see other exception messages which I suspect are caused by the jenkins daemon not having enough time to "settle" after being [re]started.

Eg.

==> master: Error: Failed to apply catalog: Execution of '/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://localhost:8080 groovy /usr/lib/jenkins/puppet_helper.groovy user_info_all' returned 255: Apr 11, 2016 1:38:45 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
==> master: SEVERE: I/O error in channel Chunked connection to http://localhost:8080/cli
==> master: java.io.StreamCorruptedException: invalid stream header: 0A0A0A0A

jhoblitt avatar Apr 11 '16 20:04 jhoblitt

This error keeps coming up in the acceptance tests under travis:

  Error: Failed to apply catalog: Execution of '/usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://localhost:8080 groovy /usr/lib/jenkins/puppet_helper.groovy job_list_json' returned 255: java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, X-Hudson, X-Hudson-Theme, Content-Length, Expires, X-Jenkins-Session, Set-Cookie, Content-Type, Server, Cache-Control, X-Content-Type-Options]

jhoblitt avatar Apr 18 '16 15:04 jhoblitt

Also frequently seeing this error message for several types and the error message appears to always have valid json. (passes validation).

 Error: Failed to apply catalog: unable to parse as JSON: [
      {
          "name": "foo",
          "config": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><project>\n  <actions/>\n  <description>test job</description>\n  <keepDependencies>false</keepDependencies>\n  <properties/>\n  <scm class=\"hudson.scm.NullSCM\"/>\n  <canRoam>true</canRoam>\n  <disabled>false</disabled>\n  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>\n  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>\n  <triggers/>\n  <concurrentBuild>false</concurrentBuild>\n  <builders>\n    <hudson.tasks.Shell>\n      <command>/usr/bin/true</command>\n    </hudson.tasks.Shell>\n  </builders>\n  <publishers/>\n  <buildWrappers/>\n</project>",
          "enabled": true
      }
  ]
  Apr 18, 2016 3:37:11 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
  SEVERE: I/O error in channel CLI connection to http://localhost:8080
  java.net.SocketException: Connection reset

jhoblitt avatar Apr 18 '16 15:04 jhoblitt