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

An error occurred when pushing the resources to the cloud #6693

Closed
el-sacapuntas opened this issue Feb 20, 2021 · 6 comments
Closed

An error occurred when pushing the resources to the cloud #6693

el-sacapuntas opened this issue Feb 20, 2021 · 6 comments
Labels
bug Something isn't working functions Issues tied to the functions category

Comments

@el-sacapuntas
Copy link

el-sacapuntas commented Feb 20, 2021

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker

Describe the bug
Updated amplify-cli and pushed updates to cloud. Updated files again and ran amplify push --y and the command failed with the following message:

√ Successfully pulled backend environment dev from the cloud.
An error occurred when pushing the resources to the cloud

Command failed with exit code 1: C:\Users\Name\go\bin\build-lambda-zip.exe -o H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\dist\latest-build.zip H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main
failed to compress file: open H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main: The system cannot find the file specified.
An error occurred during the push operation: Command failed with exit code 1: C:\Users\Name\go\bin\build-lambda-zip.exe -o H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\dist\latest-build.zip H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main
failed to compress file: open H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main: The system cannot find the file specified.

I can run amplify pull --restore without errors but cannot push any new updates through to the backend

Amplify CLI Version
4.44.0

To Reproduce
run 'amplify push --y' from the vs code terminal

edit - steps before this error first occurred:

added new lambda function to api via amplify add function
added path to new function with amplify update api
ran amplify push -- y
message to upgrade to latest. Upgraded
amplify push --y (all worked well)
updated code and ran amplify push again and got error

Expected behavior
Updated files to be pushed through to backend

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10 (VS code)
  • Node Version v12.18.4

Log output

