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

Compile cache permission denied #4118

Open
maleadt opened this issue Dec 17, 2024 · 0 comments
Open

Compile cache permission denied #4118

maleadt opened this issue Dec 17, 2024 · 0 comments
Labels
precompile Pkg.precompile

Comments

@maleadt
Copy link
Member

maleadt commented Dec 17, 2024

On Metal.jl, we encountered the following permission error during precompilation:

ERROR: SystemError: opening file "/Users/julia/.julia/compiled/v1.11/Metal/ACDsk_tBsmV.ji": Permission denied

Full log:

     Testing Metal
      Status `/private/var/tmp/agent-tempdirs/default-macmini-aarch64-5.0/tmp/jl_ezdPsi/Project.toml`
  [79e6a3ab] Adapt v4.1.1
  [ab4f0b2a] BFloat16s v0.5.0
  [6e4b80f9] BenchmarkTools v1.5.0
  [0c68f7d7] GPUArrays v11.1.0
  [63c18a36] KernelAbstractions v0.9.31
  [929cbde3] LLVM v9.1.3
  [dde4c033] Metal v1.4.0 `/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/build/default-macmini-aarch64-5-0/julialang/metal-dot-jl`
  [e86c9b32] ObjectiveC v3.1.0
  [276daf66] SpecialFunctions v2.5.0
  [90137ffa] StaticArrays v1.9.8
  [10745b16] Statistics v1.11.1
  [ade2ca70] Dates v1.11.0
  [8ba89e20] Distributed v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [de0858da] Printf v1.11.0
  [3fa0cd96] REPL v1.11.0
  [9a3f8284] Random v1.11.0
  [2f01184e] SparseArrays v1.11.0
  [8dfed614] Test v1.11.0
      Status `/private/var/tmp/agent-tempdirs/default-macmini-aarch64-5.0/tmp/jl_ezdPsi/Manifest.toml`
  [79e6a3ab] Adapt v4.1.1
  [a9b6321e] Atomix v1.0.1
  [ab4f0b2a] BFloat16s v0.5.0
  [6e4b80f9] BenchmarkTools v1.5.0
  [fa961155] CEnum v0.5.0
  [523fee87] CodecBzip2 v0.8.4
  [ffbed154] DocStringExtensions v0.9.3
  [e2ba6199] ExprTools v0.1.10
  [0c68f7d7] GPUArrays v11.1.0
  [46192b85] GPUArraysCore v0.2.0
  [61eb1bfa] GPUCompiler v1.0.1
  [92d709cd] IrrationalConstants v0.2.2
  [692b3bcd] JLLWrappers v1.6.1
  [682c06a0] JSON v0.21.4
  [63c18a36] KernelAbstractions v0.9.31
  [929cbde3] LLVM v9.1.3
  [2ab3a3ac] LogExpFunctions v0.3.29
  [1914dd2f] MacroTools v0.5.13
  [dde4c033] Metal v1.4.0 `/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/build/default-macmini-aarch64-5-0/julialang/metal-dot-jl`
  [d8793406] ObjectFile v0.4.2
  [e86c9b32] ObjectiveC v3.1.0
  [69de0a69] Parsers v2.8.1
  [aea7be01] PrecompileTools v1.2.1
  [21216c6a] Preferences v1.4.3
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [6c6a2e73] Scratch v1.2.1
  [276daf66] SpecialFunctions v2.5.0
  [90137ffa] StaticArrays v1.9.8
  [1e83bf80] StaticArraysCore v1.4.3
  [10745b16] Statistics v1.11.1
  [53d494c1] StructIO v0.3.1
  [a759f4b9] TimerOutputs v0.5.26
  [3bb67fe8] TranscodingStreams v0.11.3
  [013be700] UnsafeAtomics v0.3.0
  [6e34b625] Bzip2_jll v1.0.8+2
  [2e619515] Expat_jll v2.6.4+1
  [f52de702] LLVMDowngrader_jll v0.5.0+0
  [dad2f222] LLVMExtra_jll v0.0.34+0
  [7106de7a] LibMPDec_jll v2.5.1+0
⌅ [e9f186c6] Libffi_jll v3.2.2+2
  [458c3c95] OpenSSL_jll v3.0.15+1
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [93d3a430] Python_jll v3.10.14+0
  [76ed43ae] SQLite_jll v3.47.2+0
  [ffd25f8a] XZ_jll v5.6.3+0
  [0dad84c5] ArgTools v1.1.2
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [ade2ca70] Dates v1.11.0
  [8ba89e20] Distributed v1.11.0
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [4af54fe1] LazyArtifacts v1.11.0
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2 v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [a63ad114] Mmap v1.11.0
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.11.0
  [de0858da] Printf v1.11.0
  [9abbd945] Profile v1.11.0
  [3fa0cd96] REPL v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [6462fe0b] Sockets v1.11.0
  [2f01184e] SparseArrays v1.11.0
  [f489334b] StyledStrings v1.11.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test v1.11.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.1.1+0
  [deac9b47] LibCURL_jll v8.6.0+0
  [e37daf67] LibGit2_jll v1.7.2+0
  [29816b5a] LibSSH2_jll v1.11.0+1
  [c8ffd9c3] MbedTLS_jll v2.28.6+0
  [14a3606d] MozillaCACerts_jll v2023.12.12
  [4536629a] OpenBLAS_jll v0.3.27+1
  [05823500] OpenLibm_jll v0.8.1+2
  [bea87d4a] SuiteSparse_jll v7.7.0+0
  [83775a58] Zlib_jll v1.2.13+1
  [8e850b90] libblastrampoline_jll v5.11.0+0
  [8e850ede] nghttp2_jll v1.59.0+0
  [3f19e933] p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading.
