Cannot execute: Command failed when executing /usr/bin/clojure-1.10

134 views
Skip to first unread message

Dennis Schridde

unread,
Feb 24, 2021, 6:26:56 AM2/24/21
to cur...@googlegroups.com
Hi!

When navigating to {Settings > Build, Execution, Deployment > Build Tools >
Clojure Deps}, enabling "use CLI tools" and setting the "Path to 'clojure'
command" to `/usr/bin/clojure-1.10`, the config page displays "Command failed"
and I get the following error message in the Event Log:
```
Cannot execute: Command failed when executing /usr/bin/clojure-1.10: Cannot
execute: Command failed when executing /usr/bin/clojure-1.10
```

I would like to know why the "command failed" and what "cannot execute" means.

I can successfully execute the command in IntelliJ's terminal:
```
$ which clojure-1.10
/usr/bin/clojure-1.10
$ clojure-1.10
Clojure 1.10.2
user=>
```

Best regards,
Dennis
signature.asc

Dennis Schridde

unread,
Mar 9, 2021, 3:48:46 AM3/9/21
to cur...@googlegroups.com
I made a little bit of progress on this by looking at `idea.log`. It turned
out that `/usr/bin/clojure-1.10` was essentially just calling `clojure.main`
and did not support arguments like `-Sdescribe` at all.

I hence switched to the CLI tools and `-Sdescribe` works now:

