DAML Extension error message: The DAML language server crashed 5 times in last 3 minutes. The server will not be restarted

I am following the ‘Introduction to DAML’ course and getting this error message when opening Main.daml from VS code. I have tried installing/uninstalling the DAML extension multiple times. Any help will be greatly appreciated!

1 Like

Hi @Neelam_Dwivedi and welcome to the forum!

Please go to View -> Output in VScode and then select Daml Language Server in the drop down at the bottom right and share all output with us.

Here you go:

2022-08-30 18:47:03.50 [INFO] [LanguageServer]
Flushed 0 logs
damlc: ScenarioServiceException “Failed to run java: bin/java: readCreateProcessWithExitCode: posix_spawnp: illegal operation (Inappropriate ioctl for device)”
[Info - 2:47:03 PM] Connection to server got closed. Server will restart.

2022-08-30 18:47:03.63 [INFO] [LanguageServer]
Flushed 0 logs
damlc: ScenarioServiceException “Failed to run java: bin/java: readCreateProcessWithExitCode: posix_spawnp: illegal operation (Inappropriate ioctl for device)”
[Info - 2:47:03 PM] Connection to server got closed. Server will restart.

2022-08-30 18:47:03.77 [INFO] [LanguageServer]
Flushed 0 logs
damlc: ScenarioServiceException “Failed to run java: bin/java: readCreateProcessWithExitCode: posix_spawnp: illegal operation (Inappropriate ioctl for device)”
[Info - 2:47:03 PM] Connection to server got closed. Server will restart.

2022-08-30 18:47:03.93 [INFO] [LanguageServer]
Flushed 0 logs
damlc: ScenarioServiceException “Failed to run java: bin/java: readCreateProcessWithExitCode: posix_spawnp: illegal operation (Inappropriate ioctl for device)”
[Info - 2:47:03 PM] Connection to server got closed. Server will restart.

2022-08-30 18:47:04.08 [INFO] [LanguageServer]
Flushed 0 logs
damlc: ScenarioServiceException “Failed to run java: bin/java: readCreateProcessWithExitCode: posix_spawnp: illegal operation (Inappropriate ioctl for device)”
[Error - 2:47:04 PM] Connection to server got closed. Server will not be restarted.

That looks like JAVA_HOME is set but it is set to an empty string. Try unsetting it completely and relying on Java being in PATH or alternatively fix it so that it points to your Java installation. It is probably configured in one of these files: ~/.bash_profile, ~/.bashrc, ~/.zshrc, /etc/profile.

Thank you! Problem solved!

1 Like

Facing similar issue , Any help will be greatly appreciated.

JAVA_HOME needs to be set to /usr/lib/jvm/java-11topenjdk-amd64 without the /bin/java at the end.

I’m also facing the same issue, java home is set to usr/bin/java and path is set to /home/ayush/.daml/bin:/home/ayush/.daml/bin:/home/ayush/.daml/bin:/home/ayush/.daml/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
Thanks.

in $JAVA_HOME, its shows /usr/lib/jvm/java-1.11.0-openjdk-amd64
but in output of DAML server crash:
ScenarioServiceException “Failed to run java: /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: readCreateProcessWithExitCode: runInteractiveProcess: exec: does not exist (No such file or directory)”

from where do I delete /bin/java… I didn’t find it in $JAVA_HOME
Its shows in - where java:
/usr/bin/java
/bin/java

Do i delete it from there and how ?