Can't start repl with Leiningen

1,635 views
Skip to first unread message

Matej Fröbe

unread,
Feb 23, 2014, 4:32:54 PM2/23/14
to clo...@googlegroups.com
Hello Clojure users!

I have a problem with running
$lein repl
After some time I get: REPL server launch timed out.

$lein run myproject
works fine

Leiningen and Java versions are:
$lein version
Leiningen 2.3.4 on Java 1.7.0_21 OpenJDK Client VM


I tried deleting stuff in ~/.lein but it doesn't help.

Any suggestions how to solve this?

Thanks,

Matej

John Gabriele

unread,
Feb 25, 2014, 1:51:51 PM2/25/14
to clo...@googlegroups.com

Hi Matej,

Have never seen this problem. You might try starting fresh by deleting your local repo (~/.m2) too, and re-downloading the `lein` script.

-- John

Matej Fröbe

unread,
Feb 25, 2014, 2:56:04 PM2/25/14
to clo...@googlegroups.com
Hi John,

Thank you for your answer. I have tried this already, but it doesn't help.

Any other suggestions, how to find the cause of the problem?

Matej

Zach Oakes

unread,
Feb 25, 2014, 3:16:31 PM2/25/14
to clo...@googlegroups.com
Matej, does this happen to you when you run "lein repl" outside of a project? If so, can you show us what your project.clj file looks like? I know for a fact that if you have ":eval-in :trampoline" in it, the repl will fail with that error.

Matej Fröbe

unread,
Feb 26, 2014, 3:19:43 AM2/26/14
to clo...@googlegroups.com
It seems that this is independent of where I run the project. It happens with default project, which has no ":eval-in :trampoline" in it:

$ lein new my-project
$ cat my-project/project.clj
(defproject my-project "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]])

$ cd my-project/
$ lein repl

REPL server launch timed out.

And it also happens if I run lein repl outside of any project.

I have already used repl on this machine in the past and I noticed the problem when I tried to use cider. I just assumed that the problem was in emacs packages (I think I tried cider instead of nrepl at the time) but didn't have time to check. Now I see that I can't even run repl with leiningen.

I suspect some update of some package (jdk maybe?). I didn't find anything in apt-get and dpkg logs, but they might not cover long enough time range. The problem is that I don't know when did this start, as I almost didn't use clojure in the last two months.

John Gabriele

unread,
Feb 26, 2014, 9:50:19 AM2/26/14
to clo...@googlegroups.com
On Wednesday, February 26, 2014 3:19:43 AM UTC-5, Matej Fröbe wrote:
It seems that this is independent of where I run the project.


Matej,

What OS (and version) are you using?
 

Matej Fröbe

unread,
Feb 26, 2014, 12:28:42 PM2/26/14
to clo...@googlegroups.com
Debian jessie 32-bit

Armando Blancas

unread,
Feb 26, 2014, 1:52:49 PM2/26/14
to clo...@googlegroups.com
I had the same problem with an old box I had around the house. Put Fedora 20 on it with a recent open jdk, but had just 1GB of memory total. I attributed the error to the lower memory since I never have that issue at work or other machines with at least 4GB. If you have more than 2GB, experiment with something like -Xms1024M or more.

Matej Fröbe

unread,
Feb 26, 2014, 3:05:53 PM2/26/14
to clo...@googlegroups.com
I only have 2GB. I tried adding -Xms1024M (and some lower and higher values) to the java command in lein script, but it didn't help.

Zach Oakes

unread,
Feb 26, 2014, 3:36:39 PM2/26/14
to clo...@googlegroups.com
Is their a reason your OpenJDK install is only on update 21? I believe the most recent is 51, though I doubt that is the problem. I also doubt it's a memory issue; I can run the REPL just fine on a netbook with 1GB of RAM running Ubuntu x64.

Matej Fröbe

unread,
Feb 26, 2014, 4:10:57 PM2/26/14
to clo...@googlegroups.com
#apt-get update
#apt-cache show openjdk-7-jre
Package: openjdk-7-jre
Source: openjdk-7
Version: 7u21-2.3.9-5
...


So if I understand correctly (I'm more or less a Linux newbie), this means that "update 21" is the version in distro's repositories.

Matej Fröbe

unread,
Mar 2, 2014, 5:27:05 AM3/2/14
to clo...@googlegroups.com
I found the problem more or less. "lein repl" works if I set iptables rule:
#iptables -P INPUT ACCEPT

What I don't understand is, why it worked already in the past with these rules:
#iptables -P INPUT DROP
#iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
but now it doesn't.

The call to nrepl.ack/wait-for-ack in repl.clj (https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj) wasn't succesfull with the stricter rules.
Reply all
Reply to author
Forward
0 new messages