❯ clojure -Sdescribe
{:version "1.10.2.796"
:config-files ["/usr/share/clojure/deps.edn" "/home/dschridde/.clojure/
deps.edn" ]
:config-user "/home/dschridde/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/usr"
:config-dir "/home/dschridde/.clojure"
:cache-dir "/home/dschridde/.clojure/.cpcache"
:force false
:repro false
:main-aliases ""
:repl-aliases ""}

But when setting the "Path to 'clojure' command" all I get is a spinner. When
changing the contents of the `deps.edn` file and clicking "import" in the
popup that appears, the "Synchronizing Clojure Deps project" background task
starts but never completes. Pressing the (X) to "cancel" has no effect.

Running `clojure -Stree` in the project directory, I noticed that my
`deps.edn` had a syntax error:
```
Error building classpath. Error reading edn. Map literal must contain an even
number of forms (.../deps.edn)
```

Fixing that (`clojure -Stree` generates outputs without warnings now) did not
have any effect on the spinner in the settings or on the background task (they
still appear and never vanish).

Any hints on how to further debug this are appreciated.

--Dennis
signature.asc

Colin Fleming

unread,
Mar 10, 2021, 3:13:26 AM3/10/21
to Cursive Group
Hi Dennis,

This is very strange, and I can't see what might cause this. One thing you could try is to go to Help | Diagnostic Tools | Debug Log Settings, then add #cursive.deps.DepsSettings to the box there. If you then reproduce the problem, do you see anything further in the log? In particular, you might see something like "Output from <path to command>: <something>". Do you see anything like that?

Cheers,
Colin
> --
> You received this message because you are subscribed to the Google
> Groups "Cursive" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cursive+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cursive/8585606.vO8fz80ZRA%40ernie.
>
> Attachments:
> * signature.asc

Dennis Schridde

unread,
Mar 10, 2021, 3:53:54 AM3/10/21
to Cursive Group, Colin Fleming
Hi Colin!

Thanks for taking a look!

On Mittwoch, 10. März 2021 09:13:01 CET Colin Fleming wrote:
> This is very strange, and I can't see what might cause this. One thing you
> could try is to go to Help | Diagnostic Tools | Debug Log Settings, then
> add #cursive.deps.DepsSettings to the box there. If you then reproduce the
> problem, do you see anything further in the log? In particular, you might
> see something like "Output from <path to command>: <something>". Do you see
> anything like that?

After I enabled the debug log, I went to the settings, saw the spinner again,
then took a look into the idea.log:

2021-03-10 09:49:37,800 [ 83827] INFO - lij.diagnostic.DebugLogManager -
Set DEBUG for the following categories: #cursive.deps.DepsSettings
2021-03-10 09:49:37,801 [ 83828] INFO - lij.diagnostic.DebugLogManager -
Set TRACE for the following categories: #com.jetbrains.rdserver.requests,
#com.jetbrains.rd.ide.document, #com.jetbrains.rdserver.document,
#com.jetbrains.rdserver.editors, #com.jetbrains.rdserver.actions
2021-03-10 09:50:00,323 [ 106350] INFO - .diagnostic.PerformanceWatcher -
Unindexed files update took 30319ms; general responsiveness: ok; EDT
responsiveness: 1/31 sluggish, 2/31 very slow
2021-03-10 09:50:02,106 [ 108133] INFO - rationStore.ComponentStoreImpl -
Saving appFileTypeManager took 24 ms, RecentProjectsManager took 21 ms
2021-03-10 09:50:02,801 [ 108828] INFO - rationStore.ComponentStoreImpl -
Saving Project(name=..., containerState=COMPONENT_CREATED,
componentStore=...)XDebuggerManager took 18 ms
2021-03-10 09:50:02,835 [ 108862] INFO - mponents.impl.stores.StoreUtil -
saveProjectsAndApp took 1427 ms
2021-03-10 09:50:04,133 [ 110160] INFO - STDERR -
Tried to load org.apache.httpcomponents/httpcore version 4.4.13 but 4.4.11 was
already loaded.
2021-03-10 09:50:04,134 [ 110161] INFO - STDERR -
Tried to load org.tcrawley/dynapath version 0.2.3 but 1.0.0 was already
loaded.
2021-03-10 09:50:04,134 [ 110161] INFO - STDERR -
Tried to load org.apache.httpcomponents/httpclient version 4.5.13 but 4.5.8
was already loaded.
2021-03-10 09:50:04,135 [ 110162] INFO - STDERR -
Tried to load commons-codec version 1.10 but 1.11 was already loaded.
2021-03-10 09:50:06,158 [ 112185] INFO - pl.ProjectRootManagerComponent -
project roots have changed (trace_hash = 333405622)
java.lang.Throwable
at
com.intellij.openapi.roots.impl.ProjectRootManagerComponent.synchronizeRoots(ProjectRootManagerComponent.java:
305)
at
com.intellij.openapi.roots.impl.ProjectRootManagerComponent.fireRootsChangedEvent(ProjectRootManagerComponent.java:
205)
at
com.intellij.openapi.roots.impl.ProjectRootManagerImpl.fireRootsChanged(ProjectRootManagerImpl.java:
459)
at
com.intellij.openapi.roots.impl.ProjectRootManagerImpl$1.fireRootsChanged(ProjectRootManagerImpl.java:
146)
at
com.intellij.openapi.roots.impl.ProjectRootManagerImpl$1.fireRootsChanged(ProjectRootManagerImpl.java:
143)
at
com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:
113)
at
com.intellij.workspaceModel.ide.impl.legacyBridge.project.ProjectRootsChangeListener.changed(ProjectRootsChangeListener.kt:
34)
at
com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleManagerComponentBridge$2.changed(ModuleManagerComponentBridge.kt:
179)
at
com.intellij.workspaceModel.ide.WorkspaceModelTopics$EventsDispatcher.changed(WorkspaceModelTopics.kt:
107)
at jdk.internal.reflect.GeneratedMethodAccessor145.invoke(Unknown
Source)
at java.base/
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at
com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:
652)
at
com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:
426)
at
com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:
401)
at
com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:
383)
at
com.intellij.util.messages.impl.MessageBusImpl.access$100(MessageBusImpl.java:
33)
at
com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:
189)
at com.sun.proxy.$Proxy65.changed(Unknown Source)
at
com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.onChanged(WorkspaceModelImpl.kt:
90)
at
com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.access$onChanged(WorkspaceModelImpl.kt:
22)
at
com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$2.invoke(WorkspaceModelImpl.kt:
68)
at
com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl$updateProjectModel$2.invoke(WorkspaceModelImpl.kt:
22)
at
com.intellij.workspaceModel.storage.impl.VersionedEntityStorageImpl.replace(VersionedEntityStorageImpl.kt:
160)
at
com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.updateProjectModel(WorkspaceModelImpl.kt:
68)
at
com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleBridgeImpl$setOption$2.run(ModuleBridgeImpl.kt:
124)
at
com.intellij.openapi.application.WriteAction.lambda$runAndWait$1(WriteAction.java:
133)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:
988)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:
1014)
at
com.intellij.openapi.application.WriteAction.computeAndWait(WriteAction.java:
148)
at
com.intellij.openapi.application.WriteAction.runAndWait(WriteAction.java:132)
at
com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleBridgeImpl.setOption(ModuleBridgeImpl.kt:
123)
at
cursive.leiningen.sync$set_leiningen_BANG_.invokeStatic(sync.clj:48)
at cursive.leiningen.sync$set_leiningen_BANG_.invoke(sync.clj:47)
at cursive.leiningen.sync$sync_modules_BANG_.invokeStatic(sync.clj:
96)
at cursive.leiningen.sync$sync_modules_BANG_.invoke(sync.clj:88)
at cursive.leiningen.sync$sync$fn__14746.invoke(sync.clj:157)
at cursive.leiningen.sync$sync.invokeStatic(sync.clj:144)
at cursive.leiningen.sync$sync.invoke(sync.clj:134)
at clojure.lang.Var.invoke(Var.java:393)
at cursive.api.DelayedFn.invoke(DelayedFn.java:41)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$
$inlined$synchronized$lambda$1$1.invoke(BuildSystemManager.kt:159)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$
$inlined$synchronized$lambda$1$1.invoke(BuildSystemManager.kt:36)
at
cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
at
com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:
216)
at
com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:
24)
at
com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:
199)
at
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:
822)
at
com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:
324)
at
com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
at
com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:
134)
at
com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at
com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:
190)
at java.desktop/
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native
Method)
at java.base/
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:
85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:
746)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
at
com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:
773)
at
com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:
822)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:
501)
at java.desktop/
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
203)
at java.desktop/
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
113)
at java.desktop/
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/
java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2021-03-10 09:50:06,180 [ 112207] INFO - pl.ProjectRootManagerComponent -
project roots have changed (stacktrace has been already reported with
trace_hash = 333405622)
2021-03-10 09:50:06,187 [ 112214] INFO - pl.ProjectRootManagerComponent -
project roots have changed (stacktrace has been already reported with
trace_hash = 333405622)
2021-03-10 09:50:06,378 [ 112405] INFO - pl.ProjectRootManagerComponent -
project roots have changed (stacktrace has been already reported with
trace_hash = 333405622)
2021-03-10 09:50:06,385 [ 112412] INFO - pl.ProjectRootManagerComponent -
project roots have changed (stacktrace has been already reported with
trace_hash = 333405622)
2021-03-10 09:50:06,391 [ 112418] INFO - pl.ProjectRootManagerComponent -
project roots have changed (stacktrace has been already reported with
trace_hash = 333405622)
2021-03-10 09:50:06,481 [ 112508] INFO - pl.ProjectRootManagerComponent -
some project roots were removed
2021-03-10 09:50:06,663 [ 112690] INFO - .diagnostic.PerformanceWatcher -
Pushing properties took 162ms; general responsiveness: ok; EDT responsiveness:
ok
2021-03-10 09:50:07,551 [ 113578] INFO - .diagnostic.PerformanceWatcher -
Indexable file iteration took 888ms; general responsiveness: ok; EDT
responsiveness: ok
2021-03-10 09:50:07,562 [ 113589] INFO - indexing.UnindexedFilesUpdater -
Unindexed files update started: 0 files to index
signature.asc

