7

Hi I am using the CLI to transfer jobs between two jenkins servers.

But I am unable to get the CLI working..

When I run: java -jar jenkins-cli.jar -s <myhost> -auth <myid>:<mysecret> help

I get a empty response, no errors, no exceptions, just an empty shell prompt

Vigneshwaren
  • 1,273
  • 2
  • 15
  • 24
  • Are you using ssh ? if yes ? then Did you save your pub key under your profile --> configure --> SSH Public Keys section ? – prudviraj May 17 '17 at 12:51
  • I haven't specified the ssh option in the above command line. Do I need ssh keys while using the -auth option as well? – Vigneshwaren May 17 '17 at 14:35
  • i still use jenkins 1.X version , that does not support/have -auth option,configuring ssh should be the easy way and when using ssh there is no need for you to use -auth again – prudviraj May 18 '17 at 09:52
  • Hi @Vigneshwaren, Did you found a solution for this? My local Jenkins do respond. But the one hosted on a remote server doesnt. Jenkins version 2.XX – Asanke Jul 04 '19 at 02:14

2 Answers2

1

If your Jenkins is on Linux and behind an NGINX reverse-proxy server, do the following:

1.Open the file /etc/nginx/nginx.conf and add the following entries:

proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off;

2.Restart Jenkins and NGINX services:

sudo systemctl restart jenkins
sudo systemctl restart nginx

For more details, see Jenkins behind an NGinX reverse proxy.

Dibakar Aditya
  • 3,893
  • 1
  • 14
  • 25
0

I get same problem. And I find myhost it's nginx address. I fix it by change myhost to jenkins server

9ban
  • 23
  • 1
  • 5