Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent end of deployment #3344

Closed
1 of 5 tasks
artyom-melnikov opened this issue Jul 18, 2019 · 2 comments · Fixed by #3428
Closed
1 of 5 tasks

Silent end of deployment #3344

artyom-melnikov opened this issue Jul 18, 2019 · 2 comments · Fixed by #3428
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@artyom-melnikov
Copy link

artyom-melnikov commented Jul 18, 2019

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

I'm migrating from 0.31.0 to 1.0.0. I have a stack to create ApiGateway and Lambdas
This is part of the code:

const DEFAULT_RUNTIME = lambda.Runtime.NODEJS_8_10;
const API_LAMBDAS_BASE_PATH = path.join(__dirname, '../../rest/dist');

export class ApiStack extends cdk.Stack {
  private sharedLayer: lambda.LayerVersion;

  constructor(scope: cdk.Construct, id: string, props: ApiStackProps) {
    super(scope, id, props);

    this.createCodeAsset();
    this.createSharedLayer();
    ...
  }

  private createCodeAsset(): void {
    this.codeAsset = lambda.Code.asset(path.join(API_LAMBDAS_BASE_PATH, 'code'));
  }

  private createSharedLayer(): void {
    const layerName = StackUtils.getEnvName('api-layer', this.envName);
    this.sharedLayer = new lambda.LayerVersion(this, layerName, {
      code: lambda.Code.asset(path.join(API_LAMBDAS_BASE_PATH, 'layer')),
      compatibleRuntimes: [ DEFAULT_RUNTIME ],
      description: 'Shared dependencies layer for API Lambdas',
    });
  }
  ...
}

The deployment simply ends without any errors rights after the start. The verbose logs:

api-stackcdk1test
api-stackcdk1test: deploying...
Waiting for stack CDKToolkit to finish creating or updating...
Preparing asset apistackcdk1testapilayercdk1testCode5ED1E954: {"path":"asset.904bbef99d02b2b8c95d96e2a1621f358c424427f3d15b0c0256838afe31b98f","id":"apistackcdk1testapilayercdk1testCode5ED1E954","packaging":"zip","sourceHash":"904bbef99d02b2b8c95d96e2a1621f358c424427f3d15b0c0256838afe31b98f","s3BucketParameter":"apilayercdk1testCodeS3Bucket2C4C037A","s3KeyParameter":"apilayercdk1testCodeS3VersionKeyDFEF168D","artifactHashParameter":"apilayercdk1testCodeArtifactHash3A74B244"}
Preparing zip asset from directory: cdk.out/asset.904bbef99d02b2b8c95d96e2a1621f358c424427f3d15b0c0256838afe31b98f
  • What is the expected behavior (or behavior of feature suggested)?

Code should create resources properly

  • What is the motivation / use case for changing the behavior or adding this feature?

  • Please tell us about your environment:

    • CDK CLI Version: 1.0.0
    • Module Version: 1.0.0
    • OS: [all | Windows 10 | OSX Mojave | Ubuntu | etc... ]
    • Language: TypeScript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

Seems like either assets are stealthily fails or the LayerVersion code

@artyom-melnikov artyom-melnikov added the needs-triage This issue or PR still needs to be triaged. label Jul 18, 2019
@jogold
Copy link
Contributor

jogold commented Jul 19, 2019

What are you zipping? Related to #3145?

@artyom-melnikov
Copy link
Author

Yes, seems like the same issue. Will update #3145

jogold added a commit to jogold/aws-cdk that referenced this issue Jul 25, 2019
To preserve file order using `archiver` files must be appended serially either using stream or
buffer (appending by file path does not preserve order even when done serially).

Appending using buffer seems to be the only way to solve `EMFILE` errors.

Call `fs.stat` before appending to preserve mode.

Closes aws#3145, Closes aws#3344, Closes aws#3413
eladb pushed a commit that referenced this issue Jul 25, 2019
To preserve file order using `archiver` files must be appended serially either using stream or
buffer (appending by file path does not preserve order even when done serially).

Appending using buffer seems to be the only way to solve `EMFILE` errors.

Call `fs.stat` before appending to preserve mode.

Closes #3145, Closes #3344, Closes #3413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants