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!

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