# From time to time modules gives me this error "fatal: unable to read tree xxxxx"

**URL:** <https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085>\
**Category:** support\
**Tags:** modules\
**Created:** [October 28, 2020, 4:55pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085 "2020-10-28T16:55:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [October 28, 2020, 4:55pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/1 "2020-10-28T16:55:11Z")

</div>

I use modules with great pleasure. And it works really fine.

But from time to time, when I come back to my previous hugo site, hugo refuse to run ( `hugo`, or `hugo mod whatever`) and I get module errors (see below).  
I have a simple conf modules (no cache).

Only workaround is to go to the incriminated folder and delete `/var/folders/4y/1tx3_dgs3fb03yt9qn94t_p80000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/`.

Then `hugo mod get -u` works again flawlessly.

I really can’t see any pattern or suspect event.  
Strangely, nothing on the forum, so I suspect it is on my side (Mac OCS 10.14.6) but My Mac works flawelessly other wise (and for any hugo dev).

- go version go1.14 darwin/amd64
- Hugo Static Site Generator v0.76.5/extended darwin/amd64 BuildDate: unknown

```auto
git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ bebef28ef4042314444135b792412e27cd65cacf in /var/folders/4y/1tx3_dgs3fb03yt9qn94t_p80000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/af84862f31480277295d6b56de5d7a9c09dd6b9bc638b6e38612aca6a1427340: exit status 128:
Didiers-MacBook-Pro:lachotte-agico user$ hugo mod get -u
git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ bebef28ef4042314444135b792412e27cd65cacf in /var/folders/4y/1tx3_dgs3fb03yt9qn94t_p80000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/af84862f31480277295d6b56de5d7a9c09dd6b9bc638b6e38612aca6a1427340: exit status 128:
        fatal: unable to read tree 785252b9f18cce1da97e26a462cc8f13d0d85357
git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ ad2d187b1d48fb621753d0c078381fd6303d69cd -- instantpage in /var/folders/4y/1tx3_dgs3fb03yt9qn94t_p80000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/2a11e8fb79a05c0b6f67e0bb3af5b54c81dbe0381e21eb92d0510973178aae71: exit status 128:
        fatal: unable to read tree 48757c1383cc4b69e76a76a3556023469219595e
git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ e59ce5e84f1e1b54adaae99e57bf8565b11d4690 in /var/folders/4y/1tx3_dgs3fb03yt9qn94t_p80000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/cache/vcs/833a458ba91fc76b3a659dcee2eed02270e3f45ba1056648f0c563a18ba34a57: exit status 128:
        fatal: unable to read tree 854450eebf4f053e44a55f0af026692b2ea6b0a0

```

```auto
[module]
  [[module.imports]]
    path = "github.com/divinerites/plausible-hugo"
  [[module.imports]]
    path = "github.com/divinerites/divinerites-cookies"
  [[module.imports]]
    path = "github.com/divinerites/divinerites-lazyload"
  [[module.imports]]
    path = "github.com/divinerites/divinerites-maps"
  [[module.imports]]
    path = "github.com/divinerites/divinerites-images-asset"
  [[module.imports]]
    path = "github.com/gohugoio/hugo-mod-jslibs/instantpage"
  [[module.imports]]
    path = "github.com/bep/hugo-starter-tailwind-basic"

```

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [October 28, 2020, 9:54pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/2 "2020-10-28T21:54:07Z")

</div>

Have you been doing any `git push -f` by any chane?

Also note that you can do:

```auto
hugo mod clean

```

Or

```auto
hugo mod clean --all

```

I have experienced what you see, but I’m pretty sure that has always been in situations where I have deleted Git refs remotely (e.g. by force pushing).

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [October 28, 2020, 10:09pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/3 "2020-10-28T22:09:48Z")

</div>

Mmmm … No, just standard & classic push (I verified).

And for the `hugo mod clean` I’m _pretty_ (but not 100% to be honest) sure I tried it.

I will have an open eye for the next time and have a more accurate report about various commands (sorry for this time not to be more precise).

Thanks for your informations about this

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [October 28, 2020, 10:16pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/4 "2020-10-28T22:16:31Z")

</div>

> [@bep](#):
>
> always been in situations where I have deleted Git refs remotely (e.g. by force pushing).

Ah … but I have 2 external modules where I have no control. So may be _they_ have done this force push. Could make sense.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [October 28, 2020, 11:00pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/5 "2020-10-28T23:00:42Z")

</div>

Note that I’m not saying 100% that there isn’t an issue here, and it could also be platform variations, but, luckily for me, that would be an upstream Go issue hopefully improved in the future.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [October 30, 2020, 11:00pm UTC](https://discourse.gohugo.io/t/from-time-to-time-modules-gives-me-this-error-fatal-unable-to-read-tree-xxxxx/29085/6 "2020-10-30T23:00:48Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