2021-02-20T15:45:42.554Z|info : amplify status core  
2021-02-20T15:49:39.089Z|info : amplify push core  {"yes":true}
2021-02-20T15:49:51.006Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-02-20T15:49:51.007Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\config"])
2021-02-20T15:49:51.008Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-east-2"}])
2021-02-20T15:49:51.008Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2021-02-20T15:49:51.009Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\credentials"])
2021-02-20T15:49:51.023Z|info : amplify-provider-awscloudformation.zip-util.downloadZip.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip"},null])
2021-02-20T15:49:51.028Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip","Bucket":"[***]ify-[***]hboard-[***]ev-[***]435-[***]ment"}])
2021-02-20T15:50:00.116Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-02-20T15:50:00.116Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\config"])
2021-02-20T15:50:00.117Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-east-2"}])
2021-02-20T15:50:00.117Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2021-02-20T15:50:00.117Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\credentials"])
2021-02-20T15:50:00.126Z|info : amplify-provider-awscloudformation.initialize-env.run.cfn.updateamplifyMetaFileWithStackOutputs([{"StackName":"[***]ify-[***]hboard-[***]ev-[***]435"}])
2021-02-20T15:50:01.990Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]ify-[***]json","Bucket":"[***]ify-[***]hboard-[***]ev-[***]435-[***]ment"}])
2021-02-20T15:50:12.574Z|error : amplify-provider-awscloudformation.push-resources.run([{"resourcesToBeCreated":[],"resourcesToBeUpdated":[{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-20T15:07:25.858Z","lastPackageTimeStamp":"2021-02-19T18:55:57.863Z","distZipFilename":"[***]stration-[***]627a3049-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]stration-cloudformation-template.json","logicalId":"[***]registration"},"lastPushTimeStamp":"2021-02-20T15:50:01.964Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]mpleteregistration-[***]ev","Name":"[***]stration-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRole509a890b-dev"},"lastPushDirHash":"kStCD/6+MH8WVl5QMR04zUM/4A4=","resourceName":"[***]stration","category":"function"}],"resourcesToBeSynced":[],"resourcesToBeDeleted":[],"tagsUpdated":false,"allResources":[{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","lastBuildTimeStamp":"2021-02-10T19:37:19.391Z","lastPackageTimeStamp":"2021-02-10T19:37:30.340Z","distZipFilename":"[***]tgo-[***]62695343-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]tgo-cloudformation-template.json","logicalId":"[***][***]tgo"},"lastPushTimeStamp":"2021-02-20T15:50:01.945Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]ction:testgo-[***]ev","Name":"[***]tgo-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRoled4c6cffc-dev"},"lastPushDirHash":"5kwPkpYuV6qrD8Zk8o2ZD4oxFTo=","resourceName":"testgo","category":"function"},{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-19T18:55:49.402Z","lastPackageTimeStamp":"2021-02-19T18:55:57.802Z","distZipFilename":"[***]data-[***]6966756a-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]data-cloudformation-template.json","logicalId":"[***]apidata"},"lastPushTimeStamp":"2021-02-20T15:50:01.954Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]tion:fbapidata-[***]ev","Name":"[***]data-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRoled7f793d1-dev"},"lastPushDirHash":"nTuB11f+6lE+91iip3a7k2S6NmU=","resourceName":"fbapidata","category":"function"},{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-20T15:07:25.858Z","lastPackageTimeStamp":"2021-02-19T18:55:57.863Z","distZipFilename":"[***]stration-[***]627a3049-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]stration-cloudformation-template.json","logicalId":"[***]registration"},"lastPushTimeStamp":"2021-02-20T15:50:01.964Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]mpleteregistration-[***]ev","Name":"[***]stration-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRole509a890b-dev"},"lastPushDirHash":"kStCD/6+MH8WVl5QMR04zUM/4A4=","resourceName":"completeregistration","category":"function"},{"service":"API Gateway","providerPlugin":"[***]rmation","dependsOn":[{"category":"function","resourceName":"testgo","attributes":["Name","Arn"]},{"category":"function","resourceName":"completeregistration","attributes":["Name","Arn"]}],"providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/api/[***]api-cloudformation-template.json","logicalId":"[***]bapi"},"lastPushTimeStamp":"2021-02-20T15:50:01.974Z","output":{"ApiName":"[***]api","RootUrl":"https://[***]wvs4.execute-api.us-east-2.amazonaws.com/dev","ApiId":"x2n6rowvs4"},"lastPushDirHash":"QYgyKF7WEowsKiK526daDhFY750=","resourceName":"ihubapi","category":"api"}]}])
Error: Command failed with exit code 1: C:\Users\Name\go\bin\build-lambda-zip.exe -o H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\dist\latest-build.zip H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main
failed to compress file: open H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main: The system cannot find the file specified.
2021-02-20T16:00:28.914Z|info : amplify push core  {"yes":true}
2021-02-20T16:00:40.638Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-02-20T16:00:40.639Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\config"])
2021-02-20T16:00:40.640Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-east-2"}])
2021-02-20T16:00:40.641Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2021-02-20T16:00:40.641Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\credentials"])
2021-02-20T16:00:40.655Z|info : amplify-provider-awscloudformation.zip-util.downloadZip.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip"},null])
2021-02-20T16:00:40.661Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip","Bucket":"[***]ify-[***]hboard-[***]ev-[***]435-[***]ment"}])
2021-02-20T16:00:47.221Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-02-20T16:00:47.222Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\config"])
2021-02-20T16:00:47.223Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-east-2"}])
2021-02-20T16:00:47.223Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2021-02-20T16:00:47.223Z|info : amplify-provider-awscloudformation.system-config-manager.makeFileOwnerReadWrite(["C:\\Users\\Name\\.aws\\credentials"])
2021-02-20T16:00:47.232Z|info : amplify-provider-awscloudformation.initialize-env.run.cfn.updateamplifyMetaFileWithStackOutputs([{"StackName":"[***]ify-[***]hboard-[***]ev-[***]435"}])
2021-02-20T16:00:48.868Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]ify-[***]json","Bucket":"[***]ify-[***]hboard-[***]ev-[***]435-[***]ment"}])
2021-02-20T16:00:58.842Z|error : amplify-provider-awscloudformation.push-resources.run([{"resourcesToBeCreated":[],"resourcesToBeUpdated":[{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-20T15:07:25.858Z","lastPackageTimeStamp":"2021-02-19T18:55:57.863Z","distZipFilename":"[***]stration-[***]627a3049-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]stration-cloudformation-template.json","logicalId":"[***]registration"},"lastPushTimeStamp":"2021-02-20T16:00:48.844Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]mpleteregistration-[***]ev","Name":"[***]stration-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRole509a890b-dev"},"lastPushDirHash":"kStCD/6+MH8WVl5QMR04zUM/4A4=","resourceName":"[***]stration","category":"function"}],"resourcesToBeSynced":[],"resourcesToBeDeleted":[],"tagsUpdated":false,"allResources":[{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","lastBuildTimeStamp":"2021-02-10T19:37:19.391Z","lastPackageTimeStamp":"2021-02-10T19:37:30.340Z","distZipFilename":"[***]tgo-[***]62695343-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]tgo-cloudformation-template.json","logicalId":"[***][***]tgo"},"lastPushTimeStamp":"2021-02-20T16:00:48.824Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]ction:testgo-[***]ev","Name":"[***]tgo-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRoled4c6cffc-dev"},"lastPushDirHash":"5kwPkpYuV6qrD8Zk8o2ZD4oxFTo=","resourceName":"testgo","category":"function"},{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-19T18:55:49.402Z","lastPackageTimeStamp":"2021-02-19T18:55:57.802Z","distZipFilename":"[***]data-[***]6966756a-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]data-cloudformation-template.json","logicalId":"[***]apidata"},"lastPushTimeStamp":"2021-02-20T16:00:48.834Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]tion:fbapidata-[***]ev","Name":"[***]data-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRoled7f793d1-dev"},"lastPushDirHash":"nTuB11f+6lE+91iip3a7k2S6NmU=","resourceName":"fbapidata","category":"function"},{"build":true,"providerPlugin":"[***]rmation","service":"Lambda","dependsOn":[],"lastBuildTimeStamp":"2021-02-20T15:07:25.858Z","lastPackageTimeStamp":"2021-02-19T18:55:57.863Z","distZipFilename":"[***]stration-[***]627a3049-[***].zip","providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/function/[***]stration-cloudformation-template.json","logicalId":"[***]registration"},"lastPushTimeStamp":"2021-02-20T16:00:48.844Z","output":{"Region":"us-east-2","Arn":"[***]mbda:us-[***]st-[***]mpleteregistration-[***]ev","Name":"[***]stration-[***]ev","LambdaExecutionRole":"ihubdashboardLambdaRole509a890b-dev"},"lastPushDirHash":"kStCD/6+MH8WVl5QMR04zUM/4A4=","resourceName":"completeregistration","category":"function"},{"service":"API Gateway","providerPlugin":"[***]rmation","dependsOn":[{"category":"function","resourceName":"testgo","attributes":["Name","Arn"]},{"category":"function","resourceName":"completeregistration","attributes":["Name","Arn"]}],"providerMetadata":{"s3TemplateURL":"https://s3.amazonaws.com/amplify-ihubdashboard-dev-232435-deployment/amplify-cfn-templates/api/[***]api-cloudformation-template.json","logicalId":"[***]bapi"},"lastPushTimeStamp":"2021-02-20T16:00:48.854Z","output":{"ApiName":"[***]api","RootUrl":"https://[***]wvs4.execute-api.us-east-2.amazonaws.com/dev","ApiId":"x2n6rowvs4"},"lastPushDirHash":"QYgyKF7WEowsKiK526daDhFY750=","resourceName":"ihubapi","category":"api"}]}])
Error: Command failed with exit code 1: C:\Users\Name\go\bin\build-lambda-zip.exe -o H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\dist\latest-build.zip H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main
failed to compress file: open H:\Documents\React JS\ihubdashboard\amplify\backend\function\completeregistration\bin\main: The system cannot find the file specified.
2021-02-20T16:10:01.416Z|info : amplify version core  {"version":true,"yes":false}
@rajrajhans
Copy link
Contributor