Colin Fleming

unread,
Mar 11, 2021, 5:06:25 AM3/11/21
to Cursive Group
Hi Dennis,

Thanks for that. There's something strange there, the stack trace there is not actually an exception, it's just flagging where Cursive is requesting the indexes be rebuilt, but it's coming from the lein support. Is this a project that has both lein and deps modules in it? Or did you have another lein project open at the same time?

Otherwise, it doesn't help diagnosing the endless spinning. Could you reproduce the problem and then take a thread dump during the spinning? There's some doc here about how to do that: https://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond. You can email that to me either here or off-list if you'd prefer.

Cheers,
Colin
> --
> You received this message because you are subscribed to the Google
> Groups "Cursive" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cursive+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cursive/3895255.KJFTCUTFQK%40ernie.
>
> Attachments:
> * signature.asc

Dennis Schridde

unread,
Mar 25, 2021, 4:36:34 PM3/25/21
to Cursive Group, Colin Fleming
Hello everyone!

Thanks to Colin explaining to me how Cursive's support for Clojure CLI works,
we were able to get to the root of this. It turned out that this was caused
by a non-standard installation:

On Tue, Mar 9, 2021, at 8:48 AM, Dennis Schridde wrote:
> ❯ clojure -Sdescribe
> {[...]
> :install-dir "/usr"
> [...]}

Since Cursive scans the `:install-dir` for the Clojure JAR, and /usr contains
about a million files, this takes very long (and potentially gets stuck in
cyclic symlinks). Fixing the installation to a more narrow `:install-dir`
solved the problem.

Thanks, Colin, for the great support!

--Dennis
signature.asc
Reply all
Reply to author
Forward
0 new messages