-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Synth NodejsFunction: Error: ENOTEMPTY: directory not empty, rmdir #32098
Comments
Hi @rupe120 , thanks for reaching out. I tried to repro the issue with this minimal code of Lambda node js function and its succeeding with synth as well as deployment. Sharing the details - Code - const dlQueue = new sqs.Queue(this, 'dlQueue', {
queueName: 'dlQueue'
});
const testGetTextractTextDetectionLambda = new NodejsFunction(this, 'test-get-textract-text-detection',
{
codeSigningConfig: undefined,
functionName:'test-get-textract-text-detection',
description: `Get Textract text detection`,
runtime: Runtime.NODEJS_20_X,
timeout: cdk.Duration.minutes(15),
entry: 'lib/index.ts',
handler: 'index.handler',
tracing: Tracing.ACTIVE,
insightsVersion: LambdaInsightsVersion.VERSION_1_0_143_0,
deadLetterQueue: dlQueue,
deadLetterQueueEnabled: true,
memorySize: 1024,
environment: {
NODE_ENV: "test"
}
});
const sourceBucket = new s3.Bucket(this, 'sourceBuckettestDeploy', {
bucketName: 'source-bucket-test-deploy',
removalPolicy: cdk.RemovalPolicy.DESTROY
});
sourceBucket.grantReadWrite(testGetTextractTextDetectionLambda);
testGetTextractTextDetectionLambda.addToRolePolicy(new PolicyStatement(
{
actions: [
'textract:GetDocumentTextDetection'
],
resources: ['*']
}
));
//added these statement after 1st synth
new cdk.CfnOutput(this, 'testGetTextractTextDetectionLambda', { value: testGetTextractTextDetectionLambda.functionArn });
new cdk.CfnOutput(this, 'sourceBucket', { value: sourceBucket.bucketName });
} the code synthesized successfully and I am able to see the used cdk version - 2.166.0 Node - v20.17.0 As I am not able to repro the scenario, could you please share the minimal self contained code to repro the issue. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This seems to be a Windows issue. It works fine, using the same path in WSL |
So, I'm wondering if in your use case, the previous Thanks, |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
cdk synth
fails if a prior synth exists incdk.out
with the error:Regression Issue
Last Known Working CDK Version
Unknown, I tried prior versions and was not able to find one that worked. This was working for me about a week ago and then suddenly stopped.
Expected Behavior
A successful synth
Current Behavior
See description
Reproduction Steps
I have not had the time to rebuild a project to see if it happens with the lambda definition in a fresh project.
This is the lambda definition though:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.166.0
Framework Version
2.166.0
Node.js Version
v20.10.0
OS
Windows 11 Enterprise 22621.4169
Language
TypeScript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: