Maven deploy fails with HTTP 422 Unprocessable Entity

Hi,

Trying to mvn deploy a multi-module maven project to GHPM (snapshot, not release), but I get the following error on the first file upload:

[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://maven.pkg.github.com/ttomsu/spring-cloud-gcp
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://maven.pkg.github.com/ttomsu/spring-cloud-gcp with username=ttomsu, password=***
Downloading from ttomsu-spring-gcp-new: https://maven.pkg.github.com/ttomsu/spring-cloud-gcp/org/springframework/cloud/spring-cloud-gcp/2.0.1.BUILD-SNAPSHOT/maven-metadata.xml
[DEBUG] Could not find metadata org.springframework.cloud:spring-cloud-gcp:2.0.1.BUILD-SNAPSHOT/maven-metadata.xml in ttomsu-spring-gcp-new (https://maven.pkg.github.com/ttomsu/spring-cloud-gcp)
[DEBUG] Writing tracking file /home/ttomsu/.m2/repository/org/springframework/cloud/spring-cloud-gcp/2.0.1.BUILD-SNAPSHOT/resolver-status.properties
Uploading to ttomsu-spring-gcp-new: https://maven.pkg.github.com/ttomsu/spring-cloud-gcp/org/springframework/cloud/spring-cloud-gcp/2.0.1.BUILD-SNAPSHOT/spring-cloud-gcp-2.0.1.BUILD-20200624.133316-1.pom
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.142 s
[INFO] Finished at: 2020-06-24T09:18:41-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project spring-cloud-gcp: Failed to deploy artifacts: Could not transfer artifact org.springframework.cloud:spring-cloud-gcp:pom:2.0.1.BUILD-20200624.131841-1 from/to ttomsu-spring-gcp-new (https://maven.pkg.github.com/ttomsu/spring-cloud-gcp): Failed to transfer file: https://maven.pkg.github.com/ttomsu/spring-cloud-gcp/org/springframework/cloud/spring-cloud-gcp/2.0.1.BUILD-SNAPSHOT/spring-cloud-gcp-2.0.1.BUILD-20200624.131841-1.pom. Return code is: 422, ReasonPhrase: Unprocessable Entity.
...

Here are the relevant parts of my ~/.m2/settings.xml:

<profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>ttomsu-spring-gcp-new</id>
          <name>GitHub ttomsu Apache Maven Packages</name>
          <url>https://maven.pkg.github.com/ttomsu/spring-cloud-gcp</url>
          <releases><enabled>false</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>ttomsu-spring-gcp-new</id>
      <username>ttomsu</username>
      <password><!-- snip! --></password>
    </server>
  </servers>
</settings>

and the pom.xml:

<distributionManagement>
  <snapshotRepository>
    <id>ttomsu-spring-gcp-new</id>
    <name>GitHub OWNER Apache Maven Packages</name>
    <url>https://maven.pkg.github.com/ttomsu/spring-cloud-gcp</url>
  </snapshotRepository>
</distributionManagement>

As seen above the maven-deploy-plugin is at 2.8.2, and:

$ ./mvnw --version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: /home/ttomsu/.m2/wrapper/dists/apache-maven-3.5.4-bin/4lcg54ki11c6mp435njk296gm5/apache-maven-3.5.4
Java version: 11.0.7, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.5.17-1rodete4-amd64", arch: "amd64", family: "unix"

One thing that may be causing the issue is that I’m doing this on a fork - is there anything in the GHPM logic that checks this and/or the <scm> element?

I read in Problem to upload -source.jar 422 Unprocessable Entity there @clarkbw is seeing issues with SNAPSHOTs - has this been fixed? What more detail can I provide to help with a fix?

Hi @ttomsu :wave:

One thing that may be causing the issue is that I’m doing this on a fork - is there anything in the GHPM logic that checks this and/or the <scm> element?

I’ve been investigating this, but I’m afraid it isn’t obvious what’s going wrong. I was wondering if you could recreate the error in a GitHub Actions workflow and point me to your fork?

Thanks,
Jamie.

We are seeing an identical error in a pull request. But I’m unsure how to debug this: https://github.com/graphhopper/graphhopper/runs/818066668

Or is this related to the github incidents in the morning?

I get the same error, did someone solve it?