ERROR: SystemError: opening file "/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/depots/5cd495a2-4a16-4674-ae02-c839447744bb/compiled/v1.11/Metal/ACDsk_tBsmV.ji": Permission denied
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] systemerror
    @ ./error.jl:175 [inlined]
  [3] open(fname::String; lock::Bool, read::Bool, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:295
  [4] open
    @ ./iostream.jl:277 [inlined]
  [5] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:358
  [6] open
    @ ./iostream.jl:357 [inlined]
  [7] (::Base.var"#sort_by#1080")(path::String)
    @ Base ./loading.jl:1166
  [8] _broadcast_getindex_evalf
    @ ./broadcast.jl:673 [inlined]
  [9] _broadcast_getindex
    @ ./broadcast.jl:646 [inlined]
 [10] getindex
    @ ./broadcast.jl:605 [inlined]
 [11] macro expansion
    @ ./broadcast.jl:968 [inlined]
 [12] macro expansion
    @ ./simdloop.jl:77 [inlined]
 [13] copyto!
    @ ./broadcast.jl:967 [inlined]
 [14] copyto!
    @ ./broadcast.jl:920 [inlined]
 [15] copy
    @ ./broadcast.jl:892 [inlined]
 [16] materialize
    @ ./broadcast.jl:867 [inlined]
 [17] find_all_in_cache_path(pkg::Base.PkgId, DEPOT_PATH::Vector{String})
    @ Base ./loading.jl:1191
 [18] find_all_in_cache_path
    @ ./loading.jl:1146 [inlined]
 [19] #28
    @ ./precompilation.jl:874 [inlined]
 [20] get!(default::Base.Precompilation.var"#28#68"{Base.PkgId}, h::Dict{Base.PkgId, Vector{String}}, key::Base.PkgId)
    @ Base ./dict.jl:458
 [21] _precompilepkgs(pkgs::Vector{String}, internal_call::Bool, strict::Bool, warn_loaded::Bool, timing::Bool, _from_loading::Bool, configs::Vector{Pair{Cmd, Base.CacheFlags}}, io::IOContext{IO}, fancyprint::Bool)
    @ Base.Precompilation ./precompilation.jl:874
 [22] #precompilepkgs#10
    @ ./precompilation.jl:409 [inlined]
 [23] (::Pkg.API.var"#225#226"{Bool, Bool, Bool, Bool, Bool, Pair{Cmd, Base.CacheFlags}, Vector{Pkg.Types.PackageSpec}})()
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:1152
 [24] activate(f::Pkg.API.var"#225#226"{Bool, Bool, Bool, Bool, Bool, Pair{Cmd, Base.CacheFlags}, Vector{Pkg.Types.PackageSpec}}, new_project::String)
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:1373
 [25] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, configs::Pair{Cmd, Base.CacheFlags}, kwargs::@Kwargs{io::IOContext{IO}})
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:1150
 [26] precompile
    @ /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:1126 [inlined]
 [27] #precompile#118
    @ /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:164 [inlined]
 [28] (::Pkg.Operations.var"#132#137"{Base.CacheFlags, Cmd, Pkg.Types.Context})()
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:2061
 [29] activate(f::Pkg.Operations.var"#132#137"{Base.CacheFlags, Cmd, Pkg.Types.Context}, new_project::String)
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:1373
 [30] (::Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:2060
 [31] withenv(::Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String}})
    @ Base ./env.jl:265
 [32] (::Pkg.Operations.var"#118#123"{String, Pkg.Types.EnvCache, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1920
 [33] with_temp_env(fn::Pkg.Operations.var"#118#123"{String, Pkg.Types.EnvCache, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1778
 [34] (::Pkg.Operations.var"#116#121"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, String})(tmp::String)
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1887
 [35] mktempdir(fn::Pkg.Operations.var"#116#121"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:819
 [36] mktempdir(fn::Function, parent::String)
    @ Base.Filesystem ./file.jl:815
 [37] mktempdir
    @ ./file.jl:815 [inlined]
 [38] #sandbox#115
    @ /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1834 [inlined]
 [39] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:2052
 [40] test
    @ /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:1996 [inlined]
 [41] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{io::IOContext{IO}})
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:475
 [42] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{coverage::Bool, julia_args::Cmd, test_args::Cmd})
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:159
 [43] test(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::@Kwargs{coverage::Bool, julia_args::Cmd, test_args::Cmd})
    @ Pkg.API /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/julia_installs/bin/mac/aarch64/1.11/julia-1.11-latest-macaarch64/share/julia/stdlib/v1.11/Pkg/src/API.jl:174
 [44] top-level scope
    @ none:11
🚨 Error: The command exited with status 1

After logging in to the CI bot, the file exists and has bad permissions:

% ls -la /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/depots/5cd495a2-4a16-4674-ae02-c839447744bb/compiled/v1.11/Metal/ACDsk_tBsmV.ji
--w-------  1 julia  staff  21152 Dec 16 13:28 /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/depots/5cd495a2-4a16-4674-ae02-c839447744bb/compiled/v1.11/Metal/ACDsk_tBsmV.ji

I'm not sure how that would have happened. It's the only file with such permissions:

% find /Users/julia/.julia/scratchspaces/*/agent-cache/*/depots/*/compiled -perm 200
/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-aarch64-5.0/depots/5cd495a2-4a16-4674-ae02-c839447744bb/compiled/v1.11/Metal/ACDsk_tBsmV.ji

Should Pkg handle this more gracefully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
precompile Pkg.precompile
Projects
None yet
Development

No branches or pull requests

1 participant