Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build should not fail when Instagram post is missing in shortcode #6954

Closed
monsieurnebo opened this issue Feb 25, 2020 · 8 comments
Closed
Labels

Comments

@monsieurnebo
Copy link

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:
#5643
#5659

@stale
Copy link

stale bot commented Jun 26, 2020

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.

@stale stale bot added the Stale label Jun 26, 2020
@monsieurnebo
Copy link
Author

I don't know if it has been fixed since, but that should not be closed automatically :)

@k4rtik
Copy link
Contributor

k4rtik commented Oct 25, 2020

Same issue. Related: #7879

@bep
Copy link
Member

bep commented Oct 25, 2020

You can now configure this to not fail.

@bep bep closed this as completed Oct 25, 2020
@monsieurnebo
Copy link
Author

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 πŸ€”

@jmooring
Copy link
Member

@monsieurnebo,

This configuration option was added in fdfa4a5. 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"]

@monsieurnebo
Copy link
Author

@jmooring Thanks for the informations.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants