Cannot open REPL in VSCode or on command line this morning (after long weekend)

Using Alt-J, Alt-O usually opens the REPL in VS-Code. This morning, it generates the below error, which was hard to capture because it disappears a fraction of a second after appearing.

If I open a Julia REPL at the command line I get the same error. The text pasted below is the complete output from a Windows CMD session.

Something seems to have gotten corrupted. I’ve been away for a few days and haven’t personally changed anything - but I suppose Windows update or something else may have updated while I was away.

Any help, much appreciated!

Microsoft Windows [Version 10.0.26100.3775]
(c) Microsoft Corporation. All rights reserved.

C:\Users\tim>julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.5 (2025-04-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

Unhandled Task ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty
   @ .\Base.jl:49 [inlined]
 [2] backend
   @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:997 [inlined]
 [3] (::REPL.var"#70#71"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
   @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:405
 [4] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
   @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:678
 [5] print_response
   @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:403 [inlined]
 [6] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
   @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1222
 [7] setup_interface
   @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1090 [inlined]
 [8] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
   @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1500
 [9] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
   @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497

caused by: SystemError: opening file "C:\\Users\\tim\\.julia\\logs\\repl_history.jl": Permission denied
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base .\error.jl:176
  [2] systemerror
    @ .\error.jl:176
  [3] systemerror
    @ .\error.jl:175 [inlined]
  [4] open(fname::String; lock::Bool, read::Bool, write::Bool, create::Bool, truncate::Nothing, append::Nothing)
    @ Base .\iostream.jl:295
  [5] open
    @ .\iostream.jl:277 [inlined]
  [6] hist_open_file
    @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:712 [inlined]
  [7] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1215
  [8] setup_interface
    @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1090 [inlined]
  [9] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1500
 [10] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497
ERROR: TaskFailedException
Stacktrace:
  [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
    @ Base .\task.jl:958
  [2] wait()
    @ Base .\task.jl:1022
  [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
    @ Base .\condition.jl:130
  [4] wait
    @ .\condition.jl:125 [inlined]
  [5] take_buffered(c::Channel{Any})
    @ Base .\channels.jl:493
  [6] take!
    @ .\channels.jl:487 [inlined]
  [7] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:353
  [8] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:343
  [9] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:500
 [10] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:486
 [11] (::Base.var"#1150#1152"{Bool, Symbol, Bool})(REPL::Module)
    @ Base .\client.jl:446
 [12] #invokelatest#2
    @ .\essentials.jl:1055 [inlined]
 [13] invokelatest
    @ .\essentials.jl:1052 [inlined]
 [14] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
    @ Base .\client.jl:430
 [15] repl_main
    @ .\client.jl:567 [inlined]
 [16] _start()
    @ Base .\client.jl:541

    nested task error: UndefRefError: access to undefined reference
    Stacktrace:
     [1] getproperty
       @ .\Base.jl:49 [inlined]
     [2] backend
       @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:997 [inlined]
     [3] (::REPL.var"#70#71"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
       @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:405
     [4] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
       @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:678
     [5] print_response
       @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:403 [inlined]
     [6] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
       @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1222
     [7] setup_interface
       @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1090 [inlined]
     [8] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
       @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1500
     [9] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
       @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497

    caused by: SystemError: opening file "C:\\Users\\tim\\.julia\\logs\\repl_history.jl": Permission denied
    Stacktrace:
      [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
        @ Base .\error.jl:176
      [2] systemerror
        @ .\error.jl:176
      [3] systemerror
        @ .\error.jl:175 [inlined]
      [4] open(fname::String; lock::Bool, read::Bool, write::Bool, create::Bool, truncate::Nothing, append::Nothing)
        @ Base .\iostream.jl:295
      [5] open
        @ .\iostream.jl:277 [inlined]
      [6] hist_open_file
        @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:712 [inlined]
      [7] setup_interface(repl::REPL.LineEditREPL, hascolor::Bool, extra_repl_keymap::Any)
        @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1215
      [8] setup_interface
        @ C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1090 [inlined]
      [9] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
        @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1500
     [10] (::REPL.var"#79#85"{REPL.LineEditREPL, REPL.REPLBackendRef})()
        @ REPL C:\Users\tim\.julia\juliaup\julia-1.11.5+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:497

C:\Users\tim>

Seems to be this:

 caused by: SystemError: opening file "C:\\Users\\tim\\.julia\\logs\\repl_history.jl": Permission denied

which is something I’ve not come across.

Do you get the same error when you just start julia from a regular terminal?

Maybe rename that file (so that there isn’t a REPL history anymore) and see if you can start a REPL successfully?

1 Like

That was it. Thanks!

The file had been locked by my back-up service (Carbonite) which seemed to have failed somehow. I couldn’t rename/delete the file because it was locked by Carbonite - something I would expect only to be transitory. I stopped the service and then deleted the log. Now I’m back on track (until you tell me the log file contained something essential! :zany_face: )

1 Like

No, nothing essential, but I’m often quite happy to have the REPL history - as an example, whenever I update Julia I need to add a multi-threaded IJulia kernel, and rather than looking at the docs to check how to use the installkernel function again, I just do

julia> installk<up arrow>

which then digs up

julia> installkernel("Julia (20 threads)", env = Dict("JULIA_NUM_THREADS" => "20"))

from my REPL history, and Bob’s my uncle.

1 Like