Thanks for using Jenkins. I can duplicate the behavior that you're reporting with the following command that uses an incorrect server URL:
java -jar jenkins-cli.jar -s http:
I can resolve the problem by using the correct server URL:
java -jar jenkins-cli.jar -s http:
Closing as "not a defect"
The help for the arguments to jenkins-cli.jar is:
$ java -jar jenkins-cli.jar -help
Neither -s nor the JENKINS_URL env var is specified.
Jenkins CLI
Usage: java -jar jenkins-cli.jar [-s URL] command [opts...] args...
Options:
-s URL : the server URL (defaults to the JENKINS_URL env var)
-webSocket : connect using WebSocket (the default; works well with most reverse proxies; requires Jetty)
-http : use a pair of HTTP(S) connections rather than WebSocket
-ssh : use SSH protocol rather than WebSocket (requires -user; SSH port must be open on server)
-i KEY : SSH private key file used for authentication (for use with -ssh)
-noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution
-noKeyAuth : do not try to load the SSH authentication private key. Conflicts with -i
-user : specify user (for use with -ssh; must have registered a public key)
-strictHostKey : request strict host key checking (for use with -ssh)
-logger FINE : enable detailed logging from the client
-auth [ USER:SECRET | @FILE ] : specify username and either password or API token (or load from them both from a file);
for use with -http.
Passing credentials by file is recommended.
See https: -bearer [ TOKEN | @FILE ] : specify authentication using a bearer token (or load the token from file);
for use with -http. Mutually exclusive with -auth.
Passing credentials by file is recommended.
The available commands depend on the server. Run the 'help' command to see the list.
The Pipeline documentation describes JENKINS_URL as:
Full URL of Jenkins, such as https://example.com:port/jenkins/ (NOTE: only available if Jenkins URL set in "System Configuration")
The environment variables page that is available from freestyle jobs shows the value of JENKINS_URL for that job. On my controller, it shows http://mark-pc2.markwaite.net:8080.
Thanks for using Jenkins. I can duplicate the behavior that you're reporting with the following command that uses an incorrect server URL:
java -jar jenkins-cli.jar -s http://mark-pc2.markwaite.net:8080/Hosting-Providers -auth mwaite:my-token-value
I can resolve the problem by using the correct server URL:
java -jar jenkins-cli.jar -s http://mark-pc2.markwaite.net:8080/ -auth mwaite:my-token-value
Closing as "not a defect"
The help for the arguments to jenkins-cli.jar is:
The Pipeline documentation describes JENKINS_URL as:
The environment variables page that is available from freestyle jobs shows the value of JENKINS_URL for that job. On my controller, it shows http://mark-pc2.markwaite.net:8080.