dify-self-hosted-on-aws: An error occurs when deploying the ECS Fargate API, and the deployment does not complete, resulting in a timeout error.
I tried deploying Dify to AWS, but when I deploy the Fargate API task, the task fails to start and ends with an error.
- The deployment keeps failing with errors (eventually a timeout occurs), so the ECS circuit breaker is enabled to forcibly terminate the deployment.
The following is the content of the error, but how should I respond?
Source code
Only bin/cdk.ts has been modified as follows. The other files have not been modified.
export const props: EnvironmentProps = {
awsRegion: 'ap-northeast-1',
awsAccount: '123456789',
difyImageTag: 'latest',
difySandboxImageTag: 'latest',
domainName: 'example.com',
subDomain: 'dify',
isRedisMultiAz: false,
enableAuroraScalesToZero: true,
useNatInstance: true,
useCloudFront: true
};
Commands
# success
npx cdk bootstrap --profile=my-profile
# received error
npx cdk deploy --all --profile=my-profile
Error on ECS deploy
The same error as in this link (https://github.com/aws-samples/dify-self-hosted-on-aws/issues/3) is displayed.
cannotPullContainerError: ref pull has been retried 1 time(s): failed to unpack image on snapshotter overlayfs: mismatched image rootfs and manifest layers
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (15 by maintainers)
🎉 I’ll take a look at it tomorrow. Thanks!
@tatsuyoshi-mashiko Have you seen a similar error as below when running cdk deploy?
Also, does your CDK ECR repositroy (it looks like
cdk-hnb659fds-container-assets-<accout>-<region>) contain 0MB images?If so, the below steps should resolve the problem:
Setting
BUILDX_NO_DEFAULT_ATTESTATIONS=1also seems to fix the problem, but you have to correctly invalidate build caches (e.g. inserting lines likeENV FOO 1right afterFROMline in two Dockerfiles (sandbox and external-knowledge-api.)Another workaround is to deploy it from CloudShell as described here, which should just work without any workaround.
References:
Hi @tatsuyoshi-mashiko thank you for the trial and error. As my colleague reproduced a similar issue, I’ll dive deep into it tomorrow in his environment.