# Error: Tree Hash Mismatch! only on MacOs for all julia versions

**URL:** <https://discourse.julialang.org/t/error-tree-hash-mismatch-only-on-macos-for-all-julia-versions/100695>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [June 22, 2023, 11:17am UTC](https://discourse.julialang.org/t/error-tree-hash-mismatch-only-on-macos-for-all-julia-versions/100695 "2023-06-22T11:17:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Hamel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/craig_hamel/32/202434_2.png) [@Craig\_Hamel](https://discourse.julialang.org/u/Craig_Hamel)\
**Post date:** [June 22, 2023, 11:17am UTC](https://discourse.julialang.org/t/error-tree-hash-mismatch-only-on-macos-for-all-julia-versions/100695/1 "2023-06-22T11:17:45Z")

</div>

Hi all,  
I have a package, Exodus.jl, that I’ve been working on for the past year or so. It is in the General registry and I’m currently experiencing a tree has mismatch for users trying to add the package on mac os only. I know I can circumvent this issue with the following environment variable trick

```julia
ENV["JULIA_PKG_IGNORE_HASHES"] = 1

```

but it seems a little non user friendly for those using Mac.

Here is the stack trace when trying to add the package on mac after typing

```julia
pkg> add Exodus

```

```julia
ERROR: LoadError: Unable to automatically download/install artifact 'Exodus' from sources listed in '/Users/runner/.julia/packages/Exodus_jll/ykNCT/Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/21cf8e25ed9bfa1031d9f4eed57a2ab7b4ff1493
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1: 21cf8e25ed9bfa1031d9f4eed57a2ab7b4ff1493
  Calculated git-tree-sha1: d201e96a38e01ca3779200e765f568d1c80f9f02
- https://github.com/JuliaBinaryWrappers/Exodus_jll.jl/releases/download/Exodus-v8.19.0+0/Exodus.v8.19.0.x86_64-apple-darwin.tar.gz
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1: 21cf8e25ed9bfa1031d9f4eed57a2ab7b4ff1493
  Calculated git-tree-sha1: d201e96a38e01ca3779200e765f568d1c80f9f02

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] ensure_artifact_installed(name::String, meta::Dict{String, Any}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::IOContext{Base.PipeEndpoint})
   @ Pkg.Artifacts ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Artifacts.jl:468
 [3] download_artifacts(env::Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::IOContext{Base.PipeEndpoint})
   @ Pkg.Operations ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:665
 [4] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:1601
 [5] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
   @ Pkg.Operations ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:895
 [6] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, IOContext{Base.PipeEndpoint}, Tuple{Symbol}, NamedTuple{(:io,), Tuple{IOContext{Base.PipeEndpoint}}}})
   @ Pkg.API ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:1029
 [7] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{Base.PipeEndpoint}, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:verbose,), Tuple{Bool}}})
   @ Pkg.API ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:156
 [8] build(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:verbose,), Tuple{Bool}}})
   @ Pkg.API ~/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:171
 [9] top-level scope
   @ ~/work/_temp/ceda7fb7-520f-479a-a743-ca5ff345112c:3
in expression starting at /Users/runner/work/_temp/ceda7fb7-520f-479a-a743-ca5ff345112c:3

```

Does anyone know how I can fix this issue?

Thanks!

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 22, 2023, 12:11pm UTC](https://discourse.julialang.org/t/error-tree-hash-mismatch-only-on-macos-for-all-julia-versions/100695/2 "2023-06-22T12:11:53Z")

</div>

> [@Craig\_Hamel](#):
>
> but it seems a little non user friendly for those using Mac.

Why is that non-user-friendly and why that’s non-user-friendly specifically for those using macOS (especially since the syntax is the same for all operating systems)?

> [@Craig\_Hamel](#):
>
> Does anyone know how I can fix this issue?

Tree hashes mismatches are usually filesystem-related, a couple of common situations are:

- in the tarball there might be files with clashing names due to different cases, this is a problem on case-insensitive file systems (which is the default on macOS)
- you may have an uncommon filesystem on which the tree hash is computed differently

If the problem is the former, the solution is to remove files which clashing file names.

---

<div class="post-metadata">

**Author:** ![Craig\_Hamel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/craig_hamel/32/202434_2.png) [@Craig\_Hamel](https://discourse.julialang.org/u/Craig_Hamel)\
**Post date:** [June 22, 2023, 12:38pm UTC](https://discourse.julialang.org/t/error-tree-hash-mismatch-only-on-macos-for-all-julia-versions/100695/3 "2023-06-22T12:38:10Z")

</div>

> [@"giordano](#):
>
> Why is that non-user-friendly and why that’s non-user-friendly specifically for those using macOS (especially since the syntax is the same for all operating systems)?

I wasn’t trying to say the syntax was not user friendly but rather that it makes my package less user friendly for a mac user if they have to type this additional environment variable command.

> [@"giordano](#):
>
> Tree hashes mismatches are usually filesystem-related, a couple of common situations are:
> 
> - in the tarball there might be files with clashing names due to different cases, this is a problem on case-insensitive file systems (which is the default on macOS)
> - you may have an uncommon filesystem on which the tree hash is computed differently
> 
> If the problem is the former, the solution is to remove files which clashing file names.

Thanks for the concise answer! I’ll try to purge my package of any clashing file names.
