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.

Terminal size is 0 on CI and so diff and deploy throws exception when trying to create table of changes

See original GitHub issue

Describe the bug In some CI setups (CircleCI and Jenkins), process.stdout.column can return 0 and so when the cdk uses the table library to create the table of resources to print to logs it throws an exception as terminal width cannot be 0.

To Reproduce Run any cdk diff or cdk deploy command on a terminal with 0 width or on a CI setup where process.stdout.column returns 0

CI Logs https://circleci.com/gh/CSmither/aws-cdk-demo/30

> stack@0.1.0 cdk /home/circleci/repo/stack
> cdk "deploy"

COLUMN WIDTH ===> 0
This deployment will make potentially sensitive changes according to your current security approval level (--require-approval broadening).
Please confirm you intend to make the following modifications:

IAM Statement Changes
Column width must be greater than 0.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! stack@0.1.0 cdk: `cdk "deploy"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the stack@0.1.0 cdk script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/circleci/.npm/_logs/2019-04-12T07_25_54_317Z-debug.log
Exited with code 1

Expected behavior Print a table of the stack to logs and continue on to either describe diff or deploy stack

Version:

  • OS: Linux host with docker image (circleci/node:11.9.0-stretch)
  • Language: Node Typescript
  • CDK Version: 0.28.0 from npm

Notes Stack overflow post just to link them

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
mt-yohei-koyamacommented, Nov 9, 2020

I use stty rows ROW_NUMBER cols COLUMN_NUMBER as a workaround for CircleCI. Example:

- run:
    name: diff
    command: |
      stty rows 64 cols 204
      npx cdk diff --app "npx ts-node bin/A.ts"

Just FYI for CircleCI and cdk user.

0reactions
eladbcommented, Apr 14, 2019

Thanks for reporting!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting CI/CD - GitLab Docs
GitLab provides several tools to help make troubleshooting your pipelines easier. This guide also lists common issues and possible solutions.
Read more >
Zero Downtime Deployment with a Database - Spring
This article will explain in depth how to tackle issues related to database compatibility and the deployment process.
Read more >
Troubleshoot Dataflow errors - Google Cloud
If you run into problems with your Dataflow pipeline or job, this page lists error messages that you might see and provides suggestions...
Read more >
Troubleshooting Node.js Deploys - Heroku Dev Center
Check the buildpack; Compare Node and npm Versions; Make sure the ... will be created from the slug of the most recent deploy,...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
The state returned from AWS CloudFormation is usually UPDATE_ROLLBACK_FAILED or DELETE_FAILED , and the error will look something like this: The ...
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