# \[jsonrpc\] Server exited with status 1

**URL:** https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766
**Category:** Tooling
**Tags:** emacs, eglot
**Created:** [January 14, 2025, 2:29pm UTC](https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766 "2025-01-14T14:29:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 14, 2025, 2:29pm UTC](https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766/1 "2025-01-14T14:29:36Z")

</div>

A couple of weeks ago I started getting restarts with eglot & Julia in Emacs. The `*Messages*` buffer tells me that

```julia
[eglot] Connected! Server `EGLOT (TrustRegionMethods/(julia-mode ess-julia-mode julia-ts-mode))' now managing `(julia-mode ess-julia-mode julia-ts-mode)' buffers in project `TrustRegionMethods'.
[jsonrpc] Server exited with status 1
[Eglot] (warning) Reconnecting after unexpected server exit.
[eglot] Reconnected!
[eglot] Connected! Server `EGLOT (TrustRegionMethods/(julia-mode ess-julia-mode julia-ts-mode))' now managing `(julia-mode ess-julia-mode julia-ts-mode)' buffers in project `TrustRegionMethods'.
[jsonrpc] Server exited with status 1
[eglot] (warning) Reconnecting after unexpected server exit.
[eglot] Reconnected!
[eglot] Connected! Server `EGLOT (TrustRegionMethods/(julia-mode ess-julia-mode julia-ts-mode))' now managing `(julia-mode ess-julia-mode julia-ts-mode)' buffers in project `TrustRegionMethods'.
[jsonrpc] Server exited with status 1
[eglot] (warning) Reconnecting after unexpected server exit.
[eglot] Reconnected!
[eglot] Connected! Server `EGLOT (TrustRegionMethods/(julia-mode ess-julia-mode julia-ts-mode))' now managing `(julia-mode ess-julia-mode julia-ts-mode)' buffers in project `TrustRegionMethods'.
[jsonrpc] Server exited with status 1
[eglot] (warning) Reconnecting after unexpected server exit.
[eglot] Reconnected!

```

This repeats forever every few seconds. (This happens with all packages I am working on, example above uses TrustRegionMethods.jl but that is just an example.) Versions:

- eglot 1.17
- eglot-jl 20240911.1352
- Emacs 29.4
- Julia 1.11.2

Happy to debug this further, but I don’t know how to start.

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [January 14, 2025, 9:37pm UTC](https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766/2 "2025-01-14T21:37:21Z")

</div>

> [@Tamas\_Papp](#):
>
> Happy to debug this further, but I don’t know how to start.

You might be able to find more information in a buffer named `*EGLOT (xxxx) events*`

You’re mainly looking for lines starting with `[stderr]`, since this is the output of the Language Server. When it starts the LS, `eglot-jl` outputs something like:

```julia
[stderr] ┌ Info: Running language server
[stderr] │ env = "~/.emacs.d/elpa/eglot-jl-20240911.1352/Project.toml"
[stderr] │ src_path = "/path/to/the/sources"
[stderr] │ project_path = "/path/to/the/project"
[stderr] └ depot_path = ""

```

And when the LS itself starts, it outputs something like:

```julia
[stderr] ============== Startup timings ==============
[stderr] 0.0 - LS startup started (0.0s since last event)
[stderr] 0.0098 - connection established (0.0098s since last event)
[stderr] 0.083334 - (async) listening to client events (0.073534s since last event)
[stderr] 0.1215 - (async) listening to symbol server events (0.03817s since last event)
[stderr] 0.12159 - starting combined listener (8.893e-5s since last event)
[stderr] 0.14547 - symbols received (0.023874s since last event)
[stderr] 0.14675 - extended methods computed (0.001282s since last event)
[stderr] 0.14676 - project deps computed (9.0599e-6s since last event)
[stderr] 0.14676 - env map computed (9.5367e-7s since last event)
[stderr] 0.14676 - initial lint done (5.0068e-6s since last event)
[stderr] 0.19734 - LSP/initialize (0.050572s since last event)
[stderr] 1.6691 - LSP/initialized (1.4717s since last event)
[stderr] =============================================

```

Do you find such stanzas? Are they followed by error messages?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 15, 2025, 11:59am UTC](https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766/3 "2025-01-15T11:59:38Z")

</div>

Thanks for your quick reply. In fact LS does not seem to start, it claims a parsing error, though [the file](https://github.com/tpapp/TrustRegionMethods.jl/blob/a8a7985eef3cb700373016007d75d0258dedb91c/src/API.jl) should be valid Julia 1.11 code. See the [log](https://gist.github.com/tpapp/eb4e4ec3b0bedc2cb15aa46271d4aadc), I am unable to narrow it down to anything specific.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 15, 2025, 12:39pm UTC](https://discourse.julialang.org/t/jsonrpc-server-exited-with-status-1/124766/4 "2025-01-15T12:39:47Z")

</div>

I found the root cause, it is

> <https://github.com/julia-vscode/LanguageServer.jl/issues/1342>
>
> \`\`\`
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- "ERROR…: Indexing 1:28 public( )\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " 1:21 is\_low\_level\_intent at 1\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- "Stacktrace:\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[1\] error(s::String)\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ Base ./error.jl:35\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[2\] \_getindex(x::CSTParser.EXPR, i::Int64)\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ CSTParser.Iterating ~/.julia/packages/CSTParser/0hXvH/src/iterate.jl:186\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[3\] getindex(x::CSTParser.EXPR, i::Int64)\\n"
> 2025-01-10T15:59:14.454 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ CSTParser.Iterating ~/.julia/packages/CSTParser/0hXvH/src/iterate.jl:6\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[4\] collect\_hints(x::CSTParser.EXPR, env::StaticLint.ExternalEnv, missingrefs::Symbol, isquoted::Bool, errs::Vector{Tuple{Int64, CSTParser.EXPR}}, pos::Int64) (repeats 4 times)\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ StaticLint ~/.julia/packages/StaticLint/vmUKQ/src/linting/checks.jl:635\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[5\] collect\_hints(x::CSTParser.EXPR, env::StaticLint.ExternalEnv, missingrefs::Symbol)\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ StaticLint ~/.julia/packages/StaticLint/vmUKQ/src/linting/checks.jl:612\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[6\] mark\_errors(doc::LanguageServer.Document, out::Vector{LanguageServer.Diagnostic})\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/requests/textdocument.jl:139\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[7\] lint!(doc::LanguageServer.Document, server::LanguageServerInstance)\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/staticlint.jl:77\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[8\] textDocument\_didChange\_notification(params::LanguageServer.DidChangeTextDocumentParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})\\n"
> 2025-01-10T15:59:14.455 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/requests/textdocument.jl:106\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[9\] (::LanguageServer.var\\"#116#117\\"{typeof(LanguageServer.textDocument\_didChange\_notification), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.DidChangeTextDocumentParams)\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:273\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[10\] dispatch\_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ JSONRPC ~/.julia/packages/JSONRPC/RIWyo/src/typed.jl:67\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[11\] run(server::LanguageServerInstance; timings::Vector{Any})\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:405\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[12\] run\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ ~/.julia/packages/LanguageServer/Fwm1f/src/languageserverinstance.jl:283 \[inlined\]\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[13\] runserver(pipe\_in::Base.PipeEndpoint, pipe\_out::Base.PipeEndpoint, env\_path::String, depot\_path::String, err\_handler::Nothing, symserver\_store\_path::Nothing)\\n"
> 2025-01-10T15:59:14.464 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:41\\n"
> 2025-01-10T15:59:14.465 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[14\] runserver()\\n"
> 2025-01-10T15:59:14.465 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ LanguageServer ~/.julia/packages/LanguageServer/Fwm1f/src/runserver.jl:39\\n"
> 2025-01-10T15:59:14.465 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " \[15\] top-level scope\\n"
> 2025-01-10T15:59:14.465 helix\_lsp::transport \[ERROR\] julia-lsp err \<- " @ none:1\\n"
> 2025-01-10T15:59:14.684 helix\_lsp::transport \[ERROR\] julia-lsp err: \<- StreamClosed
> \`\`\`
> 
> \`\`\`julia
> (@helix-lsp) pkg\> st
> Status \`~/.julia/environments/helix-lsp/Project.toml\`
> \[2b0e0bc5\] LanguageServer v4.5.1
> 
> julia\> versioninfo()
> Julia Version 1.11.2
> Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
> Build Info:
> Official https://julialang.org/ release
> Platform Info:
> OS: Linux (x86\_64-linux-gnu)
> CPU: 32 × AMD Ryzen 9 7945HX with Radeon Graphics
> WORD\_SIZE: 64
> LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
> Threads: 1 default, 0 interactive, 1 GC (on 32 virtual cores)
> \`\`\`
> 
> I think it's similar to the problem described here
> https://github.com/julia-vscode/LanguageServer.jl/issues/1224#issuecomment-2552151276

Using Compat.jl while it is fixed.
