Description
copilot svc deploy (and copilot svc package --upload-assets) fails when a Load Balanced Web Service has a sidecar with image.build and the sidecar image is built/pushed during deploy.
Error
generate stack template: apply task definition overrides: unmarshal YAML template: yaml: line 451: found character that cannot start any token
Version
- Copilot CLI v1.34.1 (also
releases/latest linux/arm64)
- Service type: Load Balanced Web Service
- Platform:
linux/arm64
Reproduction
# manifest excerpt
sidecars:
nginx:
port: 80
image:
build: Dockerfile-nginx
image:
location: <prebuilt-ecr-uri> # main container uses location, not build
copilot svc init --name backend-pr-test
# ensure ECR repo api/backend-pr-test exists
copilot svc deploy --name backend-pr-test --env dev
# or: copilot svc package --name backend-pr-test --env dev --upload-assets
Expected
Valid CloudFormation template is generated and deploy succeeds.
Actual
Template generation fails at YAML parse time in internal/pkg/template/override/override.go (unmarshalYAML), called from internal/pkg/deploy/cloudformation/stack/lb_web_svc.go after ParseLoadBalancedWebService.
Workaround
Pre-build the sidecar image, push to ECR, and use image.location instead of image.build.
Suspected root cause
Sidecar image URI is rendered unquoted in internal/pkg/template/templates/workloads/partials/cf/sidecars.yml:
Image: {{$sidecar.Image}}
Similar class of bug to #3736 (unquoted special characters breaking YAML parse during task definition override step).
Environment
AWS region eu-west-2, Fargate ARM64, Copilot app api, env dev.
Description
copilot svc deploy(andcopilot svc package --upload-assets) fails when a Load Balanced Web Service has a sidecar withimage.buildand the sidecar image is built/pushed during deploy.Error
Version
releases/latestlinux/arm64)linux/arm64Reproduction
Expected
Valid CloudFormation template is generated and deploy succeeds.
Actual
Template generation fails at YAML parse time in
internal/pkg/template/override/override.go(unmarshalYAML), called frominternal/pkg/deploy/cloudformation/stack/lb_web_svc.goafterParseLoadBalancedWebService.Workaround
Pre-build the sidecar image, push to ECR, and use
image.locationinstead ofimage.build.Suspected root cause
Sidecar image URI is rendered unquoted in
internal/pkg/template/templates/workloads/partials/cf/sidecars.yml:Similar class of bug to #3736 (unquoted special characters breaking YAML parse during task definition override step).
Environment
AWS region eu-west-2, Fargate ARM64, Copilot app
api, envdev.