sbt / sbt-pgp

PGP plugin for sbt
Other
144 stars 56 forks source link

Server redirected too many times #182

Closed gaeljw closed 4 years ago

gaeljw commented 4 years ago

steps

sbt-pgp version: 2.0.1 sbt version: 1.3.13

problem

I'm trying to setup the publishing of a project to Sonatype using sbt-sonatype but I'm stuck when running the commande sbt +publishSigned with the following error "Server redirected too many times".

The thing is I have no clue of which server we are talking about, I guess sonatype? But then what could be the cause of those redirects?

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:62)
[error]         at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error]         at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
[error]         at java.base/java.security.AccessController.doPrivileged(Native Method)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1512)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1510)
[error]         at java.base/java.security.AccessController.doPrivileged(Native Method)
[error]         at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:795)
[error]         at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
[error]         at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
[error]         at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:285)
[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:368)
[error]         at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
[error]         at sbt.internal.librarymanagement.ConvertResolver$ChecksumFriendlyURLResolver.put(ConvertResolver.scala:118)
[error]         at sbt.internal.librarymanagement.ConvertResolver$ChecksumFriendlyURLResolver.put$(ConvertResolver.scala:105)
[error]         at sbt.internal.librarymanagement.ConvertResolver$$anonfun$defaultConvert$lzycompute$1$PluginCapableResolver$1.put(ConvertResolver.scala:165)
[error]         at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$5(IvyActions.scala:501)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$5$adapted(IvyActions.scala:500)
[error]         at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:877)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:941)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:941)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:876)
[error]         at sbt.internal.librarymanagement.IvyActions$.publish(IvyActions.scala:500)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$3(IvyActions.scala:142)
[error]         at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error]         at sbt.internal.librarymanagement.IvyActions$.withChecksums(IvyActions.scala:156)
[error]         at sbt.internal.librarymanagement.IvyActions$.withChecksums(IvyActions.scala:149)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1(IvyActions.scala:142)
[error]         at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1$adapted(IvyActions.scala:132)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:251)
[error]         at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:215)
[error]         at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:77)
[error]         at sbt.internal.librarymanagement.IvySbt$$anon$1.call(Ivy.scala:87)
[error]         at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error]         at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error]         at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error]         at xsbt.boot.Using$.withResource(Using.scala:10)
[error]         at xsbt.boot.Using$.apply(Using.scala:9)
[error]         at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error]         at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error]         at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]         at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]         at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:87)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:209)
[error]         at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:206)
[error]         at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:250)
[error]         at sbt.internal.librarymanagement.IvyActions$.publish(IvyActions.scala:132)
[error]         at sbt.Classpaths$.$anonfun$publishTask$4(Defaults.scala:2814)
[error]         at sbt.Classpaths$.$anonfun$publishTask$4$adapted(Defaults.scala:2814)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:290)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]         at java.base/java.lang.Thread.run(Thread.java:834)

expectation

Be able to run publishSigned without errors.

notes

Please note I'm not really familiar yet with the Sonatype publish process.

It could also be a local setup issue as I run the commandes from within a Docker container but I have no hint of what could be the issue.

Any help appreciated, thanks :)

gaeljw commented 4 years ago

Silly mistake.. I was using wrong credentials for Sonatype :facepalm: Not an sbt-pgp issue!

malcyon commented 3 years ago

Silly mistake.. I was using wrong credentials for Sonatype Not an sbt-pgp issue!

This was my issue as well. Thanks for the solution!

djx314 commented 1 year ago

Silly mistake.. I was using wrong credentials for Sonatype 🤦 Not an sbt-pgp issue!

The same as me. Thanks a lot!

raboof commented 1 year ago

It would be good to provide better feedback in this scenario. That seems like an upstream opportunity for improvement, filed https://issues.apache.org/jira/browse/IVY-1643

michaelmior commented 5 months ago

I'm getting this same error after confirming that my credentials are correct. "show credentials" displays the correct username and server. The password is masked, but I confirmed in the file that it is correct and I'm able to log in using the web interface with these credentials.

duantihua commented 5 months ago

I used User Token in the configuration file to replace the previous plaintext username and password, and it was successfully published.