rajrajhans commented Feb 20, 2021

Similar issue can be reproduced by following these steps:

  • amplify init
  • amplify add api
    • select REST
    • in lambda function options, choose "Go" as the runtime
  • amplify push

EDIT: including more details as observed -

Case 1: With CLI v4.44.0 and I follow the steps mentioned above : Error occurs.

Case 2: I switch from 4.44.0 to 4.43.0 and do amplify push in the same project : Error still occurs.

Case 3: I switch from 4.44.0 to 4.43.0 (in a new project now) and follow all steps right from the start : It works fine without any error.

@el-sacapuntas
Copy link
Author

Similar issue can be reproduced by following these steps:

  • amplify init

  • amplify add api

    • select REST
    • in lambda function options, choose "Go" as the runtime
  • amplify push

EDIT: including more details as observed -

Case 1: With CLI v4.44.0 and I follow the steps mentioned above : Error occurs.

Case 2: I switch from 4.44.0 to 4.43.0 and do amplify push in the same project : Error still occurs.

Case 3: I switch from 4.44.0 to 4.43.0 (in a new project now) and follow all steps right from the start : It works fine without any error.

Installed v4.43.0 and ran amplify push in the same project: error still occurs here too. Haven't tried a new project, but this implies that there is an issue inside the project?

@el-sacapuntas
Copy link
Author

el-sacapuntas commented Feb 21, 2021

UPDATE

installed amplify cli v4.42.0
amplify pull --restore
(modify code)
amplify push --y

√ All resources are updated in the cloud

@akshbhu
Copy link
Contributor

akshbhu commented Feb 22, 2021

Hi @el-sacapuntas and @rajrajhans

Thanks for the repro. We have identified this as bug and merged a PR for the this. This will be available in next release in our next release.

@akshbhu akshbhu added bug Something isn't working functions Issues tied to the functions category labels Feb 22, 2021
@edwardfoyle
Copy link
Member

closing as dupe of #6679

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working functions Issues tied to the functions category
Projects
None yet
Development

No branches or pull requests

4 participants