cucumber/cucumber-jvm-scala

Unable to publish to Sonatype

gaeljw opened this issue ยท 0 comments

gaeljw commented

๐Ÿ‘“ What did you see?

See the latest release attempt: https://github.com/cucumber/cucumber-jvm-scala/actions/runs/10004836536/job/27654430547

2024-07-19 08:19:24.515Z  info [SonatypeClient] Uploading bundle /home/runner/work/cucumber-jvm-scala/cucumber-jvm-scala/target/sonatype-staging/8.23.1 to https://oss.sonatype.org/service/local/staging/deployByRepositoryId/iocucumber-1802/  - (SonatypeClient.scala:274)
2024-07-19 08:19:24.625Z error [Sonatype] 
java.io.IOException: Failure:java.util.concurrent.ExecutionException: java.io.IOException: Unexpected server response: 401 Content access is protected by token
	at org.sonatype.spice.zapper.internal.transport.AbstractChargerClient.doUpload(AbstractChargerClient.java:65)
	at org.sonatype.spice.zapper.internal.transport.AbstractClient.upload(AbstractClient.java:104)
	at org.sonatype.spice.zapper.internal.transport.AbstractClient.upload(AbstractClient.java:61)
	at xerial.sbt.sonatype.SonatypeClient.$anonfun$uploadBundle$2(SonatypeClient.scala:275)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at wvlet.airframe.control.Retry$RetryContext.$anonfun$runInternal$1(Retry.scala:290)
	at scala.util.Try$.apply(Try.scala:213)
	at wvlet.airframe.control.Retry$RetryContext.runInternal(Retry.scala:288)
	at wvlet.airframe.control.Retry$RetryContext.run(Retry.scala:257)
	at xerial.sbt.sonatype.SonatypeClient.uploadBundle(SonatypeClient.scala:255)
	at xerial.sbt.sonatype.SonatypeService.uploadBundle(SonatypeService.scala:73)
	at xerial.sbt.Sonatype$.$anonfun$sonatypeBundleRelease$2(Sonatype.scala:244)
	at xerial.sbt.Sonatype$.withSonatypeService(Sonatype.scala:527)
	at xerial.sbt.Sonatype$.$anonfun$sonatypeBundleRelease$1(Sonatype.scala:241)
	at sbtrelease.ReleasePlugin$autoImport$.$anonfun$releaseStepCommand$2(ReleasePlugin.scala:95)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$.filterFailure$1(ReleasePlugin.scala:178)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$.$anonfun$releaseCommand$9(ReleasePlugin.scala:196)
	at scala.Function$.$anonfun$chain$2(Function.scala:26)
	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
	at scala.collection.immutable.List.foldLeft(List.scala:91)
	at scala.collection.TraversableOnce.$div$colon(TraversableOnce.scala:187)
	at scala.collection.TraversableOnce.$div$colon$(TraversableOnce.scala:187)
	at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:108)
	at scala.Function$.$anonfun$chain$1(Function.scala:26)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$.$anonfun$releaseCommand$2(ReleasePlugin.scala:202)
	at scala.Option.getOrElse(Option.scala:189)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
	at xsbt.boot.Launch$.run(Launch.scala:149)
	at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
	at xsbt.boot.Launch$.launch(Launch.scala:159)
	at xsbt.boot.Launch$.apply(Launch.scala:44)
	at xsbt.boot.Launch$.apply(Launch.scala:21)
	at xsbt.boot.Boot$.runImpl(Boot.scala:78)
	at xsbt.boot.Boot$.run(Boot.scala:73)
	at xsbt.boot.Boot$.main(Boot.scala:21)
	at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Unexpected server response: 401 Content access is protected by token
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.sonatype.spice.zapper.internal.transport.AbstractChargerClient.doUpload(AbstractChargerClient.java:61)
	... 68 more
Caused by: java.io.IOException: Unexpected server response: 401 Content access is protected by token
	at org.sonatype.spice.zapper.client.hc4.Hc4Client.upload(Hc4Client.java:107)
	at org.sonatype.spice.zapper.client.hc4.Hc4Track.call(Hc4Track.java:38)
	at org.sonatype.spice.zapper.client.hc4.Hc4Track.call(Hc4Track.java:23)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)  - (Sonatype.scala:533)

I believe this is related to recent changes with Sonatype requiring the usage of a token instead of username/password.

See also https://central.sonatype.org/publish/generate-token/

@mpkorstanje any chance you could have a look at this?

โœ… What did you expect to see?

N/A

๐Ÿ“ฆ Which tool/library version are you using?

No response

๐Ÿ”ฌ How could we reproduce it?

No response

๐Ÿ“š Any additional context?

No response