Error building site in gitlab if external image url not working

Hello
I am using hugo v135 in local and building works ok (just some warnings)
When deploying, also with v135, I get an error because some url images are not working (it is a blog, some images are from archive.org which is not working right now)
I have timeout = ‘600s’ in hugo.toml but it does not solve it
Image creation timeouts with Gohugo v0.131.0 — KOLLITSCH.dev*

Error: error building site: "/builds/fiquipedia/algoquedaquedecir/content/post/ratios-en-educacion-normativa.md:1:1": "/builds/fiquipedia/algoquedaquedecir/themes/hugo-clarity/layouts/_default/_markup/render-image.html:23:20": execute of template failed: template: _default/_markup/render-image.html:23:20: executing "_default/_markup/render-image.html" at <$image.MediaType.MainType>: error calling MediaType: error calling resources.GetRemote: Get "https://web.archive.org/web/20200908101237im_/https://pbs.twimg.com/media/EhYpbQZXYAE_93s.jpg": dial tcp 207.241.237.3:443: i/o timeout

I was wondering if there is some way to make it work as it does locally, without making a local copy of every image
As the blog grows using external images the probability to have some image url broken also grows.

This looks strange

Thanks for your reply: it is just the url of an archived image, it has been working for months

The problem right know (oct 13th) is archive.org is down

Internet Archive services are temporarily offline.

Despite that, building works locally

Mmh. If you can build it locally and alle the same setup fails on gitlab…maybe a networking issue there.

I suspect the build succeeds locally because Hugo has already cached the result of resources.GetRemote. Your local build will fail if you clear your cache directory. You can determine the cache directory by running:

hugo config | grep cachedir

If you don’t want Hugo to fail the build, ask the theme author to implement error checking as described here:
https://gohugo.io/functions/resources/getremote/#error-handling

Although this doesn’t help you now, in the future you can configure Hugo to cache the result of resources.GetRemote calls in the project’s resources directory:

[caches.getresource]
dir = ':resourceDir'
maxAge = -1

Then check the resources directory into source control.

2 Likes

Thank you very much
Clearing local cache I get exactly same error.
Now I understand what was happening

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