problems using leiningen on Ubuntu 14.10 (and solved)

383 views
Skip to first unread message

Ryan Waters

unread,
Mar 14, 2015, 2:18:50 PM3/14/15
to Clojure
What follows is an issue I was having with leiningen on a couple new linux installations.

This writeup is only tangentially related to Clojure but I wanted to email it out there for others who may run into this same issue.  The following is relevant for Debian (Jessie) and Ubuntu Server 14.10 as of today.  I forget which openjdk I was using on debian but on ubuntu it's openjdk-8-jdk.  I'm also using Leiningen 2.5.1 which I installed via the lein bash script method.

PROBLEM:

I would get the following when running 'lein deps' within one of my project directories:
-------------------------------------------
Could not transfer artifact lein-cljsbuild:lein-cljsbuild:pom:1.0.3 from/to central (https://repo1.maven.org/maven2/): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
-------------------------------------------

Some searches suggested I might have an empty java keystore which turned out to be the case:
-------------------------------------------
keytool -list -keystore /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/security/cacerts -v
Enter keystore password:  

...

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 0 entries
-------------------------------------------

SOLUTION:

An explanation of the root problem with a resolution can be found here:

In short, it appears the keystore generation script that should run after a jdk ubuntu+debian package is installed doesn't end up running when it needs to, so one must:

-------------------------------------------
root@gl:~# rm /etc/ssl/certs/java/cacerts
root@gl:~# /var/lib/dpkg/info/ca-certificates-java.postinst configure
-------------------------------------------

Again, all credit to 'justus.berlin' for this fix.

- - -

Sidenote - I had an unrelated problem with wget and curl connecting to /any/ SSL website under Debian Jessie, even with 'ca-certificates' package installed.  That's just lame.

Anyway, I hope this helps save somebody some time and/or bumps up google search results for the link above.

Thanks,
Ryan

Dieter Van Eessen

unread,
Apr 15, 2018, 4:06:19 AM4/15/18
to Clojure
Perhaps an extra sidenote:

Installed leiningen 2.8 through package manager (debian), it installed openjdk-9 automatically. Had the same issue.
Downgrading to openjdk-8 fixed the issue. Did this after i read about some bug on https://bugs.openjdk.java.net/browse/JDK-8189357

IMPORTANT: if you try this: first PURGE both 'openjdk-9-jdk' AND 'ca-certificates-java'. If you dont purge ca-certificates-java, problem persists. I assume the issue has to do with an upgraded version of 'ca-certificates-java'. If this packages is installed as dependency of openjdk-8, then problem is solved.

hope it helps.

kind regards,
Dieter
Reply all
Reply to author
Forward
0 new messages