Hello,
Thank's for the great job on GoHugo 🙏
I'm using the GoHugo built-in instagram shortcode and I just found out that the build will fail if the instagram post ID is missing.
Building sites … ERROR 2020/02/25 14:34:20 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://instagram.com/p/B0d6sYnn-w7/&hidecaption=1": Failed to retrieve remote file: Not Found
Total in 691 ms
Error: Error building site: logged 1 error(s)
It can happen anytime when you're embedding a post from an account that is not yours. The whole website should not break for a resource you don't have control on 🤔
Would it be possible to fix that?
I'm using hugo v0.62.2
Related to:
https://github.com/gohugoio/hugo/issues/5643
https://github.com/gohugoio/hugo/issues/5659
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
I don't know if it has been fixed since, but that should not be closed automatically :)
Same issue. Related: https://github.com/gohugoio/hugo/issues/7879
You can now configure this to not fail.
You can now configure this to not fail.
@bep Great, but how? I don't see any new info about that on the official doc 🤔
@monsieurnebo,
This configuration option was added in https://github.com/gohugoio/hugo/commit/fdfa4a5fe62232f65f1dd8d6fe0c500374228788. It will be available in the next release, or you can build Hugo from source.
The configuration option is documented within the error message. For example:
ERROR 2020/10/26 07:08:17 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://instagram.com/p/B0d6sYnn-w7/&hidecaption=0": Failed to retrieve remote file: Bad Request
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
ignoreErrors = ["error-remote-getjson"]
You can also ignore getCSV errors:
ERROR 2020/10/26 07:17:53 Failed to get CSV resource "https://example.com/foo.csv": Failed to retrieve remote file: Not Found
If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
ignoreErrors = ["error-remote-getcsv"]
@jmooring Thanks for the informations.
Most helpful comment
@monsieurnebo,
This configuration option was added in https://github.com/gohugoio/hugo/commit/fdfa4a5fe62232f65f1dd8d6fe0c500374228788. It will be available in the next release, or you can build Hugo from source.
The configuration option is documented within the error message. For example:
You can also ignore
getCSVerrors: