# Documenter.jl build "resource busy or locked" workaround

**URL:** <https://discourse.julialang.org/t/documenter-jl-build-resource-busy-or-locked-workaround/114965>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [May 30, 2024, 1:11pm UTC](https://discourse.julialang.org/t/documenter-jl-build-resource-busy-or-locked-workaround/114965 "2024-05-30T13:11:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxkapur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxkapur/32/21208_2.png) [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Post date:** [May 30, 2024, 1:11pm UTC](https://discourse.julialang.org/t/documenter-jl-build-resource-busy-or-locked-workaround/114965/1 "2024-05-30T13:11:56Z")

</div>

After building docs from Documenter.jl for my project in Windows, for some reason there are always two processes `cmd.exe` and `gksqt.exe` that remain alive with locks on one of the subdirectories in `docs/build/`. As a result, I can’t build docs again without opening resmon, searching processes for the problem file handle, and manually killing them.

This is a known issue on and off in Documenter.jl. For some, the problem resolved itself after a Julia update:

> <https://github.com/JuliaDocs/Documenter.jl/issues/1685>
>
> When I try to build the docs of \[IntervalLinearAgebra\](https://github.com/juliai…ntervals/intervallinearalgebra.jl) locally with \`julia --project=docs docs/make.jl\`, the first time everything goes smoothly, however if I try to build it again I get the error
> 
> \`\`\`
> (process:17384): GLib-GIO-WARNING \*\*: 10:48:17.179: Unexpectedly, UWP app \`Evernote.Evernote\_10.19.2.0\_x86\_\_q4d96b2w5wcc2' (AUMId \`Evernote.Evernote\_q4d96b2w5wcc2!Evernote') supports 1 extensions but has no verbs
> \[ Info: SetupBuildDirectory: setting up build directory.
> ERROR: LoadError: SystemError (with build\\explanations): rmdir: Permission denied
> Stacktrace:
> \[1\] systemerror(p::Symbol, errno::Int32; extrainfo::String)
> @ Base .\\error.jl:168
> \[2\] #systemerror#62
> @ .\\error.jl:167 \[inlined\]
> \[3\] rm(path::String; force::Bool, recursive::Bool)
> @ Base.Filesystem .\\file.jl:290
> \[4\] rm(path::String; force::Bool, recursive::Bool)
> @ Base.Filesystem .\\file.jl:282
> \[5\] runner(#unused#::Type{Documenter.Builder.SetupBuildDirectory}, doc::Documenter.Documents.Document)
> @ Documenter.Builder C:\\Users\\lucaa\\.julia\\packages\\Documenter\\R2HVS\\src\\Builder.jl:100
> \[6\] dispatch(#unused#::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Documents.Document)
> @ Documenter.Utilities.Selectors C:\\Users\\lucaa\\.julia\\packages\\Documenter\\R2HVS\\src\\Utilities\\Selectors.jl:170
> \[7\] #2
> @ C:\\Users\\lucaa\\.julia\\packages\\Documenter\\R2HVS\\src\\Documenter.jl:257 \[inlined\]
> \[8\] cd(f::Documenter.var"#2#3"{Documenter.Documents.Document}, dir::String)
> @ Base.Filesystem .\\file.jl:95
> \[9\] #makedocs#1
> @ C:\\Users\\lucaa\\.julia\\packages\\Documenter\\R2HVS\\src\\Documenter.jl:256 \[inlined\]
> \[10\] top-level scope
> @ C:\\Users\\lucaa\\projects\\IntervalLinearAlgebra\\docs\\make.jl:7
> \`\`\`
> 
> after manually killing the \`gksqt.exe\` process from the task manager, it works again. Given the weirdness of the issue, I suspect it's windows related 
> 
> \### system info
> \`\`\`
> Julia Version 1.6.1
> Commit 6aaedecc44 (2021-04-23 05:59 UTC)
> Platform Info:
> OS: Windows (x86\_64-w64-mingw32)
> CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
> WORD\_SIZE: 64
> LIBM: libopenlibm
> LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
> Environment:
> JULIA\_EDITOR = code.cmd -g
> \`\`\`
> 
> \### Documenter version: 0.27.5

And for others, the issue could be traced to VSCode, so it wasn’t really Documenter.jl’s problem:

> <https://github.com/JuliaDocs/Documenter.jl/issues/1513>
>
> On GitHub Actions, from a (private) package that does this:
> 
> \`\`\`julia
> using D…ocumenter
> DocMeta.setdocmeta!(SteroidComputationalChemistry, :DocTestSetup, :(using SteroidComputationalChemistry, MolecularGraph, ElectronDisplay); recursive=true)
> doctest(SteroidComputationalChemistry, manual = false)
> \`\`\`
> 
> I'm seeing this:
> 
> \`\`\`
> \[ Info: SetupBuildDirectory: setting up build directory.
> \[ Info: Doctest: running doctests.
> \[ Info: Skipped ExpandTemplates step (doctest only).
> \[ Info: Skipped CrossReferences step (doctest only).
> \[ Info: Skipped CheckDocument step (doctest only).
> \[ Info: Skipped Populate step (doctest only).
> \[ Info: Skipped RenderDocument step (doctest only).
> Doctests: SteroidComputationalChemistry: Error During Test at C:\\Users\\runneradmin\\.julia\\packages\\Documenter\\FuXcO\\src\\Documenter.jl:830
> Test threw exception
> Expression: all\_doctests()
> SystemError (with C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\jl\_XDdaUo): rmdir: Permission denied
> Stacktrace:
> \[1\] systemerror(::Symbol, ::Int32; extrainfo::String) at .\\error.jl:168
> \[2\] #systemerror#48 at .\\error.jl:167 \[inlined\]
> \[3\] rm(::String; force::Bool, recursive::Bool) at .\\file.jl:286
> \[4\] (::Documenter.var"#all\_doctests#35"{Bool,Array{Regex,1},Array{Module,1}})() at C:\\Users\\runneradmin\\.julia\\packages\\Documenter\\FuXcO\\src\\Documenter.jl:826
> \[5\] macro expansion at C:\\Users\\runneradmin\\.julia\\packages\\Documenter\\FuXcO\\src\\Documenter.jl:830 \[inlined\]
> \[6\] macro expansion at C:\\buildbot\\worker\\package\_win64\\build\\usr\\share\\julia\\stdlib\\v1.5\\Test\\src\\Test.jl:1115 \[inlined\]
> \[7\] doctest(::Nothing, ::Array{Module,1}; fix::Bool, testset::String, doctestfilters::Array{Regex,1}) at C:\\Users\\runneradmin\\.julia\\packages\\Documenter\\FuXcO\\src\\Documenter.jl:830
> \`\`\`
> 
> This particular error only happens on Windows. Any ideas?

I don’t know who to “blame” for the issue, but I am just curious if anyone has found a workaround that is better than what I am doing in resmon. I have taken to just running `killall cmd.exe && killall qksqt.exe` after each build, but for obvious reasons I can’t recommend this approach to others.

---

<div class="post-metadata">

**Author:** ![Boris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/boris/32/3306_2.png) [@Boris](https://discourse.julialang.org/u/Boris)\
**Post date:** [May 30, 2024, 8:22pm UTC](https://discourse.julialang.org/t/documenter-jl-build-resource-busy-or-locked-workaround/114965/2 "2024-05-30T20:22:40Z")

</div>

I started learning Documenter.jl two days ago and got really confused, I get this error several times in a row and couldn’t understand what I am doing wrong. I am not used to using multiple packages and don’t know how they work (you do “activate docs” at some point) which itself was not connected but was already introducing some difficulties and then I got it.

The first time, I opened the .html in build in my browser (Firefox) and recompiled make.jl multiple times and just refreshed the site locally without problems. Then I got the error and I had to completely close Firefox (not just the tab).

Then I tried it in Edge and it worked again for a while without having to close it but I also started having the error. But closing the browser completely fixes it for me.
