HUGO

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

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
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
[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"

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

Also note that you can do:

hugo mod clean

Or

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).

1 Like

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

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

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.

1 Like

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