question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProjectRef - unable to find valid certification path to requested target

See original GitHub issue

steps

To replicate, run the following in the terminal:

  1. git clone https://gitlab.com/andreaTP/sbt-ws -b 6
  2. cd sbt-ws
  3. sbt prjC/compile

problem

At Scala Italy 2018, @andreaTP gave us a (pretty awesome) workshop on SBT. Step 6 of the tutorial was demonstrating the use of ProjectRef: out of 24 people in the room, half of them were able to make it compile, the others got a nasty exception (stacktrace below). We couldn’t figure out how to fix this.

Danielas-MBP:sbt-ws danielasfregola$ sbt prjC/compile
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from /Users/danielasfregola/.sbt/1.0/plugins
[info] Loading project definition from /Users/danielasfregola/Development/scalaitaly/test/sbt-ws/project
[info] Updating ProjectRef(uri("file:/Users/danielasfregola/Development/scalaitaly/test/sbt-ws/project/"), "sbt-ws-build")...
[info] Done updating.
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project config-build from plugins.sbt ...
[info] Loading project definition from /Users/danielasfregola/.sbt/1.0/staging/b9b45b184f898acb1435/config/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project config from build.sbt ...
[info] Set current project to scalaitaly (in build file:/Users/danielasfregola/Development/scalaitaly/test/sbt-ws/)
[info] Updating ProjectRef(uri("https://github.com/lightbend/config.git#master"), "config")...
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: com.thoughtworks.paranamer#paranamer;2.4.1: Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer;2.4.1 {compile=[compile(*), master(compile)], runtime=[runtime(*)]}:: 
[warn] 	Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer-parent;2.4.1 {}:: 
[warn] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 
[warn] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer/2.4.1/paranamer-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn] 	Note: Unresolved dependencies path:
[warn] 		com.thoughtworks.paranamer:paranamer:2.4.1
[warn] 		  +- net.liftweb:lift-json_2.10:2.5 (/Users/danielasfregola/.sbt/1.0/staging/b9b45b184f898acb1435/config/config/build.sbt#L12-13)
[warn] 		  +- com.typesafe:config:1.3.0-2a103fe53f5ca78dd8e39db23541c678569b2a44
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.thoughtworks.paranamer#paranamer;2.4.1: Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer;2.4.1 {compile=[compile(*), master(compile)], runtime=[runtime(*)]}:: 
[error] 	Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer-parent;2.4.1 {}:: 
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer/2.4.1/paranamer-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 
[error] 	at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
[error] 	at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error] 	at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error] 	at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[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:77)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:238)
[error] 	at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193)
[error] 	at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:45)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106)
[error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89)
[error] 	at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120)
[error] 	at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2539)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[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.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:745)
[error] (ProjectRef(uri("https://github.com/lightbend/config.git#master"), "config") / update) sbt.librarymanagement.ResolveException: unresolved dependency: com.thoughtworks.paranamer#paranamer;2.4.1: Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer;2.4.1 {compile=[compile(*), master(compile)], runtime=[runtime(*)]}:: 
[error] 	Resolution failed several times for dependency: com.thoughtworks.paranamer#paranamer-parent;2.4.1 {}:: 
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer-parent;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer-parent/2.4.1/paranamer-parent-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 
[error] 	Scala Tools Snapshots: unable to get resource for com/thoughtworks/paranamer#paranamer;2.4.1: res=http://scala-tools.org/repo-snapshots/com/thoughtworks/paranamer/paranamer/2.4.1/paranamer-2.4.1.pom: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] Total time: 5 s, completed 15-Sep-2018 22:35:12

expectation

Everybody in the room should have been able to compile the code and download the dependency from the provided URI.

notes

Most of the people affected seem to be on MacOS. I am one of those affected and I can replicate independently of my wifi connection.

sbt version: 1.2.1 java version: 1.8.0_60

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
eed3si9ncommented, Sep 17, 2018

@DanielaSfregola Thanks for reporting this issue and providing useful hints. One of key info was “Sun Sep 16 20:38:22 UTC 2018”, which makes sense since you saw the issue trying to resolve it. Next, I dug into where Scala Tools Snapshots was coming from. sbt has never had that in the resolvers by default as far as I can remember. It turns out that it’s coming from Lightbend Config! (its build to be specific)

In other words, sbt is doing whatever Lightbend Config’s build is telling to do, so the build needs to be fixed. See https://github.com/lightbend/config/pull/589/commits/881611f1c74fb36b4e2364378a849b974c53dadc

0reactions
DanielaSfregolacommented, Sep 16, 2018

The installed sbt version on my machine is 1.1.2:

danielas-mbp:sbt-ws danielasfregola$ mkdir /tmp/freshname
danielas-mbp:sbt-ws danielasfregola$ cd /tmp/freshname/
danielas-mbp:freshname danielasfregola$ sbt about
[warn] No sbt.version set in project/build.properties, base directory: /private/tmp/freshname
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/danielasfregola/.sbt/1.0/plugins
[info] Updating ProjectRef(uri("file:/Users/danielasfregola/.sbt/1.0/plugins/"), "global-plugins")...
[info] Done updating.
[info] Set current project to freshname (in build file:/private/tmp/freshname/)
[info] This is sbt 1.1.2
[info] The current project is ProjectRef(uri("file:/private/tmp/freshname/"), "freshname") 0.1.0-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4

I do have a paranamer 2.4.1:

danielas-mbp:freshname danielasfregola$ cat ~/.ivy2/cache/com.thoughtworks.paranamer/paranamer/ivydata-2.4.1.properties
#ivy cached data file for com.thoughtworks.paranamer#paranamer;2.4.1
#Sun Sep 16 20:38:22 UTC 2018
artifact\:paranamer\#pom.original\#pom\#-1955542686.is-local=false
artifact\:paranamer\#pom.original\#pom\#-1955542686.exists=true
artifact\:paranamer\#pom.original\#pom\#-1955542686.location=https\://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.4.1/paranamer-2.4.1.pom
danielas-mbp:freshname danielasfregola$ 
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve "unable to find valid certification path to ... - JFrog
SunCertPathBuilderException: unable to find valid certification path to requested target: sun.security.validator.ValidatorException: This ...
Read more >
Error:Cause: unable to find valid certification path to requested ...
Follow Steps in the answer of below question "unable to find valid certification path to requested target", but browser says it's OK.
Read more >
Solve “unable to find valid certification path to requested target”
The problem appears with a cryptic error message “unable to find valid certification path to requested target''.
Read more >
sbt/sbt - Gitter
SunCertPathBuilderException: unable to find valid certification path to requested target (sun.security.validator.ValidatorException: PKIX path building ...
Read more >
Since updating to Intellij 2019, sbt-shell no longer works when ...
[info] Updating ProjectRef(uri("file:/home/user/.sbt/1.0/plugins/"), ... unable to find valid certification path to requested target
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found