I am getting the same error when trying to read JLD2 files saved last week:
julia> @load "D:\\model runs\\savedruns_apr5.jld2"
ERROR: MethodError: no method matching read_array(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::JLD2.FixedLengthString{String}, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1})
Closest candidates are:
read_array(::JLD2.JLDFile, ::JLD2.ReadDataspace, ::JLD2.ReadRepresentation{T,RR}, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Union{Nothing, Array{JLD2.ReadAttribute,1}}) where {T, RR} at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:312
Stacktrace:
[1] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.FixedLengthString{String}, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:173
[2] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:156 [inlined]
[3] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datatypes.jl:76 [inlined]
[4] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:152
[5] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:92
[6] jlconvert at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:674 [inlined]
[7] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:1290 [inlined]
[8] jlconvert at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:1237 [inlined]
[9] read_scalar at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\dataio.jl:37 [inlined]
[10] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{Pair{Any,Any},JLD2.OnDiskRepresentation{(0, 8),Tuple{Any,Any},Tuple{JLD2.RelOffset,JLD2.RelOffset}}()}, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:171
[11] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:149
[12] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:92
[13] jlconvert at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:674 [inlined]
[14] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\dataio.jl:70 [inlined]
[15] macro expansion at .\simdloop.jl:77 [inlined]
[16] read_array!(::Array{Pair{Any,Any},1}, ::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{Pair{Any,Any},JLD2.RelOffset}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\dataio.jl:68
[17] read_array(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::JLD2.ReadRepresentation{Pair{Any,Any},JLD2.RelOffset}, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:323
[18] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{Any,JLD2.RelOffset}, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:198
[19] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:156 [inlined]
[20] macro expansion at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datatypes.jl:76 [inlined]
[21] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:152
[22] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:92
[23] jlconvert at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:674 [inlined]
[24] jlconvert(::JLD2.ReadRepresentation{Dict{Any,Any},JLD2.CustomSerialization{Array,JLD2.RelOffset}}, ::JLD2.JLDFile{JLD2.MmapIO}, ::Ptr{Nothing}, ::JLD2.RelOffset) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\data.jl:576
[25] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{Dict{Any,Any},JLD2.CustomSerialization{Array,JLD2.RelOffset}}, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\dataio.jl:37
[26] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:149
[27] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\datasets.jl:92
[28] getindex(::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, ::String) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\groups.jl:108
[29] read(::JLD2.JLDFile{JLD2.MmapIO}, ::String) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\JLD2.jl:326
[30] #7 at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\loadsave.jl:77 [inlined]
[31] #jldopen#33(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(jldopen), ::var"#7#8", ::String) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\loadsave.jl:4
[32] jldopen(::Function, ::String) at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\loadsave.jl:2
[33] top-level scope at C:\Users\niclas\.julia\packages\JLD2\w2vgv\src\loadsave.jl:76
[34] eval(::Module, ::Any) at .\boot.jl:330
[35] eval_user_input(::Any, ::REPL.REPLBackend) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:86
[36] run_backend(::REPL.REPLBackend) at C:\Users\niclas\.julia\packages\Revise\Pcs5V\src\Revise.jl:1073
[37] top-level scope at none:0
One JLD2 file is extremely large (30 GB) and contains customs structs, but the same error occurs with a small file (150 kB) that only holds two vanilla Julia dicts. I don’t think any Julia packages have updated after writing the files, but I did notice that my computer had restarted even though I left it on - so it is likely Windows Update did something. Could that be the culprit?
The runs saved in these files were the result of running a model for 8 days straight. Please don’t tell me that I lost all this work and can’t recover it.
EDIT: The problem persists when I use the alternate syntax jldopen(filename, "r")
. I get a listing of the variables in the file, but when I try to read the actual data I get the same error as above.
EDIT2: Added a screenshot of the beginning of the error message to highlight the main differences in method signatures, namely ::JLD2.ReadRepresentation{T,RR}
vs ::JLD2.FixedLengthString{String}
.