Skip to content

Restore fails when publishing languageVariants with non-localizable elements #159

@sho19

Description

@sho19

When restoring an environment using @kontent-ai/data-ops, the process fails with the following error if content items contain non-localizable elements:

Error:
{"message":"Bad Request – Publishing item failed because some non-localizable elements need to be published in the default variant.","errorCode":4040031}

It looks like the tool attempts to publish non-default language variants before publishing the default language variant. Since non-localizable fields must be published in the default variant first, the restore fails.

Steps to reproduce:

  1. Create a content type with a required non-localizable element (e.g., asset, taxonomy).
  2. Publish items with multiple language variants.
  3. Export environment.
  4. Try to restore into a clean environment.
  5. Restore fails at the languageVariants step with the error above.

Expected behavior:
The tool should first publish the default language variant, then proceed with other language variants.

Workaround:
Running restore with --skipPublish works, but requires manual publishing afterwards.

Tool version: @kontent-ai/data-ops @kontent-ai/data-ops (latest as of 2025-09-29)

Node.js version: 20.19.4

OS: Mac os

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