AWS Amplify CLI:将资源推送到云时出错

Posted

技术标签:

【中文标题】AWS Amplify CLI:将资源推送到云时出错【英文标题】:AWS Amplify CLI: An error occurred when pushing the resources to the cloud 【发布时间】:2021-05-23 00:07:14 【问题描述】:

我正在尝试使用放大推送将 lambda 函数的一些更改上传到后端。我已经使用了很多次,没有任何问题,但突然间我遇到了错误,无法将资源推送到云端

完成以下操作后会发生错误:

Successfully pulled backend environment dev from 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\testgo\dist\latest-build.zip H:\Documents\React 
JS\ihubdashboard\amplify\backend\function\testgo\bin\main
failed to compress file: open H:\Documents\React 
JS\ihubdashboard\amplify\backend\function\testgo\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\testgo\dist\latest-build.zip H:\Documents\React 
JS\ihubdashboard\amplify\backend\function\testgo\bin\main
failed to compress file: open H:\Documents\React 
JS\ihubdashboard\amplify\backend\function\testgo\bin\main: The system cannot find the file specified.

这是另一个:

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.

Command failed with exit code 1: go get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip
# cd C:\Users\Name\go\src\github.com\aws\aws-lambda-go; git pull --ff-only
fatal: Unable to create 'C:/Users/Name/go/src/github.com/aws/aws-lambda-go/.git/ORIG_HEAD.lock': File 
exists.

这是我收到的当前错误消息:

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
package github.com/aws/aws-lambda-go/cmd/build-lambda-zip: exit status 128
An error occurred during the push operation: Command failed with exit code 1: go get -u 
github.com/aws/aws-lambda-go/cmd/build-lambda-zip
# cd C:\Users\Name\go\src\github.com\aws\aws-lambda-go; git pull --ff-only
fatal: Unable to create 'C:/Users/Name/go/src/github.com/aws/aws-lambda-go/.git/ORIG_HEAD.lock': File 
exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
package github.com/aws/aws-lambda-go/cmd/build-lambda-zip: exit status 128

以前有人经历过吗?或者知道该怎么做?

提前致谢

【问题讨论】:

【参考方案1】:

原来是一个错误 - 将被修复。更多细节可以在下面找到:

https://github.com/aws-amplify/amplify-cli/issues/6679

https://github.com/aws-amplify/amplify-cli/issues/6693

【讨论】:

以上是关于AWS Amplify CLI:将资源推送到云时出错的主要内容,如果未能解决你的问题,请参考以下文章

AWS- Amplify - Appsync:使用 CLI 从 Android 应用程序更改云资源时,正确的工作流程是啥?

如何将 AWS Amplify 控制台中的现有应用程序与 AWS Amplify CLI 连接?

为啥 AWS amplify 无法识别更新的节点版本?

React 应用程序在本地加载图像,但 AWS Amplify 不会加载这些图像

将 AWS Amplify 前端连接到 AWS Elastic Beanstalk 后端时出现 CORS 问题

AWS amplify add auth:如何在执行 amplify cli 后添加重定向登录 URI