Unable to run Contentful Compose migrations scripts
See original GitHub issueExpected Behavior
Using the experimental version of the CLI for migrations should allow me to use the relationshipType
validation on a field to work with Compose.
Followed steps on this page
Actual Behavior
Error in regards to relationshipType
validation.
Error: A field can't have "relationshipType" as a validation.
Error: A field can't have "relationshipType" as a validation.
Publish Content Type page
π¨ Migration unsuccessful
π¨ Error: Validation Errors
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Error: Validation Errors β
β at run β
β (/usr/local/lib/node_modules/contentful-cli/node_modules/contentful-migratiβ¦ β
β at processTicksAndRejections (internal/process/task_queues.js:97:5) β
Possible Solution
Someone I know has the CLI working when the contentful-migration
dependency of the CLI is set to 4.2.0-experimental.4
.
After installing the contentful-cli@experimental
package locally and looking at the package-lock.json
, the contentful-migration
dependency is set to "contentful-migration": "^4.2.0-experimental.1"
. However, the actual version being installed when installing the CLI locally and globally is 4.2.3
. This makes sense to me since the version set will allow for newer minor and patch versions to be installed. The experimental patch version would probably need to be fixed in order to consistently get it.
Steps to Reproduce
- Have tried with Node versions 12 and 14.
npm cache clean --force
npm install -g contentful-cli@experimental
npm list -ag | grep contentful
-> showscontentful-migration@4.2.3
as the CLI dependencycontentful space migration --space-id <space-id> --environment-id <env> --management-token <mgmt-token> --header "x-contentful-enable-alpha-feature: assembly-types" <migration-script-file.js>
using an example like this one here- Error above is shown
Context
I am trying to run migration scripts that work with Contentful Compose via the CLI. Specifically, I am creating a new page type and am updating the page
content type to link to the my new page type. Looks essentially the same as example here.
I am completely unable to run my migration scripts that work with Compose which is blocking us.
Observations and things Iβve tried:
- Cleared npm cache
- Different Node/NPM versions (node 14 and 12)
- Manual global install of experimental contentful-migration package before global install of contentful-cli@experimental
- Local installation
- Installing contentful-cli using the
--save-exact
npm install flag and the--strict-peer-deps
flags
Environment
- Language Version:
v14.17.0
- Package Manager Version:
7.17.0
- Browser Version: n/a
- Operating System:
Darwin US3CREM00F9JG5J 19.6.0 Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64 x86_64
- Package Version:
contentful-cli@1.6.3-experimental.1
Same error occurring with a node:12.22.1-buster-slim
Docker container running npm install -g contentful-cli@experimental
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
Hi @thomas-ej-mcdonald,
we created a new version where
contentful-migration@4.2.0-experimental.1
is pinned!@marcolink you as well!