Publishing is broken
jackkoenig opened this issue · comments
Starting yesterday, the publishing of SNAPSHOTs is failing with:
[error] java.net.ProtocolException: Server redirected too many times (20)
[error] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
[error] at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[error] at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[error] at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2051)
[error] at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2046)
[error] at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
[error] at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:2045)
[error] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1609)
[error] at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
[error] at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
[error] at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:288)
[error] at org.apache.ivy.util.url.URLHandlerDispatcher.upload(URLHandlerDispatcher.java:82)
[error] at org.apache.ivy.util.FileUtil.copy(FileUtil.java:150)
[error] at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:84)
[error] at sbt.internal.librarymanagement.ConvertResolver$LocalIfFileRepo.put(ConvertResolver.scala:407)
I don't yet know what the issue is, but poking around I found scala/scala-dev#783 (comment) and sbt/sbt-pgp#182. It seems that this is a way that incorrect credentials can manifest. I don't think the credentials are wrong as we have been using them for a long time. It is possible that someone at CHIPS Alliance changed something about the login account. I am still able to log in to https://s01.oss.sonatype.org so it doesn't seem like this is the actual cause, but I will reach out to CHIPS Alliance to check.
firtool-resolver (which uses mill for publishing but also publishes to the chips alliance organization) is also failing1, but with a slightly different message:
firtool-resolver[2.12].publishSigned java.lang.RuntimeException: Failed to publish firtool-resolver_2.12 to Sonatype. Errors:
Code: 401, message:
...
Code: 401, message:
mill.scalalib.publish.SonatypePublisher.reportPublishResults(SonatypePublisher.scala:178)
mill.scalalib.publish.SonatypePublisher.publishToUri(SonatypePublisher.scala:123)
Code 401 is an "unauthorized response" which means there's an issue with the credentials: https://www.sonatype.com/blog/2010/11/what-to-do-when-sonatype-nexus-returns-401.
So this is almost certainly an issue with our credentials.
Footnotes
I reached out to Sonatype support, they very promptly let me know that you now have to publish with user tokens as described on this page: https://central.sonatype.org/publish/generate-token/
I have fixed the secrets on this repo to use the token and publishing is working again!