Hugo: Fix flaky integration tests on CI

Created on 21 Oct 2020  路  8Comments  路  Source: gohugoio/hugo

ERROR 2020/10/21 07:25:56 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://instagram.com/p/BWNjjyYFxVx/&hidecaption=1": Failed to retrieve remote file: Bad Request

Also similar for the Twitter.

Bug

All 8 comments

I'm assuming this is a rate limit issue? I wonder if it would it help to add backoff+retry options to the getJSON func.

We're not adding stuff to getJSON -- that will soon (hopefully) be replaced by a (hopefully) more robust resources.GetRemote (or something).

Finally!!

cc: @kaushalmodi

@onedrawingperday Thanks for tagging me here (and even remembering that I very much was troubled by that getJSON error).

@kaushalmodi You're welcome. I've also been beaten by this error myself and I followed the discussion back then between you and Bj酶rn Erik closely. So of course, I remembered.

Due to failed HTTP requests the instagram short code has been removed from https://github.com/gohugoio/hugoBasicExample. However, approximately 20 whitelisted themes on www.themes.gohugo.io use a (customized) version of the https://github.com/gohugoio/hugoBasicExample that still include the instagram shortcode. Thus the demos for this themes can't be build.

As mentioned by Alexandros here the error can be suppressed for the whitelisted themes with an config option once Hugo 0.77.0 is released.


The actual reason why getJSON fails seems to be that the instagram shortcode is generating urls that point to a deprecated Instragram API endpoint.

When using the instagram shortcode with id BWNjjyYFxVx the shortcodes uses this template to construct the url https://api.instagram.com/oembed/?url=https://instagram.com/p/BWNjjyYFxVx. When opening it a notice informs you about the deprecation of the linked API endpoint.

Hello @digitalcraftsman

instagram shortcode is generating urls that point to a deprecated Instragram API endpoint.

The above merits its own issue in the main issues tracker.

Apparently Instagram is ending the last remaining public API endpoint.

The Instagram shortcodes will either need to be refactored or removed.

Hello Alexandros,

I've added the information for context but created a new issue as suggested by you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sigma picture sigma  路  3Comments

crash-dive picture crash-dive  路  3Comments

antifuchs picture antifuchs  路  3Comments

chrissparksnj picture chrissparksnj  路  3Comments

tjamet picture tjamet  路  3Comments