5

The jenkins-cli.jar has been downloaded.

It is able to run.

When one tries to check the syntax of a jenkinsfile by running java -jar ~/Desktop/jenkins-cli.jar -s https://<jenkins_url> -noCertificateCheck declarative-linter < Jenkinsfile it results in:

Sep 27, 2017 10:46:18 AM hudson.cli.CLI _main
INFO: Skipping HTTPS certificate checks altogether. Note that this is not secure at all.
Sep 27, 2017 10:46:34 AM hudson.cli.CLI$5 run
WARNING: null
java.io.IOException: Stream is closed
        at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3512)
        at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3486)
        at java.io.DataOutputStream.writeInt(DataOutputStream.java:197)
        at hudson.cli.PlainCLIProtocol$EitherSide.send(PlainCLIProtocol.java:188)
        at hudson.cli.PlainCLIProtocol$EitherSide.send(PlainCLIProtocol.java:195)
        at hudson.cli.PlainCLIProtocol$EitherSide$1.write(PlainCLIProtocol.java:215)
        at hudson.cli.CLI$5.run(CLI.java:699)

@Tensibai asked whether there is an authentication issue. Authentication was done, but it is unclear whether it was succesfull or not:

$ java -jar ~/Desktop/jenkins-cli.jar -noCertificateCheck -s https://<jenkins url> login --username <username> --password <password>
Sep 27, 2017 10:57:17 AM hudson.cli.CLI _main
INFO: Skipping HTTPS certificate checks altogether. Note that this is not secure at all.
5
  • 1
    Seems your jenkins url refuse the connexion, doesn't it need an authentication ?
    – Tensibai
    Commented Sep 27, 2017 at 8:54
  • @Tensibai question has been updated
    – 030
    Commented Sep 27, 2017 at 9:01
  • Maybe: java -jar ~/Desktop/jenkins-cli.jar -s https://<jenkins_url> -noCertificateCheck --username <username> --password <password> declarative-linter < Jenkinsfile ? there's a bunch of blur about auth with different versions on jenkins site
    – Tensibai
    Commented Sep 27, 2017 at 9:06
  • it returned the same null pointer and stack trace
    – 030
    Commented Sep 27, 2017 at 9:10
  • Version of the cli ? format of the url ?
    – Tensibai
    Commented Sep 27, 2017 at 9:26

1 Answer 1

1

After upgrading Jenkins the issue was solved. It turned out that the issue was version related.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.