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

401 Sonatype Maven Central Release is broken due to: Content access is protected by token (401) #212

Closed
vorburger opened this issue Jun 16, 2024 · 5 comments

Comments

@vorburger
Copy link
Owner

I've just tried to publish a 3.3.0 to https://search.maven.org/artifact/ch.vorburger.exec/exec, but it failed:

$ ./mvnw release:perform -Pgpg

(...)
    [INFO] --- gpg:3.2.4:sign (sign-artifacts) @ exec ---
    [INFO] Signer 'gpg' is signing 4 files with key default
    [INFO]
    [INFO] --- install:3.1.1:install (default-install) @ exec ---
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/pom.xml to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.pom
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.jar to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-sources.jar to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-sources.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-javadoc.jar to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-javadoc.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.jar.asc to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.jar.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.pom.asc to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.pom.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-sources.jar.asc to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-sources.jar.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-javadoc.jar.asc to /home/vorburger/.m2/repository/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-javadoc.jar.asc
    [INFO]
    [INFO] --- nexus-staging:1.7.0:deploy (injected-nexus-deploy) @ exec ---
    [INFO] Performing local staging (local stagingDirectory="/home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging")...
    [INFO]  + Using server credentials "ossrh" from Maven settings.
    [INFO]  * Connected to Nexus at https://oss.sonatype.org:443/, is version 2.15.1-02 and edition "Professional"
    [INFO]  * Using staging profile ID "12bb4759cb85ae" (matched by Nexus).
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.jar to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/pom.xml to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.pom
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-sources.jar to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-sources.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-javadoc.jar to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-javadoc.jar
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.jar.asc to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.jar.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0.pom.asc to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0.pom.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-sources.jar.asc to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-sources.jar.asc
    [INFO] Installing /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/exec-3.3.0-javadoc.jar.asc to /home/vorburger/git/github.com/vorburger/ch.vorburger.exec/target/checkout/target/nexus-staging/staging/12bb4759cb85ae/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-javadoc.jar.asc
    [INFO] Performing remote staging...
    [INFO]
    [INFO]  * Remote staging into staging profile ID "12bb4759cb85ae"
    [INFO]  * Created staging repository with ID "chvorburger-1062".
    [INFO]  * Staging repository at https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/chvorburger-1062
    [INFO]  * Uploading locally staged artifacts to profile ch.vorburger
    Uploading to ossrh: https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/chvorburger-1062/ch/vorburger/exec/exec/3.3.0/exec-3.3.0-javadoc.jar
    [ERROR] Remote staging finished with a failure: Failed to deploy artifacts: Could not transfer artifact ch.vorburger.exec:exec:jar:javadoc:3.3.0 from/to ossrh (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/chvorburger-1062): status code: 401, reason phrase: Content access is protected by token (401)
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  33.594 s
    [INFO] Finished at: 2024-06-16T23:52:56+02:00
    [INFO] ------------------------------------------------------------------------
    [WARNING] The requested profile "release" could not be activated because it does not exist.
    [ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.7.0:deploy (injected-nexus-deploy) on project exec: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact ch.vorburger.exec:exec:jar:javadoc:3.3.0 from/to ossrh (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/chvorburger-1062): status code: 401, reason phrase: Content access is protected by token (401) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  45.915 s
[INFO] Finished at: 2024-06-16T23:52:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.1:perform (default-cli) on project exec: Maven execution failed, exit code: '1' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

My ~/.m2/settings.xml does have this, and this used to work as recently as March:

 <server>
      <id>ossrh</id>
      <username>vorburger</username>
      <password>{u...=}</password>

Based on https://central.sonatype.org/pages/support/#producers, I'ved emailed central-support@sonatype.com...

@vorburger
Copy link
Owner Author

---------- Forwarded message ---------
From: Michael Vorburger <...>
Date: Mon, Jun 17, 2024 at 12:13 AM
Subject: 401 Sonatype Maven Central Release is broken due to: Content access is protected by token (401)
To: central-support@sonatype.com

Hi!

Can you help with #212, please?

Do I have to migrate from OSSRH (https://central.sonatype.org/register/legacy/) to Central Portal (https://central.sonatype.org/register/central-portal/) now? How?

https://central.sonatype.org/faq/401-error does really help; I don't understand WHERE I would need to do https://central.sonatype.org/publish/generate-token/ - what's NXRM?

I CAN login to https://central.sonatype.com/, but not e.g. to https://s01.oss.sonatype.org/, so I'm a bit confused what's what.

When I try to Add Namespace "ch.vorburger" on https://central.sonatype.com/, it says that "Namespace 'ch.vorburger' is already registered as an OSSRH Namespace. For help with OSSRH namespaces, please refer to our documentation."

All the changes you have recently been making are a bit confusing... ;-)

Thanks for your help,
M.


Michael Vorburger
http://www.vorburger.ch/

@vorburger
Copy link
Owner Author

@mosesn @duttonw FYI

@vorburger
Copy link
Owner Author

For the record, I've manually reverted (via "git rebase") 2 commits related to the (initial) 3.3.0 release, and deleted the tag, from a week ago.

I'll retry to figure out how to publish a release.

@vorburger
Copy link
Owner Author

#105 has notes from last time I've struggled with this...

Sonatype Central Support replied with this:


From: Support <>
Date: Mon, Jun 17, 2024 at 5:07 PM
Subject: [Central Support by Sonatype] Re: 401 Sonatype Maven Central Release is broken due to: Content access is protected by token (401)
To: Michael Vorburger <>

Hello Michael,

We've recently made necessary changes to our account management system that involves requiring a user token to publish. Although we attempted to reach out to all of our publishers before this change, we realize that the communication might not have reached you. Please follow the instructions on publishing via a user token in order to resolve this issue.

Please keep in mind that the user tokens generated in Central Portal cannot be used in OSSRH. Additionally, if you need to reset your OSSRH password, please follow these instructions to manage your credentials.

Regards,
The Central Team


So I am (apparently, still) on oss.sonatype.org; not on s01.oss.sonatype.org, nor "directly" (?) on "Central" (?).

This means I am (still, for now) using OSSRH Sonatype Nexus Repository Manager servers, and not (yet) Central Publisher Portal, so not (yet, presumably) supposed to use https://central.sonatype.org/publish/generate-portal-token/ (with https://central.sonatype.org/publish/publish-portal-maven/) for https://central.sonatype.org/register/namespace/.
but, for now, via https://central.sonatype.org/publish/generate-token/ (with https://central.sonatype.org/publish/publish-maven/).

I think this means that I need to create an access token using https://central.sonatype.org/publish/generate-token/ and use that, instead of (directly) using the password ("encrypted" LOL 🤣 🍭 via https://maven.apache.org/guides/mini/guide-encryption.html)...

@vorburger
Copy link
Owner Author

Looks like it worked; the 3.3.0 just showed up on https://oss.sonatype.org/#nexus-search;gav~ch.vorburger.exec~exec~~~~kw,versionexpand.

https://github.com/vorburger/ch.vorburger.exec/releases/tag/exec-3.3.0 published.

I'll reply to Sonatype Central Support to resolve case.

I'll open a follow-up PR in MariaDB4j to bump to this.

@mosesn @duttonw FYI

Closing this as Done.

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

1 participant