TOML parsing error

My julia keeps running into unknow problems and get killed when I install packages. And when I restart I always got error messages like this:

(@v1.9) pkg> up
ERROR: TOML Parser error:
C:\Users\pkudu\.julia\logs\manifest_usage.toml:1:1 error: invalid bare key character: '\0'
  ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
  ^                                                                                                                     

Stacktrace:
  [1] parse
    @ .\toml_parser.jl:445 [inlined]
  [2] parsefile(f::String)
    @ TOML C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\TOML\src\TOML.jl:43
  [3] (::Pkg.Types.var"#51#54"{String, String, Dates.DateTime, String})()
    @ Pkg.Types C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:513
  [4] mkpidlock(f::Pkg.Types.var"#51#54"{String, String, Dates.DateTime, String}, at::String, pid::Int32; kwopts::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:stale_age,), Tuple{Int64}}})
    @ FileWatching.Pidfile C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\FileWatching\src\pidfile.jl:82
  [5] mkpidlock
    @ C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\FileWatching\src\pidfile.jl:79 [inlined]
  [6] #mkpidlock#6
    @ C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\FileWatching\src\pidfile.jl:77 [inlined]
  [7] mkpidlock
    @ C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\FileWatching\src\pidfile.jl:77 [inlined]
  [8] write_env_usage(source_file::String, usage_filepath::String)
    @ Pkg.Types C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:511
  [9] Pkg.Types.EnvCache(env::Nothing)
    @ Pkg.Types C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:366
 [10] EnvCache
    @ C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:345 [inlined]
 [11] Context
    @ .\util.jl:567 [inlined]
 [12] up(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:147
 [13] up(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:145
 [14] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:412
 [15] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:390
 [16] do_cmd
    @ C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:380 [inlined]
 [17] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:557
 [18] #invokelatest#2
    @ .\essentials.jl:819 [inlined]
 [19] invokelatest
    @ .\essentials.jl:816 [inlined]
 [20] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\REPL\src\LineEdit.jl:2647
 [21] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\pkudu\AppData\Local\Programs\Julia-1.9.4\share\julia\stdlib\v1.9\REPL\src\REPL.jl:1300
 [22] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:514

My julia version:

Julia Version 1.9.4
Commit 8e5136fa29 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 32 × Intel(R) Core(TM) i9-14900KS
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, goldmont)
  Threads: 1 on 32 virtual cores

What is the issue here?

This file seems corrupt. Try renaming/deleting it. I don’t think it contained anything very valuable.
This problem might hint a a deeper problem in you system though. Did you experience a hard crash (like BSOD, sudden power outage or so)? Otherwise this might be the drive failing. It’s probably worth an investigation. Check maybe the Windows event log for messages.

1 Like

Thanks! This happens repeatedly and yes sometimes my windows get killed (blue screen). I have tried to delete it before but the problem keeps coming back. Do you know where to start investigate?

Some ideas:

  • Start by checking the windows event log for warning/errors (e.g. short tutorial)
  • You can also check your drives’ health using something like CrystalDiskInfo
  • Next time you get a bluescreen (BSOD) try to take a photo of the error and google that. That can give hints on what component is failing you.
  • You can stress test various components, e.g. by benchmarking, and see whether this leads to BSOD. I think I would start with RAM (there is Windows tool for that), but stresstesting the CPU (with e.g. Prime95) and GPU (e.g. FurMark) could also be interesting.

Typically drives are the most likely component to fail (imo). So I’d start there. Especially if you have an older SSD in your system.

Updated the SSD driver and the problem seems to have disappeared. Thanks!