Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LanguageServer fails to start #20

Closed
mguzmann opened this issue Feb 4, 2021 · 7 comments
Closed

LanguageServer fails to start #20

mguzmann opened this issue Feb 4, 2021 · 7 comments

Comments

@mguzmann
Copy link

mguzmann commented Feb 4, 2021

I am trying to use the LanguageServer with Emacs and julia 1.6. I am getting the following error when I call eglot.

[client-request] (id:1) Thu Feb  4 11:08:29 2021:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
	  (:processId 95397 :rootPath "/home/matias/Documentos/Program/julia/" :rootUri "file:///home/matias/Documentos/Program/julia/" :initializationOptions #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
																					     ())
		      :capabilities
		      (:workspace
		       (:applyEdit t :executeCommand
				   (:dynamicRegistration :json-false)
				   :workspaceEdit
				   (:documentChanges :json-false)
				   :didChangeWatchedFiles
				   (:dynamicRegistration t)
				   :symbol
				   (:dynamicRegistration :json-false)
				   :configuration t)
		       :textDocument
		       (:synchronization
			(:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
			:completion
			(:dynamicRegistration :json-false :completionItem
					      (:snippetSupport :json-false)
					      :contextSupport t)
			:hover
			(:dynamicRegistration :json-false :contentFormat
					      ["markdown" "plaintext"])
			:signatureHelp
			(:dynamicRegistration :json-false :signatureInformation
					      (:parameterInformation
					       (:labelOffsetSupport t)))
			:references
			(:dynamicRegistration :json-false)
			:definition
			(:dynamicRegistration :json-false)
			:declaration
			(:dynamicRegistration :json-false)
			:implementation
			(:dynamicRegistration :json-false)
			:typeDefinition
			(:dynamicRegistration :json-false)
			:documentSymbol
			(:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind
					      (:valueSet
					       [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))
			:documentHighlight
			(:dynamicRegistration :json-false)
			:codeAction
			(:dynamicRegistration :json-false :codeActionLiteralSupport
					      (:codeActionKind
					       (:valueSet
						["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
					      :isPreferredSupport t)
			:formatting
			(:dynamicRegistration :json-false)
			:rangeFormatting
			(:dynamicRegistration :json-false)
			:rename
			(:dynamicRegistration :json-false)
			:publishDiagnostics
			(:relatedInformation :json-false))
		       :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
						   ()))))
[stderr]    Installed SymbolServer ─ v5.1.0
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: (Type{T}, DataType)
[stderr] Stacktrace:
[stderr] Stacktrace:
[stderr] nil
[stderr] nil
[stderr] nil
[stderr]   [1] error(s::Tuple{DataType, DataType})
[stderr]   [1] error(s::Tuple{DataType, DataType})
[stderr]     @ Base ./error.jl:42
[stderr]   [2] #FakeTypeName#1
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/faketypes.jl:40 [inlined]
[stderr]   [3] FakeUnionAll
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/faketypes.jl:60 [inlined]
[stderr]   [4] #FakeTypeName#1
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/faketypes.jl:34 [inlined]
[stderr]   [5] FakeTypeName
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/faketypes.jl:18 [inlined]
[stderr]   [6] load_core()
[stderr]     @ SymbolServer ~/.julia/packages/SymbolServer/eITqF/src/symbols.jl:447
[stderr]   [7] top-level scope
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/SymbolServer.jl:203
[stderr]   [8] include
[stderr]     @ ./Base.jl:386 [inlined]
[stderr]   [9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
[stderr]     @ Base ./loading.jl:1209
[stderr]  [10] top-level scope
[stderr]     @ none:1
[stderr]  [11] eval
[stderr]     @ ./boot.jl:360 [inlined]
[stderr]  [12] eval(x::Expr)
[stderr]     @ Base.MainInclude ./client.jl:446
[stderr]  [13] top-level scope
[stderr]     @ none:1
[stderr] in expression starting at /home/matias/.julia/packages/SymbolServer/eITqF/src/SymbolServer.jl:1
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: Failed to precompile SymbolServer [cf896787-08d5-524d-9de7-132aaa0cb996] to /home/matias/.julia/compiled/v1.6/SymbolServer/jl_v9HcZ3.
[stderr] Stacktrace:
[stderr] nil
[stderr] nil
[stderr]   [1] error(s::String)
[stderr]     @ Base ./error.jl:33
[stderr]   [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.PipeEndpoint, internal_stdout::Base.PipeEndpoint)
[stderr]     @ Base ./loading.jl:1356
[stderr]   [3] compilecache(pkg::Base.PkgId, path::String)
[stderr]     @ Base ./loading.jl:1302
[stderr]   [4] _require(pkg::Base.PkgId)
[stderr]     @ Base ./loading.jl:1017
[stderr]   [5] require(uuidkey::Base.PkgId)
[stderr]     @ Base ./loading.jl:910
[stderr]   [6] require(into::Module, mod::Symbol)
[stderr]     @ Base ./loading.jl:897
[stderr]   [7] include
[stderr]     @ ./Base.jl:386 [inlined]
[stderr]   [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
[stderr]     @ Base ./loading.jl:1209
[stderr]   [9] top-level scope
[stderr]     @ none:1
[stderr]  [10] eval
[stderr]     @ ./boot.jl:360 [inlined]
[stderr]  [11] eval(x::Expr)
[stderr]     @ Base.MainInclude ./client.jl:446
[stderr]  [12] top-level scope
[stderr]     @ none:1
[stderr] in expression starting at /home/matias/.julia/packages/LanguageServer/y1ebo/src/LanguageServer.jl:1
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: Failed to precompile LanguageServer [2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7] to /home/matias/.julia/compiled/v1.6/LanguageServer/jl_RaZXlA.
[stderr] Stacktrace:
[stderr] Stacktrace:
[stderr] nil
[stderr] nil
[stderr]  [1] error(s::String)
[stderr]  [1] error(s::String)
[stderr]    @ Base ./error.jl:33
[stderr]  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.PipeEndpoint, internal_stdout::Base.PipeEndpoint)
[stderr]    @ Base ./loading.jl:1356
[stderr]  [3] compilecache(pkg::Base.PkgId, path::String)
[stderr]    @ Base ./loading.jl:1302
[stderr]  [4] _require(pkg::Base.PkgId)
[stderr]    @ Base ./loading.jl:1017
[stderr]  [5] require(uuidkey::Base.PkgId)
[stderr]    @ Base ./loading.jl:910
[stderr]  [6] require(into::Module, mod::Symbol)
[stderr]    @ Base ./loading.jl:897
[stderr] in expression starting at /home/matias/.emacs.d/elpa/eglot-jl-20200726.741/eglot-jl.jl:33
[internal] Thu Feb  4 11:08:40 2021:
(:message "Connection state changed" :change "exited abnormally with code 1\n")

----------b---y---e---b---y---e----------
[stderr] 
[stderr] 
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (julia/julia-mode) stderr finished
@dwinkler1
Copy link

I get a very similar error. Already tried reinstalling and installing LanguageServer and SymbolServer manually but did not help

[client-request] (id:1) Mon Apr 12 14:48:59 2021:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
          (:processId 41456 :rootPath "/home/daniel/Documents/myproj/" :rootUri "file:///home/daniel/Documents/myproj" :initializationOptions #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                                                                                                                        ())
                      :capabilities
                      (:workspace
                       (:applyEdit t :executeCommand
                                   (:dynamicRegistration :json-false)
                                   :workspaceEdit
                                   (:documentChanges :json-false)
                                   :didChangeWatchedFiles
                                   (:dynamicRegistration t)
                                   :symbol
                                   (:dynamicRegistration :json-false)
                                   :configuration t)
                       :textDocument
                       (:synchronization
                        (:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
                        :completion
                        (:dynamicRegistration :json-false :completionItem
                                              (:snippetSupport :json-false)
                                              :contextSupport t)
                        :hover
                        (:dynamicRegistration :json-false :contentFormat
                                              ["markdown" "plaintext"])
                        :signatureHelp
                        (:dynamicRegistration :json-false :signatureInformation
                                              (:parameterInformation
                                               (:labelOffsetSupport t)
                                               :activeParameterSupport t))
                        :references
                        (:dynamicRegistration :json-false)
                        :definition
                        (:dynamicRegistration :json-false)
                        :declaration
                        (:dynamicRegistration :json-false)
                        :implementation
                        (:dynamicRegistration :json-false)
                        :typeDefinition
                        (:dynamicRegistration :json-false)
                        :documentSymbol
                        (:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind
                                              (:valueSet
                                               [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))
                        :documentHighlight
                        (:dynamicRegistration :json-false)
                        :codeAction
                        (:dynamicRegistration :json-false :codeActionLiteralSupport
                                              (:codeActionKind
                                               (:valueSet
                                                ["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
                                              :isPreferredSupport t)
                        :formatting
                        (:dynamicRegistration :json-false)
                        :rangeFormatting
                        (:dynamicRegistration :json-false)
                        :rename
                        (:dynamicRegistration :json-false)
                        :publishDiagnostics
                        (:relatedInformation :json-false))
                       :experimental #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data
                                                   ()))))
[stderr] nil
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: KeyError: key :_apply_latest not found
[stderr] Stacktrace:
[stderr] Stacktrace:
[stderr]   [1] getindex
[stderr]     @ ./dict.jl:482 [inlined]
[stderr]   [2] getindex
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/symbols.jl:20 [inlined]
[stderr]   [3] load_core()
[stderr]     @ SymbolServer ~/.julia/packages/SymbolServer/eITqF/src/symbols.jl:437
[stderr]   [4] top-level scope
[stderr]     @ ~/.julia/packages/SymbolServer/eITqF/src/SymbolServer.jl:203
[stderr]   [5] include
[stderr]     @ ./Base.jl:386 [inlined]
[stderr]     @ ./Base.jl:386 [inlined]
[stderr]   [6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
[stderr]     @ Base ./loading.jl:1213
[stderr]   [7] top-level scope
[stderr]     @ none:1
[stderr]   [8] eval
[stderr]     @ ./boot.jl:360 [inlined]
[stderr]   [9] eval(x::Expr)
[stderr]     @ Base.MainInclude ./client.jl:446
[stderr]  [10] top-level scope
[stderr]     @ none:1
[stderr] in expression starting at /home/daniel/.julia/packages/SymbolServer/eITqF/src/SymbolServer.jl:1
[stderr] nil
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: Failed to precompile SymbolServer [cf896787-08d5-524d-9de7-132aaa0cb996] to /home/daniel/.julia/compiled/v1.6/SymbolServer/jl_rs3aQV.
[stderr] Stacktrace:
[stderr] Stacktrace:
[stderr]   [1] error(s::String)
[stderr]   [1] error(s::String)
[stderr] nil
[stderr]     @ Base ./error.jl:33
[stderr]   [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.PipeEndpoint, internal_stdout::Base.PipeEndpoint)
[stderr]     @ Base ./loading.jl:1360
[stderr]   [3] compilecache(pkg::Base.PkgId, path::String)
[stderr]     @ Base ./loading.jl:1306
[stderr]   [4] _require(pkg::Base.PkgId)
[stderr]     @ Base ./loading.jl:1021
[stderr]   [5] require(uuidkey::Base.PkgId)
[stderr]     @ Base ./loading.jl:914
[stderr]   [6] require(into::Module, mod::Symbol)
[stderr]     @ Base ./loading.jl:901
[stderr]   [7] include
[stderr]     @ ./Base.jl:386 [inlined]
[stderr]   [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
[stderr]     @ Base ./loading.jl:1213
[stderr]   [9] top-level scope
[stderr]     @ none:1
[stderr]  [10] eval
[stderr]     @ ./boot.jl:360 [inlined]
[stderr]  [11] eval(x::Expr)
[stderr]     @ Base.MainInclude ./client.jl:446
[stderr]  [12] top-level scope
[stderr]     @ none:1
[stderr] in expression starting at /home/daniel/.julia/packages/LanguageServer/y1ebo/src/LanguageServer.jl:1
[stderr] nil
[stderr] nil
[stderr] ERROR: LoadError: Failed to precompile LanguageServer [2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7] to /home/daniel/.julia/compiled/v1.6/LanguageServer/jl_scetng.
[stderr] Stacktrace:
[stderr] Stacktrace:
[stderr] nil
[stderr]  [1] error(s::String)
[stderr]  [1] error(s::String)
[stderr]    @ Base ./error.jl:33
[stderr]  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.PipeEndpoint, internal_stdout::Base.PipeEndpoint)
[stderr]    @ Base ./loading.jl:1360
[stderr]  [3] compilecache(pkg::Base.PkgId, path::String)
[stderr]    @ Base ./loading.jl:1306
[stderr]  [4] _require(pkg::Base.PkgId)
[stderr]    @ Base ./loading.jl:1021
[stderr]  [5] require(uuidkey::Base.PkgId)
[stderr]    @ Base ./loading.jl:914
[stderr]  [6] require(into::Module, mod::Symbol)
[stderr]    @ Base ./loading.jl:901
[stderr] in expression starting at /home/daniel/.emacs.d/elpa/eglot-jl-20200726.741/eglot-jl.jl:33
[internal] Mon Apr 12 14:49:10 2021:
(:message "Connection state changed" :change "exited abnormally with code 1\n")

----------b---y---e---b---y---e----------
[stderr] 
[stderr] 
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (myproj/julia-mode) stderr finished

@non-Jedi
Copy link
Owner

Looks like there are some compatibility issues with Julia 1.6 with the versions of LanguageServer.jl or one of its dependencies. We should bump the versions, and this will probably go away. Feel free to create a PR doing so; I haven't personally been using this package lately, so I'm not sure when I'll get to it.

@ffevotte
Copy link
Collaborator

Indeed it looks like a compatibility issue between Julia 1.6 and the Manifest.toml file which is shipped with eglot-jl.

In the short term, a quick workaround should be to re-resolve the Manifest with Julia 1.6. @mguzmann and @danielw2904, since both of you you seem to have installed eglot via MELPA, this should be relatively easy: just run

shell$ julia --project="~/.emacs.d/elpa/eglot-jl-20200726.741/" -e "using Pkg; Pkg.resolve()"

eglot should work fine after this (and I'm very pleased to see that all the latency-reduction work that went into Julia 1.6 is really paying off, since the server starts much more quickly now).

Please try this workaround and report back if it didn't work.

@ffevotte
Copy link
Collaborator

In the long run, I'm not sure how best to handle this. As we just saw with 1.6, Manifest.toml files are not really portable across Julia versions, so that shipping one with eglot-jl exposes us to issues like this when Julia itself is updated. On the other hand, shipping only a Project.toml exposes us to issues when LanguageServer is updated.

I see several possibilities:

  1. ship several Manifest.toml: one for each (minor) Julia version supported by eglot-jl
  2. ship a Manifest.toml for the latest Julia version
  3. do not ship a Manifest.toml at all, relying only on compat bounds to avoid issues with LanguageServer updates

In order to avoid issues with options (2) and (3), we'd need eglot-jl.jl to run Pkg.resolve() instead of Pkg.instantiate(). I think this would make sure that any Manifest shipped with eglot-jl is used if possible, but that a fully working environment gets re-defined otherwise.

There might be other options I did not think about. I think I would tend to favor option (3), which I find comfortable both from the viewpoint of an eglot-jl user and the viewpoint of an eglot-jl maintainer. It does mean that different users will potentially have different LanguageServer versions, but we could even mitigate that by having strict compatibility bounds in the Project.toml.

What do others think about this?

@non-Jedi
Copy link
Owner

I think the Manifest is supposed to be usable across Julia versions... There ought to be a bug open somewhere if this is the real root issue. What does the diff look like after resolving the Manifest? Are you sure resolve isn't just grabbing a new minor version release of a dep that's compatible with julia 1.6?

To work around this if it is a bug, my preference would be number 2 of the options listed but number 3 would be fine as well.

@ffevotte
Copy link
Collaborator

Well, actually I think there has never been any guarantee that the Manifest would be compatible across Julia versions; it just happens that incompatibilities never occurred in practice until recently with Julia 1.6. But issues like this one seem to be happening at various places in the Julia ecosystem, and it is now relatively clear that v1.5 & v1.6 manifests are not entirely compatible (I think this has something to do with the set of standard libraries differing between the two versions). See for example a recent discussion about this in the context of JuMP:

https://discourse.julialang.org/t/jump-installation-issue-in-julia-v1-6/58721/8

In any case, I can confirm that:

  • the manifest we currently ship works for Julia 1.5 (and all previous minor versions, starting from 1.0) but not for Julia 1.6
  • the manifest created by re-resolving the project environment with Julia 1.6 does not work for Julia 1.5 (nor any previous version)

so we actually need to do something about it: any manifest that we ship will be broken for some users.

I would be fine with option (2); let's try that! I'll prepare a PR tomorrow and we'll see how things go. Do you think you'll be able to take some time reviewing it? (But no pressure! I think I can test this on my own to make sure the update goes smoothly before we ship it)

@non-Jedi
Copy link
Owner

I can certainly spend 10 minutes reviewing a simple version-bump/manifest-resolve PR tomorrow. If I don't review tomorrow for whatever reason, feel free to merge.

ffevotte added a commit to ffevotte/eglot-jl that referenced this issue Apr 14, 2021
The new Manifest.toml is tailored for Julia 1.6.0.

Eglot-jl should still work with older Julia versions, since the environment is
re-resolved at each server start to make sure it is compatible with the current
Julia version.

Fixes: non-Jedi#20
@ffevotte ffevotte mentioned this issue Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants