Minor julia upgrade -> VSCode failures

I recently upgraded from julia 1.8.2 to 1.8.5 on Windows 10. I first uninstalled 1.8.2, and updated my PATH when installing 1.8.5. The julia extension in VSCode is configured to use the default julia, i.e., no special path coded in.

In short, VSCode was unable to start the julia language server until I updated and precompiled packages outside of VSCode.

I would appreciate any insights into why there were problems (I have some guesses below) and how to avoid this for future releases, at least for minor updates.

And perhaps my workaround will be useful to others.

Details:

On VSCode startup it presented a bunch of error messages. Here are some:

  Activating project at `c:\Users\rdboylan\.vscode\extensions\julialang.language-julia-1.38.2\scripts\environments\languageserver\v1.8`
[ Info: Starting the Julia Language Server
ERROR: LoadError: IOError: unlink("c:\\Users\\rdboylan\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia\\lsdepot\\v1\\compiled\\v1.8\\CSTParser\\jl_48BF.tmp"): resource busy or locked (EBUSY)
...
caused by: IOError: unlink("c:\\Users\\rdboylan\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia\\lsdepot\\v1\\compiled\\v1.8\\CSTParser\\jl_48BF.tmp"): resource busy or locked (EBUSY)
....
The Language Server failed to precompile.
Please make sure you have permissions to write to the LS depot path at
	c:\Users\rdboylan\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\lsdepot\v1

┌ Error: Some Julia code in the VS Code extension crashed
â”” @ Main c:\Users\rdboylan\.vscode\extensions\julialang.language-julia-1.38.2\scripts\error_handler.jl:15
ERROR: Failed to precompile LanguageServer [2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7] to c:\Users\rdboylan\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\lsdepot\v1\compiled\v1.8\LanguageServer\jl_3DD1.tmp.
[Info  - 3:52:43 PM] Connection to server got closed. Server will restart.
[Error - 3:52:43 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 3:52:43 PM] Julia Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 

VSCode opens with several windows, 2 or 3 of which are julia projects. So I wonder if this could be a race in which they are contending for the same lock. Does that sound possible?

Some of my projects have a lot of packages; precompiling all of them is slow. Perhaps the startup procedure is impatient?

I left everything open for awhile hoping precompilation would succeed eventually for one of the projects. The logs do say “server will restart” and do show repeated attempts to precompile. Then I exited VSCode and restarted it. The problems persisted.

I was finally able to fix the problem by starting julia from the command line in PowerShell. First I selected the default environment and did ] update and precompile. There were some package updates, including some new package installations I think, and so I suppose it’s possible my original package set was incompatible with 1.8.5. Then I switched to my main development environment and repeated the update and precompile. After this, VSCode started without errors.

1 Like