# Documenter: SystemError while trying to read Statistics.jl

**URL:** <https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363>\
**Category:** New to Julia\
**Tags:** documenter\
**Created:** [April 20, 2019, 11:59pm UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363 "2019-04-20T23:59:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [April 20, 2019, 11:59pm UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363/1 "2019-04-20T23:59:23Z")

</div>

I have imported the `Statistics.mean` function in my package and declared new methods for it. The code is fine and works well. I have documented the methods. While building the doc, Documenter gives me two Warnings and one Error:

┌ Warning: no doc found for reference ‘`missing`’ in src\riemannianGeometry.md.  
└ @ Documenter.CrossReferences C:\Users\congedom.julia\packages\Documenter\G5Sup\src\CrossReferences.jl:160  
┌ Warning: no doc found for reference ‘`skipmissing`’ in src\riemannianGeometry.md.  
└ @ Documenter.CrossReferences C:\Users\congedom.julia\packages\Documenter\G5Sup\src\CrossReferences.jl:160  
[ Info: CheckDocument: running document checks.  
ERROR: SystemError: opening file “C:\cygwin\home\Administrator\buildbot\worker\package\_win64\build\usr\share\julia\stdlib\v1.1\Statistics\src\Statistics.jl”: No such file or directory

I am working on Windows 10 with Julia Version 1.1.0.  
I have installed cygwin, but that did not solve the error.

P.S. this seems related to [19414](https://discourse.julialang.org/t/error-loaderror-ioerror-chdir-buildworker-worker-package-linux64-build-usr-share-julia-stdlib-v1-0-sockets-src-no-such-file-or-directory-enoent/), but the discussion did not end there.

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [April 21, 2019, 9:38am UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363/2 "2019-04-21T09:38:42Z")

</div>

Yeah, it seems similar to the issue you link to. Is your code public? It’s hard to debug this without an MWE. Alternatively, if you can figure out where in Documenter the error is thrown, that might also help. What version of Documenter are you using?

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [April 21, 2019, 10:02am UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363/3 "2019-04-21T10:02:57Z")

</div>

Yes it is public. The branch i have tried to build that gives me the error (using Travis in the github repo but also internally on my PC) is named ‘devmean’. In the master branch the same method is named `meanP` and the documentation build goes fine there.  
[https://github.com/Marco-Congedo/PosDefManifold.jl/tree/devmean](https://github.com/Marco-Congedo/PosDefManifold.jl/tree/devmean)

The method for the `mean` function i wrote currently starts at line 995 of [https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/riemannianGeometry.jl](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/riemannianGeometry.jl)

The @docs is here: [https://github.com/Marco-Congedo/PosDefManifold.jl/edit/devmean/docs/src/riemannianGeometry.md](https://github.com/Marco-Congedo/PosDefManifold.jl/edit/devmean/docs/src/riemannianGeometry.md)

The `mean` function is imported from `Statistics` in the main module (currently line 47):  
[https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/PosDefManifold.jl](https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/PosDefManifold.jl)

These are the versions:

[e30172f5] Documenter v0.22.3  
[35a29f4d] DocumenterTools v0.1.0

Finally, here is the Stacktrace of the error when i try to build the doc internally (the one generated by Travis is slightly different)

Stacktrace:  
[1] #systemerror#43(::Nothing, ::Function, ::String, ::Bool) at .\error.jl:134  
[2] systemerror at .\error.jl:134 [inlined]  
[3] #open#309(::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Function, ::String) at .\iostream.jl:283  
[4] open at .\iostream.jl:275 [inlined]  
[5] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(Base, Symbol(“##274#275”)){String}, ::String) at .\iostream.jl:367  
[6] open at .\iostream.jl:367 [inlined]  
[7] read at .\io.jl:297 [inlined]  
[8] find\_block\_in\_file(::String, ::String) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Utilities\Utilities.jl:19  
[9] report(::Documenter.DocTests.Result, ::String, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:263  
[10] checkresult(::Module, ::Documenter.DocTests.Result, ::Dict{Symbol,Any}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:213  
[11] eval\_repl(::Markdown.Code, ::Module, ::Dict{Symbol,Any}, ::Documenter.Documents.Document, ::Documenter.Documents.Page) at  
C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:150  
[12] doctest(::Markdown.Code, ::Dict{Symbol,Any}, ::Documenter.Documents.Document, ::Documenter.Documents.Page) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:90  
[13] (::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document})(::Markdown.Code) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:34  
[14] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.Code) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:464  
[15] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478  
[16] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471  
[17] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478  
[18] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471  
[19] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478  
[20] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471  
[21] walk(::Function, ::Dict{Symbol,Any}, ::Documenter.Documents.DocsNode) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:503  
[22] walk(::Function, ::Dict{Symbol,Any}, ::Array{Union{DocsNode, Admonition},1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478  
[23] walk(::Function, ::Dict{Symbol,Any}, ::Documenter.Documents.DocsNodes) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:502  
[24] doctest(::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:33  
[25] runner(::Type{Documenter.Builder.CheckDocument}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Builder.jl:190  
[26] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Utilities\Selectors.jl:167  
[27] (::getfield(Documenter, Symbol(“##3#8”)))() at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documenter.jl:287  
[28] cd(::getfield(Documenter, Symbol(“##3#8”)), ::String) at .\file.jl:85  
[29] #makedocs#1(::Bool, ::Documenter.Writers.HTMLWriter.HTML, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:sitename,),Tuple{String}}}, ::typeof(makedocs)) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documenter.jl:286  
[30] (::getfield(Documenter, Symbol(“#kw##makedocs”)))(::NamedTuple{(:sitename,),Tuple{String}}, ::typeof(makedocs)) at .\none:0  
[31] top-level scope at none:0

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [April 22, 2019, 1:09am UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363/4 "2019-04-22T01:09:29Z")

</div>

Ok, I think I have identified the problem in Documenter and have an idea for a fix ([#1002](https://github.com/JuliaDocs/Documenter.jl/pull/1002)).

But your setup had a configuration problem as well which exposed this. You were including the docstrings of `mean` from Base too. You should add `modules=[PosDefManifold]` to `makedocs` to make sure that non-PosDefManifold docstrings get filtered out.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [April 22, 2019, 7:24am UTC](https://discourse.julialang.org/t/documenter-systemerror-while-trying-to-read-statistics-jl/23363/5 "2019-04-22T07:24:12Z")

</div>

adding

> [@mortenpi](#):
>
> modules=[PosDefManifold]

to makedocs solved the problem. Thanks 🙂
