# Invalid or corrupt jar file when remote trigger is executed

**URL:** <https://community.jenkins.io/t/invalid-or-corrupt-jar-file-when-remote-trigger-is-executed/32919>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [June 17, 2025, 5:15am UTC](https://community.jenkins.io/t/invalid-or-corrupt-jar-file-when-remote-trigger-is-executed/32919 "2025-06-17T05:15:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep](https://avatars.discourse-cdn.com/v4/letter/p/f0a364/32.png) [@Pradeep](https://community.jenkins.io/u/Pradeep)\
**Post date:** [June 17, 2025, 5:15am UTC](https://community.jenkins.io/t/invalid-or-corrupt-jar-file-when-remote-trigger-is-executed/32919/1 "2025-06-17T05:15:47Z")

</div>

Jenkins setup: I have a Jenkins setup with docker environment which uses organization proxy. I am trying to remote trigger a job in another jenkins using cli jar file.

The problem is sometimes the job doesn’t trigger properly saying corrupt jar file. However the next triggers are executed successfully without any issues. I’m unable to share the logs due to log rotation.

Additionally when i try to execute any commands using cli jar file it throws handshake error.  
For eg:  
java -jar jenkins-cli.jar -s https://\<jenkins\_url\>/ -auth user\_name:apitoken version  
CLI handshake failed with status code 401  
Cache-Control: must-revalidate, no-cache, no-store  
Content-Length: 459  
Content-Type: text/html;charset=iso-8859-1  
Date: Tue, 17 Jun 2025 05:13:50 GMT  
Server: Jetty(12.0.19)  
Set-Cookie: remember-me=; Path=/RBEI\_test; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Max-Age=0  
Www-Authenticate: Basic realm=“Jenkins”  
X-Content-Type-Options: nosniff

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [July 8, 2025, 10:46am UTC](https://community.jenkins.io/t/invalid-or-corrupt-jar-file-when-remote-trigger-is-executed/32919/2 "2025-07-08T10:46:45Z")

</div>

It sounds like you’re running into two separate but related issues:

1. A possibly **corrupted `jenkins-cli.jar`** , and
2. A **401 error during the CLI handshake** , which usually points to an authentication problem.

Let’s walk through a few things that might help:

* * *

### 🛠 1. Try downloading a fresh `jenkins-cli.jar`

In many cases, the CLI jar gets corrupted when it’s cached by a proxy or if the download was interrupted. Just to be safe, it might be worth grabbing a clean copy directly from your Jenkins instance each time:

```auto
wget https://<jenkins_url>/jnlpJars/jenkins-cli.jar -O jenkins-cli.jar

```

If possible, try bypassing any proxy when downloading it, especially if you’ve seen issues with stale or partial files before.

* * *

### 🔐 2. Check authentication details (the 401 error)

That 401 usually means Jenkins is rejecting the credentials. A few things you could double-check:

- Make sure the username and API token are correct.

- If you’re using the `-auth` option, one approach is to put your credentials in a file like this:

- Also, make sure there’s **no trailing slash** after `/` in the `-s` URL. It seems minor, but it can trip things up.

* * *

### 🌐 3. If you’re behind a proxy or reverse proxy…

You might want to make sure that no authentication headers are being stripped or altered. This can sometimes happen with reverse proxy setups like Nginx or Apache.

* * *

### ✅ Summary

- Re-download the CLI jar fresh (and avoid proxy caching).
- Double-check your credentials and try the file-based `-auth` approach.
- Watch for proxy-related hiccups.

These steps usually help clear up the kinds of issues you’re seeing.
