Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to publish artifacts after enabling gradle caching #754

Open
2 of 5 tasks
BelgianDev opened this issue Feb 17, 2025 · 2 comments
Open
2 of 5 tasks

Unable to publish artifacts after enabling gradle caching #754

BelgianDev opened this issue Feb 17, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@BelgianDev
Copy link

Description:
I enabled gradle caching in the setup java task for my action, first publishing worked nothing weird. But after changing code and wanting to make a new snapshot build of one of my libs it won't publish I constantly get a Received status code 403 from server: Forbiddenno matter what I do even disabling the caching won't make the issue go away.

I'm publishing to a self-hosted repo even after providing administrator permissions on Nexus the action was only able to publish 2 files before getting a 403 forbidden.

This issue does not happen when I publish from my own computer it only happens when running in the GitHub action.
I'm still not sure a 100% if the caching is at fault or something else but I've been fighting for over a week and can't seem to fix the issue.

Task version:
actions/setup-java@v4

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

  1. Create a simple action to publish libraries to a Nexus Repository or any repository. (Here is Mine)
  2. In the workflow enable gradle caching.
  3. Publish artifacts (Works as expected)
  4. Make changes for a new commit
  5. Publish artifacts -> Fails, server returns a 403 error.
  6. Disable caching and recommit
  7. Republish failed artifacts -> Still fails.

Expected behavior:
That I will be able to publish my artifacts

Actual behavior:
A description of what is actually happening.

@BelgianDev BelgianDev added bug Something isn't working needs triage labels Feb 17, 2025
@aparnajyothi-y
Copy link
Contributor

Hello @BelgianDev, Thank you for creating this issue and we will look into it :)

@priya-kinthali priya-kinthali self-assigned this Feb 18, 2025
@priya-kinthali
Copy link

Hello @BelgianDev 👋,
We have attempted to reproduce the error but were unable to do so. It appears that the issue may be related to Gradle caching or Nexus repository permissions. Here are some potential workarounds that might help resolve your issue:

  • Gradle Caching Configuration: Consider using the cache: 'gradle' input with setup-java in your workflow to cache Gradle dependencies, speed up the build, and prevent re-downloads. For more details, please refer to the caching Gradle dependencies documentation.

  • Debug Logging: Enable debug logging by adding the ./gradlew publish --info command to get more detailed output or set ACTIONS_STEP_DEBUG to true as detailed here. The logs might provide more insight into the issue you are encountering, such as missing permissions or incorrect paths.

  • Nexus Repository Permissions: Ensure that the credentials for the Nexus repository are correctly configured in the Gradle script and that there are no IP restrictions or other security settings blocking the requests.

We hope these suggestions help resolve your issue. Please let us know if you need further assistance or if the issue persists. We are here to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants