Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't run migration by following the tutorial  #34

@chuve

Description

@chuve

Brief bug description

What went wrong?

Try following the instructions https://github.com/Kentico/kontent-cli/#-migration-example and run a migration, but get a error:

echuvelev@chuvelev-mbp  ~/Code/kontent-migrations-boilerplate   master  ?  npm run migrate "01_sample_init_createBlogType"                                  1   20:40:55

> kontent-migrations-boilerplate@1.1.1 migrate
> tsc && kontent migration run --environment DEV -n "01_sample_init_createBlogType"

kontent migration run

Runs a migration script specified by its name, or runs multiple migration scripts in the specified order.

Options:
  --version                Show version number  [boolean]
  -h, --help               Show help  [boolean]
  --name, -n               Migration name  [string]
  --project-id, -p         Project ID to run the migration script on  [string]
  --api-key, -k            Management API key  [string]
  --environment, -e        Environment name  [string]
  --all, -a                Run all migration scripts in the specified order  [boolean]
  --range, -r              Run all migration scripts in the specified range, eg.: 3:5 will run migrations with the "order" property set to 3, 4 and 5  [string]
  --force, -f              Enforces run of already executed scripts.  [boolean] [default: false]
  --continue-on-error, -c  Continue executing migration scripts even if a migration script fails.  [boolean] [default: false]
  --debug, -d              Run in debug mode  [boolean] [default: false]

TypeError: Cannot read properties of undefined (reading 'match')
    at Object.exports.getRange (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/@kentico/kontent-cli/lib/cmds/migration/run.js:180:25)
    at /Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/@kentico/kontent-cli/lib/cmds/migration/run.js:120:34
    at Generator.next (<anonymous>)
    at /Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/@kentico/kontent-cli/lib/cmds/migration/run.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/@kentico/kontent-cli/lib/cmds/migration/run.js:4:12)
    at Object.handler (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/@kentico/kontent-cli/lib/cmds/migration/run.js:115:24)
    at Object.runCommand (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/yargs/build/lib/command.js:196:48)
    at Object.parseArgs [as _parseArgs] (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/yargs/build/lib/yargs.js:1043:55)
    at Object.runCommand (/Users/echuvelev/Code/kontent-migrations-boilerplate/node_modules/yargs/build/lib/command.js:157:36)

Repro steps

  1. Clone repo kontent-migrations-boilerplate
  2. Follow the instruction - https://github.com/Kentico/kontent-cli/#3-run-a-migration
  3. See the error

Expected behavior

Running the 01_sample_init_createBlogType.js migration.
Status file was updated see /Users/echuvelev/Code/kontent-migrations-boilerplate/status.json
The "01_sample_init_createBlogType.js" migration on a project with ID "7bc88b7e-80d2-0087-4b4e-a33e80420328" executed successfully.

What the correct behavior is?

  • Migration has run successfully.

Test environment

  • Platform/OS: MacOS Monterey 12.3.1

Additional context

Add any other context about the problem here.

Screenshots

Add links to screenshots, if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions