gpt4 book ai didi

amazon-web-services - 无效的操作配置 : Exception while trying to read the task definition artifact file

转载 作者:行者123 更新时间:2023-12-04 16:01:43 29 4
gpt4 key购买 nike

我有一个 Codepipeline,它使用 ECS 蓝/绿部署操作将 ECR 镜像部署到 ECS 集群。该管道包含两个源:一个用于使用 AWS ECR 操作的 ECR 图像,另一个用于使用第三方 Github 操作从 Github 获取配置。 ECR 操作输出 image 工件,而 Github 操作输出 config 工件。这两个工件都作为 ECS 蓝/绿部署操作的输入提供。
管道在 ECS 蓝/绿部署操作失败,并显示以下错误(从 AWS 控制台可见):

Invalid action configuration

Exception while trying to read the task definition artifact file from: config


这是管道的结构(为了匿名,编辑了一些细节):
$ aws codepipeline get-pipeline --name my-codepipeline
{
"pipeline": {
"name": "my-codepipeline",
"roleArn": "arn:aws:iam::123456789000:role/my-codepipeline-role",
"artifactStore": {
"type": "S3",
"location": "my-codepipeline-s3"
},
"stages": [
{
"name": "Source",
"actions": [
{
"name": "ImageSource",
"actionTypeId": {
"category": "Source",
"owner": "AWS",
"provider": "ECR",
"version": "1"
},
"runOrder": 1,
"configuration": {
"ImageTag": "latest",
"RepositoryName": "my-ecr"
},
"outputArtifacts": [
{
"name": "image"
}
],
"inputArtifacts": []
},
{
"name": "ConfigSource",
"actionTypeId": {
"category": "Source",
"owner": "ThirdParty",
"provider": "GitHub",
"version": "1"
},
"runOrder": 1,
"configuration": {
"Branch": "master",
"OAuthToken": "****",
"Owner": "me",
"PollForSourceChanges": "false",
"Repo": "application-config"
},
"outputArtifacts": [
{
"name": "config"
}
],
"inputArtifacts": []
}
]
},
{
"name": "Deploy",
"actions": [
{
"name": "DeployBackend",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"provider": "CodeDeployToECS",
"version": "1"
},
"runOrder": 1,
"configuration": {
"AppSpecTemplateArtifact": "config",
"AppSpecTemplatePath": "production/appspec.yaml",
"ApplicationName": "my-codedeploy",
"DeploymentGroupName": "my-codedeploy-group",
"Image1ArtifactName": "image",
"Image1ContainerName": "IMAGE_NAME",
"TaskDefinitionTemplateArtifact": "config",
"TaskDefinitionTemplatePath": "production/taskdef.json"
},
"outputArtifacts": [],
"inputArtifacts": [
{
"name": "image"
},
{
"name": "config"
}
]
}
]
}
],
"version": 1
},
"metadata": {
"pipelineArn": "arn:aws:codepipeline:ap-northeast-1:123456789000:my-codepipeline",
"created": 1564107543.285,
"updated": 1564107543.285
}
}
我已经检查了 S3 中的压缩工件,它肯定包含 Github 存储库中 AppSpecTemplatePathTaskDefinitionTemplatePath 指定位置的配置文件。
这是 appspec.yaml 的内容:
$ cat production/appspec.yaml
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: <TASK_DEFINITION>
LoadBalancerInfo:
ContainerName: "my-container"
ContainerPort: 80

最佳答案

在广泛尝试之后,我偶然发现了一个我找不到的外语线程。该线程说传递给操作的工件不能大于 3 MB。

我通过减小工件的大小( config )解决了我的问题。配置存储库在许多项目之间共享,通过将这些项目移动到另一个项目,我将压缩的工件大小从 14 MB 减少到 3 kB。奇迹般地,一切正常。 AWS,如果您正在阅读本文,请向 ECS CodeDeploy 添加更多关于工件大小限制的文档,因为我没有看到任何关于此的提及,而且我无法使用如此一般的错误消息调试此问题。

关于amazon-web-services - 无效的操作配置 : Exception while trying to read the task definition artifact file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57216053/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com