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

Cache generation for stdlib on read-only FS fails #50206

Closed
vchuravy opened this issue Jun 18, 2023 · 12 comments · Fixed by #50214
Closed

Cache generation for stdlib on read-only FS fails #50206

vchuravy opened this issue Jun 18, 2023 · 12 comments · Fixed by #50214
Labels
bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@vchuravy
Copy link
Member

Failed to precompile OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] to "/home/pkgeval/.julia/compiled/v1.10/OrdinaryDiffEq/jl_uICwpR".
ERROR: LoadError: IOError: open("/opt/julia/share/julia/stdlib/v1.10/DelimitedFiles/src/DelimitedFiles.jl.pidlock", 194, 292): read-only file system (EROFS)
Stacktrace:
  [1] uv_error(prefix::String, c::Int32)
    @ Base ./libuv.jl:100 [inlined]
  [2] open(path::String, flags::UInt16, mode::UInt16)
    @ Base.Filesystem ./filesystem.jl:121
  [3] tryopen_exclusive(path::String, mode::UInt16)
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:210
  [4] open_exclusive(path::String; mode::UInt16, poll_interval::Int64, wait::Bool, stale_age::Int64)
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:236
  [5] mkpidlock(at::String, pid::Int32; stale_age::Int64, refresh::Float64, kwopts::@Kwargs{wait::Bool})
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:66
  [6] mkpidlock(f::Base.var"#962#963"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{wait::Bool})
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:90
  [7] mkpidlock(f::Function, at::String; kwopts::@Kwargs{wait::Bool})
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:87 [inlined]
  [8] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{})
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:110
  [9] trymkpidlock(::Function, ::Vararg{Any})
    @ FileWatching.Pidfile /opt/julia/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:108
 [10] invokelatest(::Any, ::Returns{Nothing}, ::String; kwargs::@Kwargs{})
    @ Base ./essentials.jl:864 [inlined]
 [11] invokelatest(::Any, ::Base.var"#962#963"{Base.PkgId}, ::String)
    @ Base ./essentials.jl:861 [inlined]
 [12] maybe_cachefile_lock(f::Base.var"#962#963"{Base.PkgId}, pkg::Base.PkgId, srcpath::String)
    @ Base ./loading.jl:2826
 [13] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1905
 [14] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1747
 [15] invoke_in_world(::UInt64, 

Seen during https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/d9a5a29_vs_65523e4/MultiStateSystems.primary.log

cc: @IanButterworth

@vchuravy vchuravy added the bug Indicates an unexpected problem or unintended behavior label Jun 18, 2023
@vchuravy vchuravy added this to the 1.10 milestone Jun 18, 2023
@IanButterworth
Copy link
Sponsor Member

How much of the file system is read only? Where could these be saved?

@giordano
Copy link
Contributor

giordano commented Jun 18, 2023

From the log:

JULIA_DEPOT_PATH = ::/usr/local/share/julia

The first entry of the depots list is supposed to be writable, it looks like this isn't the case in PkgEval?

Edit: nevermind, it fails to write in /opt/julia/share, which is different from the depot.

@IanButterworth
Copy link
Sponsor Member

IanButterworth commented Jun 18, 2023

Yeah. It could save the pidfile in the depot, but the issue is the cachefile directory slug isn't known ahead of spawning off the child to do the precomp, which is why it's specific to the sourcepath currently.

I guess the lock could be more general for a package (and Julia version) and save as $depot/compiled/v1.10/Foo/.pidfile, rather than what it currently is which is specific package to sourcepath (which could be used by different julia versions)

@vchuravy
Copy link
Member Author

Yeah we should put the PID lock into the same location as the output file.

We could also sink the lock closer to where we determine the slug

@IanButterworth
Copy link
Sponsor Member

The latter would mean you couldn't avoid spawning a julia process.

What about $depot/compiled/v1.10/Foo/$(hash_of_source_path).pidfile ?

@vchuravy
Copy link
Member Author

vchuravy commented Jun 18, 2023

The latter would mean you couldn't avoid spawning a julia process.

Why? The slug is determined by the parent.

What about $depot/compiled/v1.10/Foo/$(hash_of_source_path).pidfile ?

Maybe simply $depot/compiled/v1.10/Foo.pidfile?

@IanButterworth
Copy link
Sponsor Member

The slug is determined by the parent.

AFAICT that's not true. The full path isn't known by the parent because of things like preferences etc

@maleadt
Copy link
Member

maleadt commented Jun 18, 2023

From the log:

JULIA_DEPOT_PATH = ::/usr/local/share/julia

The first entry of the depots list is supposed to be writable, it looks like this isn't the case in PkgEval?

FWIW, double :: implies that the default depot dirs are kept, so that env var only adds a read-only layer to the end. PkgEval also doesn't actually store anything there, the layer is just for the registry. (We originally did, but because cache files aren't relocatable we stopped doing that.)

@vchuravy
Copy link
Member Author

like preferences etc

Yeah... Only due to preferences.

cachefile = compilecache_path(pkg, prefs_hash)

@maleadt
Copy link
Member

maleadt commented Jun 20, 2023

Still seems to happen on https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-06/19/report.html, which includes f555b4b

e.g. https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-06/19/SoilWater_ToolBox.against.log

ERROR: LoadError: Error building `TimeZones`: 
ERROR: LoadError: IOError: open("/opt/julia/share/julia/stdlib/v1.10/LazyArtifacts/src/LazyArtifacts.jl.pidlock", 194, 292): read-only file system (EROFS)

or https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-06/19/AEMS.against.log

ERROR: LoadError: Error building `AEMS`: 
ERROR: LoadError: IOError: open("/opt/julia/share/julia/stdlib/v1.10/SuiteSparse/src/SuiteSparse.jl.pidlock", 194, 292): read-only file system (EROFS)

@maleadt maleadt reopened this Jun 20, 2023
@IanButterworth
Copy link
Sponsor Member

It can't have the new commit, I changed from a ".pidlock" to ".pidfile" extension for one thing

@maleadt
Copy link
Member

maleadt commented Jun 20, 2023

My mistake, I was looking at the against logs.

@maleadt maleadt closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants