-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Error: mktempdir cleanup - IOError: rm... resource busy or locked (EBUSY) on Windows #39457
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
Comments
Isn't that just a problem in Pkg that we keep a |
If that's the case then perhaps we should set |
Or fix it so that we don't leave unclosed files behind. |
So the pattern I believe we're looking for is that something is created as a temporary and then opened and never closed. There are two ways this will get cleaned up and raise an error like this: if there's a do block on the |
I don't know if this MWE is representative of the errors seen in Pkg tests, but: julia> for i in 1:1000
mktempdir() do tmp
cp("test.png", joinpath(tmp,"test.png"))
cp(joinpath(tmp,"test.png"), "test2.png", force=true)
end
end
ERROR: IOError: unlink("C:\\Users\\ian\\test.png"): permission denied (EACCES)
Stacktrace:
[1] uv_error
@ .\libuv.jl:97 [inlined]
[2] unlink(p::String)
@ Base.Filesystem .\file.jl:940
[3] rm(path::String; force::Bool, recursive::Bool)
@ Base.Filesystem .\file.jl:272
[4] checkfor_mv_cp_cptree(src::String, dst::String, txt::String; force::Bool)
@ Base.Filesystem .\file.jl:313
[5] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
@ Base.Filesystem .\file.jl:352
[6] #51
@ .\REPL[7]:4 [inlined]
[7] mktempdir(fn::var"#51#52", parent::String; prefix::String)
@ Base.Filesystem .\file.jl:732
[8] mktempdir(fn::Function, parent::String)
@ Base.Filesystem .\file.jl:730
[9] top-level scope
@ REPL[7]:2 |
The issue is still present in the latest release 1.9.4 and makes it impossible to install a number of important packages, such as Images.jl |
That doesn't really make sense... this is not an error that blocks installing anything, it's an error that shows up during process shutdown. If you're having a problem that prevents installation of Images, you should open an issue describing what you tried and what goes wrong. |
More precisely, it breaks the precompilation of some crucial packages. I have reported this in a few places, including main julia repo and on Discourse, back in August. I have this issue on both Windows 7 machines I tried to install Images on. |
I have no idea whether this is related to your problem, but note that Windows 7 is unsupported, you may or may not have more luck by using supported operating systems. |
I believe this might be the same issue with resource clean up over in JuliaDocs/DemoCards.jl#160 on Github Actions [ Info: Clean up DemoCards build dir: "..\figures"
ERROR: LoadError: IOError: rm("D:\\a\\Nagy_2023_SwellMigration\\Nagy_2023_SwellMigration\\site\\src\\figures\\Notebooks"): resource busy or locked (EBUSY)
Stacktrace:
[1] uv_error
@ Base .\libuv.jl:100 [inlined]
[2] rm(path::String; force::Bool, recursive::Bool)
@ Base.Filesystem .\file.jl:307
[3] rm(path::String; force::Bool, recursive::Bool)
@ Base.Filesystem .\file.jl:294
[4] rm
@ .\file.jl:273 [inlined]
[5] (::DemoCards.var"#113#118"{String, String, String, String})()
@ DemoCards C:\Users\runneradmin\.julia\packages\DemoCards\Oz6IE\src\generate.jl:209
[6] top-level scope
@ D:\a\Nagy_2023_SwellMigration\Nagy_2023_SwellMigration\site\make.jl:47
in expression starting at D:\a\Nagy_2023_SwellMigration\Nagy_2023_SwellMigration\site\make.jl:47
GKS: could not find font bold.ttf
Error: Process completed with exit code 1. |
I no longer see this issue on Windows 7 with v1.10 of Julia. |
This is seen quite frequently on Pkg's windows tests. I also had to add time delay to file write & rewrite benchmarks on Windows in SystemBenchmark to avoid writing to files that weren't closed yet.
Seems like the file isn't being reliably released during close?
For instance:
Related issues
#29658
#27982
The text was updated successfully, but these errors were encountered: