question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(pipelines): Malformed YAML during stage deployment

See original GitHub issue

Not 100% sure if this is a CDK, CodePipeline or CloudFormation bug.

It appears that CloudFormation bug (https://github.com/aws/aws-cdk/issues/11910) that has blocked our deployments for a few weeks was fixed! 🎉

However, trying to deploy the same stack to our first application stage now results in the following:

Template format error: YAML not well-formed. (line 5034, column 88) (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 6c5ea7db-4315-4f03-9b58-97af912c627a)

Which is odd - if I synthesize that stack locally, the YAML produced is only ~3000 lines long. Not really sure what I can do on my side to pinpoint the syntax error, if there is one.

Reproduction Steps

  1. Add a few resources (a composite alarm, a few normal ones, some metrics) to a stack, that already has a lot of monitoring resources
  2. Push the change, triggering the CDK pipeline

What did you expect to happen?

The stack to be deployed successfully in all application stages.

What actually happened?

The prepare step for the stack in the first stage fails with the error:

Template format error: YAML not well-formed. (line 5034, column 88) (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 6c5ea7db-4315-4f03-9b58-97af912c627a)

Environment

  • CDK CLI Version : 1.82.0
  • Framework Version: 1.82.0
  • Node.js Version: 14.13.0
  • OS : Ubuntu 20.04
  • Language (Version): TypeScript

Other

  • Region: eu-north-1
  • Pipeline execution ID: f1bed18e-5916-44ef-acf0-edb3215d8c74
  • CloudFormation request ID: 6c5ea7db-4315-4f03-9b58-97af912c627a

This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:13
  • Comments:45 (23 by maintainers)

github_iconTop GitHub Comments

3reactions
nschwellnuscommented, Jul 25, 2022

We were also experiencing the issue. In our case it was a combination of size and non-ascii characters. After increasing the size of the Stack the Prepare Step failed with “Template format error: JSON not well-formed”. After removing non-ascii characters (ü in our case) the stack could be deployed via the pipeline normally. 24KB with non-ascii characters -> Working 98KB with non-ascii characters -> Not Working (JSON not well-formed Error) 98KB without non-ascii characters -> Working

3reactions
hoegertncommented, Jan 6, 2021

Yup, that was my thought. Feel free to resolve this , if you think it’s technically not a CDK issue, even though the CFN limit isn’t clear.

But a more descriptive error would be amazing in this case! 😃 And if possible, using a TemplateURL for CloudFormation calls to allow for bigger templates (although I can see how this could be more complicated, due to S3 cross account permissions).

I am in contact next week with the CodePipeline team to discuss this. This is ridiculous in my opinion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize your pipeline - Azure Pipelines - Microsoft Learn
Step -by-step tutorial to customize a pipeline. ... A pipeline is defined using a YAML file in your repo. Usually, this file is...
Read more >
Configuring CI/CD Pipelines as Code with YAML in Azure ...
Click the Deploy stage to follow each task. Expand the AzureRmWebAppDeployment task to review the steps performed during the Azure deployment.
Read more >
Pipeline YAML Reference - Semaphore 2.0 Documentation
This document details YAML grammar used for describing the pipelines of Semaphore 2.0 projects. The core properties of a Semaphore pipeline configuration file ......
Read more >
Troubleshooting Amazon SageMaker Model Building Pipelines
Your pipeline definition might not be formatted correctly. This can result in your execution failing or your job being inaccurate. These errors can...
Read more >
mapping values are not allowed in this context - Stack Overflow
1). A syntax error (in your case it is not) in the yaml file. Use a YAML linter to be sure that your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found