409 from server: Conflict occurrs when publishing to GitHub Packages

I am facing following error intermittently when publishing to GitHub packages inside out GitHub actions workflows.

 * What went wrong:
Execution failed for task ':module-ballerina-openapi:publishMavenJavaPublicationToGitHubPackagesRepository'.
> Failed to publish publication 'mavenJava' to repository 'GitHubPackages'
   > Could not PUT 'https://maven.pkg.github.com/ballerina-platform/ballerina-openapi/org/ballerinalang/module-ballerina-openapi/2.0.10/module-ballerina-openapi-2.0.10.zip.sha1'. Received status code 409 from server: Conflict

When we delete the package and re trigger same workflow it publishes successfully.

Initially we suspected our Gradle scripts that it would publish twice. Then as it works when re triggering by deleting the package or bumping next version, we were thinking could it be from Github packages side


Hello, I am facing the exact same issue. Did you manage to find a solution on this. We are using the gradle maven-publish plugin.

Same here, also using Gradle Maven publish

I am facing the exact same issue. It fails with random artifacts for me. Not always the same one, not even always during the same gradle task. :unamused:

I didn’t find a solution yet. As it happens intermittently for me we had to delete package and publish again

Same thing happening here as well. A package that was resolving properly in our builds stopped doing so about 6 hours ago. I tried deleting the package & republishing it but even then I’m getting a 409 Conflict error when trying to republish. This must be something from GitHub side, since for us it basically stopped working without doing anything.

maybe you have a same version in your github package

Hey, I have the same problem?
Any solution so far?

I don’t have a solution but the CAS project (GitHub - apereo/cas: Apereo CAS - Enterprise Single Sign On for all earthlings and beyond.) has a new workflow for publishing private releases from a fork to GitHub Packages (as well as Azure Artifacts and AWS CodeArtifact). The same gradle publish processes are successful on other repositories but we see the 409 conflict more than 50% of the time when publishing to GitHub Packages (using brand new versions that don’t already exist). CAS publishes hundreds of artifacts per release and in order to ever get a successful publish to GitHub I had to reduce the number of artifact types per artifact to the main artifact types, but even then it isn’t reliable. I have a support ticket opened with GitHub but haven’t got a response yet. The workflows that can be used to recreate the problem are described in this blog post: Publish Private CAS Releases – Apereo Community Blog.