gatsby-source-instagram icon indicating copy to clipboard operation
gatsby-source-instagram copied to clipboard

Build works fine locally, but fails on Gatsby Cloud

Open maweo-mathis opened this issue 3 years ago • 3 comments

Hello,

I am using the plugin for public scraping for posts from our Instagram page. I configured the plugin like that:

{
      resolve: `gatsby-source-instagram`,
      options: {
        username: `80636XXXX`,
      },
},

Locally when i run gastby build everything works perfectly, but in the Gatsby cloud the build fails with the following error: 11:07:12 AM: ERROR There was an error in your GraphQL query:

11:07:12 AM: Cannot query field "allInstaNode" on type "Query".

Package.json

"dependencies": {
  "gatsby-source-instagram": "^0.9.0",
}

maweo-mathis avatar Nov 05 '21 10:11 maweo-mathis

This is normally a sign that the rate limit from Instagram prevented nodes from being sourced.

graysonhicks avatar Dec 08 '21 21:12 graysonhicks

i generally think that this might also be the deprecated "scraping-for-user profile" issue

VMargreiter avatar Jan 11 '22 14:01 VMargreiter

Yea, fair to note that almost all attempts to use the Instagram API are going to be thwarted at some point. Not unique to this plugin 😞

graysonhicks avatar Jan 11 '22 15:01 graysonhicks

@oorestisime I believe this is due to rate limiting and can be closed. There is possibly a solution using the Gatsby cache object to reduce the amount of fetching for most builds, but can be handled separately as users should associated this with the error message provided in the README. I believe this should be closed.

graysonhicks avatar Nov 03 '22 19:11 graysonhicks

More specifically, this can happen on any cloud build pipeline service because their IP range may be used very often to hit the API (not just your site building, but 100s of others). So Instagram blocks that IP range for abuse. The only way around is with the authenticated API.

graysonhicks avatar Nov 04 '22 19:11 graysonhicks