Resolving YAML parsing errors in AEM Cloud Manager CDN configuration deployment

This article explains how to resolve YAML parsing errors that occur when deploying CDN configuration files through the AEM Cloud Manager pipeline, even when the YAML passes external validation tools.

Description description

Environment

Adobe Experience Manager as a Cloud Service (all versions)

Issue/Symptoms

  • The Cloud Manager pipeline fails during deployment of cdn.yaml with a YAML parsing error.
  • The YAML file appears valid in external validators.

Cause

The error is typically caused by YAML formatting issues such as incorrect indentation, the use of tab characters, or trailing whitespace. These issues may not be detected by generic YAML validators but are enforced by the Cloud Manager pipeline.

Resolution resolution

To fix the YAML parsing error, follow these steps:

  1. Check for indentation issues:

    • Ensure all YAML keys and list items are correctly indented according to the structure expected by AEM Cloud Manager.

    • For example, the - name and rules entries must be indented according to their respective levels in the YAML hierarchy.

    • Example structure:

    code language-none
    trafficFilters:
        rules:
            - name: block-example
            when:
                allOf:
                - { reqProperty: tier, equals: "publish" }
                - { reqProperty: path, equals: "/content/example/path" }
                - { reqProperty: clientIp, notIn: [  "192.0.2.0/24", "198.51.100.0/24" ]  }
            action:
                type: block
    
  2. Remove trailing whitespace and tab characters:

    • Open the cdn.yaml file in a text editor that can display whitespace characters.

    • Remove any tab characters or trailing whitespace, especially after the last configuration line (for example, after type: block).

  3. Validate YAML with external tools:

    • Use tools like yamllint (https://www.yamllint.com/) to check for generic YAML syntax errors.

    • Note: Passing external validation does not guarantee that the file meets AEM Cloud Manager requirements.

  4. Validate with Cloud Manager pipeline:

    • Commit and push the corrected cdn.yaml to your source control repository.

    • Run the Cloud Manager configuration pipeline to verify that the error is resolved.

  5. Review Configuring Traffic at the CDN for correct structure.

recommendation-more-help
experience-cloud-kcs-help-kbarticles