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

409 while uploading new snapshots #35

Open
aludwiko opened this issue Feb 9, 2021 · 5 comments
Open

409 while uploading new snapshots #35

aludwiko opened this issue Feb 9, 2021 · 5 comments

Comments

@aludwiko
Copy link

aludwiko commented Feb 9, 2021

Hi, I'm migrating a project from gradle to sbt and I noticed one strange thing. I'm not able to publish the snapshot artifact more than once (for the same snapshot version). It was possible with gradle, but with sbt-github-packages once uploaded I'm getting:

[error] (publish) java.io.IOException: Server returned HTTP response code: 409 for URL: https://maven.pkg.github.com/...._2.12-0.0.1-SNAPSHOT.pom
[error] Total time: 1 s, completed 9 lut 2021, 13:51:49

any ideas on how this could be fixed?

@aludwiko aludwiko changed the title Problems with uploading snapshots 409 while uploading new snapshots Feb 9, 2021
@buggtb
Copy link

buggtb commented Jul 9, 2021

Yeah I'm seeing the same. Currently the only workaround I have is to delete the package in the workflow prior to the deployment.

@djspiewak
Copy link
Owner

My guess is that gradle is working around this by deleting the package. Technically we could do the same, though I'm hesitant because -SNAPSHOT overwriting in general is not really a good practice. If it's important though, can add the DELETE call.

@khwj
Copy link

khwj commented Sep 13, 2021

@djspiewak GitHub Packages now supports snapshots:
https://github.blog/changelog/2020-03-10-packages-supports-snapshots-for-apache-maven/
Would this allow us to support proper snapshots?

sander added a commit to sander/docpkg that referenced this issue Jul 10, 2022
@TonioGela
Copy link
Sponsor

TonioGela commented Nov 15, 2022

My guess is that gradle is working around this by deleting the package. Technically we could do the same, though I'm hesitant because -SNAPSHOT overwriting in general is not really a good practice. If it's important though, can add the DELETE call.

It will be very much appreciated :D

Yeah I'm seeing the same. Currently the only workaround I have is to delete the package in the workflow prior to the deployment.

@buggtb I'm curious, did you have the need to delete more than one package? Have you somehow leveraged the artifact names and URLs generation in order to know which packages to delete?

@TonioGela
Copy link
Sponsor

TonioGela commented Nov 17, 2022

After some investigation I found this answer that states

So… I can confirm that now I can successfully publish 3.0.1-SNAPSHOT – i.e., update/re-upload artifacts using the same version (like an overwrite). That’s fine!

My fear is that there is support in GH packages but the way sbt creates the maven-xml metadata is wrong. The comment author has uploaded a pom with the following details

<metadata modelVersion="">
  <groupId>io.neow3j</groupId>
  <artifactId>compiler</artifactId>
  <version>3.0.1-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20200527.103236</timestamp>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20200527103248</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <extension>jar</extension>
        <value>3.0.1-20200527.103236-1</value>
        <updated>20200527103237</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>3.0.1-20200527.103236-1</value>
        <updated>20200527103238</updated>
      </snapshotVersion>

while the ones that I'm updating to GH packages though sbt have this format in the main XML node and no metadata element at all

  <description>desc</description>
  <url>https://github.com/foo/bar</url>
  <version>1.0.0-SNAPSHOT</version>
  <name>bar</name>

So it might be sbt and not sbt-github-packages related

[EDIT] This might be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants