You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Action fails with "Error: Cache service responded with 400" #902
Description:
Action fails with "Error: Cache service responded with 400"
Task version: actions/setup-java@v2
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Repro steps:
Workflow step:
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 17
cache: maven
Expected behavior:
JDK is set up and Maven settings.xml file created
Actual behavior:
Trying to resolve the latest version from remote
Resolved latest version as 17.0.16+8
Trying to download...
Downloading Java 17.0.16+8 (Zulu) from https://cdn.azul.com/zulu/bin/zulu17.60.17-ca-crac-jdk17.0.16-linux_x64.tar.gz ...
Extracting Java archive...
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/f121cbd2-025a-4a44-939f-4203a093e9f8 -f /home/runner/work/_temp/b22869b4-9e65-4be0-8851-02fe0e9cc8a4
Java 17.0.16+8 was downloaded
Setting Java 17.0.16+8 as the default
Java configuration:
Distribution: zulu
Version: 17.0.16+8
Path: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.16-8/x64
Creating settings.xml with server-id: github
Writing to /home/runner/.m2/settings.xml
Error: Cache service responded with 400
Workaround for now is disabling cache (omitting the cache parameter to the action). Obviously not ideal for performance on workflows that run frequently.
Hello @fransf-wtax👋,
Thank you for sharing the details related to your issue.
Since you're using setup-java@v2, please note that this version relies on an older release of @actions/cache package, which can lead to caching problems or compatibility issues. To resolve this, please upgrade to the latest version of actions/setup-java, either by specifying setup-java@v5.0.0 or by using the setup-java@v5 tag. The v5 tag will always point to the most up-to-date version, including the latest fixes and improvements for caching.
The setup-java action leverages the @actions/cache package from the actions/toolkit for its caching functionality. For more details, you can refer to the discussion here. The version of @actions/cache has been bumped in the latest releases for both v3 and v4. Hope this clarifies! @p8reis, could you please let us know if upgrading to the latest v5 resolves the issue on your end as well?
Thank you!
@priya-kinthali Ah, thanks, I was not aware that there were newer versions. I read the README and only saw mentions of "Version 1 and 2" so I assumed v2 was the latest. (I do see examples using v4 now.)
It might be helpful to future users to make more explicit (in the README) what the version history of the action is and what the latest version is. That would definitely have helped me here.
I'll try the new version and let you know if the problem goes away!
Hello @fransf-wtax👋,
Thank you for your suggestion!
We've updated the README.md as part of PR #903 to add a reference to the setup-java Releases page, making it easier to find the latest releases and updates. We hope this helps!
Could you please let us know if using the new version resolves your issue? Your input is greatly appreciated!
Activity
p8reis commentedon Aug 25, 2025
I'm also having the same issue.
fransf-wtax commentedon Aug 25, 2025
Workaround for now is disabling cache (omitting the
cacheparameter to the action). Obviously not ideal for performance on workflows that run frequently.v-gowridurgad commentedon Aug 25, 2025
Hello @fransf-wtax,
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.
v-priya-kinthali commentedon Aug 26, 2025
Hello @fransf-wtax👋,
Thank you for sharing the details related to your issue.
Since you're using
setup-java@v2, please note that this version relies on an older release of@actions/cachepackage, which can lead to caching problems or compatibility issues. To resolve this, please upgrade to the latest version ofactions/setup-java, either by specifyingsetup-java@v5.0.0or by using thesetup-java@v5tag. The v5 tag will always point to the most up-to-date version, including the latest fixes and improvements for caching.The
setup-javaaction leverages the@actions/cachepackage from the actions/toolkit for its caching functionality. For more details, you can refer to the discussion here. The version of@actions/cachehas been bumped in the latest releases for both v3 and v4. Hope this clarifies!@p8reis, could you please let us know if upgrading to the latest v5 resolves the issue on your end as well?
Thank you!
fransf-wtax commentedon Aug 26, 2025
@priya-kinthali Ah, thanks, I was not aware that there were newer versions. I read the README and only saw mentions of "Version 1 and 2" so I assumed v2 was the latest. (I do see examples using v4 now.)
It might be helpful to future users to make more explicit (in the README) what the version history of the action is and what the latest version is. That would definitely have helped me here.
I'll try the new version and let you know if the problem goes away!
v-priya-kinthali commentedon Sep 3, 2025
Hello @fransf-wtax👋,
Thank you for your suggestion!
We've updated the README.md as part of PR #903 to add a reference to the
setup-javaReleases page, making it easier to find the latest releases and updates. We hope this helps!Could you please let us know if using the new version resolves your issue? Your input is greatly appreciated!
fransf-wtax commentedon Sep 3, 2025
Yes, @priya-kinthali, it all seems to work in v5. Thanks, and thanks for the README update!
gradle.yml - Github Action workflow 스크립트 업데이트