Contentful logo

Contentful Community

CLI: RateLimitExceeded error when generating initial migraton

#1

After using Contentful for a while, we’re keen to start managing our Content Models via migrations, so I’ve been reading all the very helpful guides.
We already have 17 Content Models, so I’d like to capture all of those in the initial migration and then create granular migrations going forward.

So I’m generating the initial migration with:
contentful space generate migration --space-id=[myspaceID]--environment-id=master -f 01_initial-migration.js

The file is created and all of the Content Models are present, however some of the calls to retrieve the editor interface settings are erroring:

RateLimitExceeded: {
  "status": 429,
  "statusText": "Too Many Requests",
  "message": "You have exceeded the rate limit of the Organization this Space belongs to by making too many API requests within a short timespan. Please wait a moment before trying the request again.",
  "details": {},
  "request": {
    "url": "https://api.contentful.com:443/spaces/[redacted]/environments/master/content_types/navCard/editor_interface",
    "headers": {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": "application/vnd.contentful.management.v1+json",
      "X-Contentful-User-Agent": "app contentful.cli/0.18.0; feature migration-generate; sdk contentful-management.js/5.2.1; platform node.js/v10.11.0; os macOS/17.7.0;",
      "Authorization": "Bearer ...deb53",
      "user-agent": "node.js/v10.11.0",
      "Accept-Encoding": "gzip"
    },
    "method": "get"
  },
  "requestId": "80cf5b77ccd91bbc5d2696f39619c1e9"
}

It’s only happening for 9 of the Content Models, not all of them, but I’m consistently seeing this error.

Obviously we’d really like the initial migration to include all of the editor interface settings.

Has anyone else come across this error? Any idea how to fix it or how I can get around it?

0 Likes

#2

Hi @katherine,

Is it possible that you are using the API concurrently with other processes that could be affecting this limit?

If so, would it be possible to temporarily cease these operations and try running the migration again?

0 Likes

#3

Hi Gabriel,

Thanks for your response. I wasn’t doing anything concurrently, and tried it quite a few times - I’m seeing this consistently.

However, I’ve realised that the ‘errors’ actually seem to just be warnings, and the migration was generated correctly.
I guess the request was retried and then worked?
It is a bit misleading, so maybe the script could be updated to indicate success.

0 Likes