Solved: Jsonnet Language Server in Zed Failed to Start


Since some update recently my Zed editor on my Macbook had trouble to start the Jsonnet language server, so the syntax validation and auto-complete are gone. I had a look at the error message but it didn’t really hinted anything:

Language server error: jsonnet-language-server

failed to spawn command. path: "/Users/raynix/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1/jsonnet-language-server", working directory: "/Users/raynix/Documents/so-kube-manifests", args: ["--log-level", "info"]
-- stderr--

At least it told me where the server’s binary is located. So I went to that location using my terminal

~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ ls -lht
total 10464
-rw-r--r--@ 1 raynix raynix   5.1M 23 Sep 11:17 jsonnet-language-server

# have you spotted the issue? Yes it's not executable
~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ chmod +x jsonnet-language-server
~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ ls -lht
total 10464
-rwxr-xr-x@ 1 raynix raynix   5.1M 23 Sep 11:17 jsonnet-language-server

# time to see if it can run
~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ ./jsonnet-language-server
[1]    90314 killed     ./jsonnet-language-server

# it just got killed silently. I wonder if the binary is corrupted so I downloaded it again from github
# and try it again
~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ ./jsonnet-language-server
[1]    90834 killed     ./jsonnet-language-server

# this time it did a popup saying Apple can't trust this developer

It’s very clear now that Apple would not let me or my Zed editor to run this binary because the developer is not trusted. Following Apple’s documentation how to run a binary from untrusted developer and I can run it in the terminal at the end

~/Library/Application Support/Zed/extensions/work/jsonnet/jsonnet-language-server-v0.14.1 ᐅ ./jsonnet-language-server
INFO[0000] Starting the language server
...

After restarting the language server in Zed, everything is back to normal!

Just a fair warning that one should not just trust any app downloaded from the Internet or Github even. It would be good to use some reputable anti-virus app to scan the binary before giving it the trust.

🙂

,