awslabs / amplify-video

An open source Category Plugin for the AWS Amplify-CLI that makes it easy to deploy live and file based streaming video services and integrate them into your Amplify applications.
https://www.npmjs.com/package/amplify-category-video
Apache License 2.0
267 stars 56 forks source link

Template error: instance of Fn::GetAtt references undefined resource videoResource #337

Open nathanagez opened 2 years ago

nathanagez commented 2 years ago

When I try to deploy an amplify project directly from a repository on the console, the build fails with this error: error occurred during the push operation: Template error: instance of Fn::GetAtt references undefined resource videotrackit

The repository contains the amplify directory and what is weird is that it’s working correctly if we clone the repository, deploy it manually and locally using the CLI. So, I tested to edit the amplify.yml by adding a custom shell script that reproduce the commands I’m sending locally but we keep having this error.

Screenshot 2021-09-28 at 11 53 57

Please, also note that:

Here is a reproduction repository: https://github.com/nathanagez/amp-video-issue-repro

wizage commented 2 years ago

So it looks like it fails before it even gets to pushing. The real error here is pushing resources to the cloud. Curious what is going on with the pushing that is causing the failure.

context.print.error(`Failed pushing to S3 with error: ${error}`);

Is how we push our content and show errors so it seems like an error with the CLI itself. I can try to reproduce but it looks like not an amplify video issue.

https://github.com/aws-amplify/amplify-cli/blob/ea2bceec74003ae04462e5d3b2293e6547569ec5/packages/amplify-provider-awscloudformation/src/push-resources.ts#L433

Here is where it fails.

Can you check your s3 bucket it uploads everything to? Make sure that it has everything.

nathanagez commented 2 years ago

Hi @wizage, after investigation, indeed, some files are not downloaded in the S3 bucket.

But I noticed that this problem only occurs if you reference the CF outputs of the amplify-video stack. If you do not use these outputs in another amplify stack, you do not encounter this problem.

I also opened an issue with AWS support but I don't think that having amplify-video's CF outputs referenced within other amplify stacks trigger the upload issue.