Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The provided space does not exist or you do not have access.

See original GitHub issue

Expected Behavior

Run a migration js script with node

$ node ./migrate.js

I expected to ask a confirmation to run the migration.

Actual Behavior

The script tells me the space does not exists:

{ makeRequest: [Function: makeRequest],
  application: 'contentful.migration-cli/0.10.0',
  accessToken: <accessToken>,
  spaceId: <spaceId>,
  environmentId: 'develop' }
The provided space does not exist or you do not have access.

🚨  Migration unsuccessful

The object you see is the log of the context. Anyway, I can definitely confirm that the space exists, I used it before in both environments (master, develop). I tried also hardcoding “master” environmentId, but does not work anyway.

Steps to Reproduce

Here is my scripts:

  • migrate.js
const runMigration = require('contentful-migration/built/bin/cli').default;
const pathJoin = require('path').join;
const options = require('./config/tcom/config.test.json');

function migrate() {
    spaceId: options['space-id'],
    environmentId: options['environment-id'],
    accessToken: options['access-token'],
    filePath: pathJoin(__dirname, 'migrations/3.13.0.js')
    .then(() => console.log('Migration Done!'))
    .catch((e) => console.error(e));

  • migrations/3.13.0.js
module.exports = async function (migration, context) {
  const pack = migration.editContentType('pack');

  pack.createField('servicesDescription', {
    name: 'Services Description',
    type: 'Text'



  • Node Version: 8.11.3
  • Package Manager Version: 5.6.0
  • Operating System: Windows 10 64-bit
  • Package Version: contentful-migration v0.10.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

OskarKaminskicommented, Oct 24, 2018

Please fix your docs because you everywhere refer “Personal Management Key” as “Access Key”. There are 3 access keys in CF - Delivery, preview and personal management…

Khaledgarbayacommented, Jul 18, 2018

Hi @nicco91, There is nothing new implemented, it is impossible to use the delivery token which is read-only with the migration tool in all of the versions because it requires to do write operation thus it need always the management token. I think there might a confusion in your side

Best, Khaled

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Others can not access my page. getting page does n...
Go to space space settings -> permissions. And make sure that these users are granted the view permission either directly or via a...
Read more >
Cannot find the object because it does not exist or you do not ...
I've been trying to copy a table from PROD to DEV but get an error: "Cannot find the object X because it does...
Read more >
Troubleshooting common SPMT issues and errors
In this article, you'll learn how to troubleshoot common errors in the SharePoint Migration Tool (SPMT).
Read more >
Troubleshooting AWS Cloud9
Cause: The user that you signed in to the AWS Cloud9 console with doesn't have the correct AWS access permissions to perform the...
Read more >
GraphQL Content API - Contentful
The token must have access to the space and environment you're targeting. ... Unlike the CDA, the GraphQL Content API does not support...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found