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

(Deployment template): (Deployment failed to create lambda function "errorMessage": "Could not unzip uploaded file. Please check your file, then try to upload again.",) #307

Open
runchengwang opened this issue Oct 28, 2024 · 1 comment
Labels
awssol_nofirstresponsesla bug Something isn't working

Comments

@runchengwang
Copy link

runchengwang commented Oct 28, 2024

Describe the bug

Try to deploy with following s3 template url but failed to create some lamdba functions:

https://solutions-reference.s3.amazonaws.com/centralized-logging-with-opensearch/latest/CentralizedLoggingFromExistingVPCWithOIDC.template

Errors:

2024-10-28T07:57:29.561Z
AWS::Lambda::Function
APIAppLogIngestionAPISubscribeMemberAcct...
CREATE_FAILED
Resource handler returned message: "Could not unzip uploaded file. Please check your file, then try to upload again. (Service: Lambda, Status Code: 400, Request ID: de760390-e24a-4b3d-8605-be3780967b13)" (RequestToken: e0f4c217-2239-edf7-3d41-aa22cc9d948c, HandlerErrorCode: InvalidRequest)

Checked lambda cloudtrail:

"eventTime": "2024-10-28T07:57:29Z",
"eventSource": "lambda.amazonaws.com",
"eventName": "CreateFunction20150331",
"awsRegion": "cn-north-1",
"sourceIPAddress": "cloudformation.amazonaws.com",
"userAgent": "cloudformation.amazonaws.com",
"errorCode": "InvalidParameterValueException",
"errorMessage": "Could not unzip uploaded file. Please check your file, then try to upload again.",
"requestParameters": {
"functionName": "archero2-eks-logs-s3-APIAppLogIngestionAPISubscrib-3oA3MI6jBJ1X",
"runtime": "python3.11",
"role": "arn:aws-cn:iam::19038xx69886:role/archero2-eks-logs-s3-APIAppLogIngestionAPISubscribe-o0QsnUiDv400",
"handler": "lambda_function.lambda_handler",
"code": {
"s3Bucket": "solutions-cn-north-1",
"s3Key": "centralized-logging-with-opensearch/v2.2.2/d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip"
},
"description": "archero2-eks-logs-s3 - Using the SQS in CLO account to subscribe the SNS in Member Account",
"timeout": 120,
"memorySize": 512,
"publish": false,
"environment": {},
"tags": {
"aws:cloudformation:stack-name": "archero2-eks-logs-s3",
"aws:cloudformation:stack-id": "arn:aws-cn:cloudformation:cn-north-1:19038xx69886:stack/archero2-eks-logs-s3/66b68bc0-9501-11ef-b1b8-0e26e2af6b72",
"aws:cloudformation:logical-id": "APIAppLogIngestionAPISubscribeMemberAcctSNSHandlerE1EE3E34"
},
"layers": [
"arn:aws-cn:lambda:cn-north-1:19038xx69886:layer:SharedPythonLayer40DE0AAD:1"
],
"fileSystemConfigs": [],
"architectures": [
"x86_64"
]
},

download lambda code zip file and try to unzip but failed to unzip it.

$ aws s3 cp s3://solutions-cn-north-1/centralized-logging-with-opensearch/v2.2.2/d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip .
download: s3://solutions-cn-north-1/centralized-logging-with-opensearch/v2.2.2/d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip to ./d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip

$ ll
total 4
-rw-rw-r-- 1 ec2-user ec2-user 368 Aug 20 11:37 d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip

$ unzip d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip
Archive: d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip or
d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip.zip, and cannot find d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip.ZIP, period.

Expected Behavior

v2.2.2 should works

Current Behavior

deployment failed, using v2.2.1 as a workaround.

Reproduction Steps

download and check the s3 file:
"s3Bucket": "solutions-cn-north-1",
"s3Key": "centralized-logging-with-opensearch/v2.2.2/d97dedf3dc2298a2f55fd72d99e477fd45709da409a71415853bb827dc04f93b.zip"

Also please check if more s3 file got same issue.

Possible Solution

Try v2.2.1 and it works:
https://solutions-reference.s3.amazonaws.com/centralized-logging-with-opensearch/v2.2.1/CentralizedLoggingFromExistingVPCWithOIDC.template

Additional Information/Context

No response

Solution Version

v2.2.1 (older than v2.2.2 should be fine)

AWS Region. e.g., us-east-1

cn-north-1

Other information

No response

@runchengwang runchengwang added the bug Something isn't working label Oct 28, 2024
@fhoueto-amz
Copy link
Member

Thanks for reporting this. We will look into and revert back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awssol_nofirstresponsesla bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants