Shopware 6.7.16 Update Failed? Check Your Feature Flags Configuration!

Shopware 6.7.16 Update Failed? Check Your Feature Flags Configuration!

Updating your Shopware 6 store should ideally be a smooth process, but sometimes unexpected configuration conflicts can halt progress. A recent discussion on the Shopware forum highlighted a specific issue encountered by users attempting to update from Shopware 6.7.15.1 to 6.7.16. The core problem stemmed from a subtle yet critical change in how Shopware handles feature flags, leading to update failures with messages like "Expected string, but got bool."

The Root Cause: Feature Flag 'major' Property Change

The key insight, as detailed by a community member Julian_Braeucker, points to a breaking change introduced in Shopware 6.7.16.0. Prior to this version, the major property within feature flag definitions (e.g., for JSON_LD_DATA) was expected to be a boolean value (true or false). However, with 6.7.16.0, this property was re-purposed to specify the major version to which the flag belongs, requiring a string value (e.g., v6.8.0.0).

Shopware's update process merges feature flag configurations from all relevant files. If your store has a custom configuration file, such as z-shopware.yaml, that still contains an older feature flag definition with major: true (a boolean), this outdated entry will override the new string-based value provided by the Shopware core. This mismatch triggers a validation error during the update, manifesting as "Expected string, but got bool," and subsequently, the update fails.

Identifying and Resolving the Conflict

The solution is straightforward but requires checking your custom configuration files. If you have a z-shopware.yaml or similar custom YAML file under config/packages/ that defines Shopware feature flags, specifically look for entries under shopware.feature.flags. An example of a problematic entry might look like this:

shopware:
  feature:
    flags:
      JSON_LD_DATA:
        major: true
        # ... other properties

The fix involves removing or updating these outdated major: lines within your custom feature flag definitions. As Julian_Braeucker explained, if the entire block was simply copied from an older feature.yaml and hasn't been specifically customized, you might even be able to remove the entire feature flags section from your z-shopware.yaml, as the core Shopware installation will provide the correct, updated flags.

Actionable Steps:

  1. Locate your custom configuration files, typically config/packages/z-shopware.yaml.
  2. Search for the shopware.feature.flags section.
  3. Remove any lines that define major: true or major: false for feature flags. Ensure that if you are defining a feature flag, the major property, if present, is a string representing a version (e.g., major: v6.8.0.0). If the flag is provided by the core, simply remove your custom definition.
  4. After modifying the YAML file, clear your Shopware cache using the command line:
    bin/console cache:clear
  5. Attempt the Shopware update again.

While the Shopware release notes for 6.7.16 do mention "Feature flags can belong to a major version," this specific conflict with existing custom configurations might not be immediately obvious, making community insights like this invaluable for troubleshooting.

Other Potential Issues

The forum discussion also touched upon other general update failure symptoms, such as generic "Shopware could not be updated" messages and Composer-related stack traces. While these can sometimes indicate timeouts (e.g., PHP max_execution_time when using the web installer) or other resource limitations, the specific "Expected string, but got bool" error strongly points to the feature flag configuration issue. Always ensure your server environment meets Shopware's requirements and that PHP settings like max_execution_time and memory_limit are sufficient for updates.

This incident underscores the importance of reviewing custom configuration files and understanding breaking changes in release notes, especially when performing major or minor Shopware updates. Proactive checks can save significant troubleshooting time.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools