Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Apparent bugs: Custom vod-helper FileTrigger function appears to break deployment & Admin UI + Data #248

Closed
armenr opened this issue Apr 23, 2021 · 3 comments

Comments

@armenr
Copy link
Contributor

armenr commented Apr 23, 2021

Describe the bug
Adding a custom trigger function (additional postfix for .mp3, .pcm, .wav...etc) appears to break deployment/Admin UI

I apologize for the length of the report, but I figured it would be more helpful to include everything that's relevant, and to be thorough. Uncertain where to draw the line between amplify VS amplify-video, but going to share here and wait for advice or direction.

To Reproduce
Steps to reproduce the behavior:

Step 1 - Init totally empty/non-custom Amplify app & backend

╰─ amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project testvidoecategory1
The following configuration will be applied:

Project information
| Name: testvidoecategory1
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: none
| Source Directory Path: src
| Distribution Directory Path: dist
| Build Command: npm run-script build
| Start Command: npm run-script start

? Initialize the project with the above configuration? Yes
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use deploy-staging-us-east1
Adding backend environment dev to AWS Amplify Console app: d1sn08wq4o7i92
⠙ Initializing project in the cloud...

Step 2 - Add Auth

╰─ amplify add auth
Using service: Cognito, provided by: awscloudformation

 The current configured provider is Amazon Cognito.

 Do you want to use the default authentication and security configuration? Default configuration
 Warning: you will not be able to edit these selections.
 How do you want users to be able to sign in? Email or Phone Number
 Do you want to configure advanced settings? No, I am done.

Step 3 - Add API

╰─ amplify add api
? Please select from one of the below mentioned services: GraphQL
? Provide API name: testvidoecategory1
? Choose the default authorization type for the API Amazon Cognito User Pool
Use a Cognito user pool configured as a part of this project.
? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes.
? Configure additional auth types? No
? Enable conflict detection? Yes
? Select the default resolution strategy Auto Merge
? Do you have an annotated GraphQL schema? No
? Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)

The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth


GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
? Do you want to edit the schema now? No
Successfully added resource testvidoecategory1 locally

Step 4 - Add Video

╰─ amplify add video
? Please select from one of the below mentioned services: Video-On-Demand
? Provide a friendly name for your resource to be used as a label for this category in the project: videotest1
? Select a system-provided encoding template, specify an already-created template name:  Default HLS Adaptive Bitrate
? Is this a production enviroment? Yes
? Do you want to protect your content with signed urls? Yes
? Do you want Amplify to create a new GraphQL API to manage your videos? (Beta) Yes
Using testvidoecategory1 to manage API
? Define your permission schema Any authenticated user can upload videos
? Do you want to override your GraphQL schema? No
? Do you want to edit your newly created model? No

The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth


GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
✔ All resources built.

Step 5: Custom Video resources (trigger + audio-only media job)

You can see the code for the handler + audio-only media job here: https://gist.github.com/armenr/38017cf3c316f956dd29b1549e945906

╰─ mkdir amplify/backend/video/videotest1/custom

╰─ cp -rv tools/vod-helpers amplify/backend/video/videotest1/custom
tools/vod-helpers -> amplify/backend/video/videotest1/custom/vod-helpers
tools/vod-helpers/LambdaFunctions -> amplify/backend/video/videotest1/custom/vod-helpers/LambdaFunctions
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda -> amplify/backend/video/videotest1/custom/vod-helpers/LambdaFunctions/SetupTriggerLambda
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js -> amplify/backend/video/videotest1/custom/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js

╰─ cp tools/mediaconvert-job-temp.json amplify/backend/video/videotest1/mediaconvert-job-temp.json

Step 6: Push & Check Amplify Admin UI

⠙ Updating resources in the cloud. This may take a few minutes...
The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth

⠦ Updating resources in the cloud. This may take a few minutes...
GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
⠇ Updating resources in the cloud. This may take a few minutes...Successfully generated models. Generated models can be found in /Users/armenr/Development/new/boiler-prettier/src
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ All resources are updated in the cloud

GraphQL endpoint: https://REDACTED_ADDRESS_HERE.appsync-api.us-east-1.amazonaws.com/graphql

Video on Demand:

Input Storage bucket:
videotest1-dev-input-<REDACTED>

Output URL for content:
https://<REDACTED>.cloudfront.net


Video on Demand:

Input Storage bucket:
videotest1-dev-input-<REDACTED>

Output URL for content:
https://<REDACTED>.cloudfront.net

^^ Looks good, so far, right? :)

Admin UI Screenshot (yes, I did click on "dev" from the drop-down)

Screen Shot 2021-04-23 at 9 04 07 AM

Step 7 (unbreak my heart...and the Admin UI)

╰─ rm -rf amplify/backend/video/videotest1/custom

╰─ amplify push
✔ All resources are updated in the cloud

Admin UI Screenshot after custom function removal:

Screen Shot 2021-04-23 at 9 09 43 AM

Bonus: Step 8 (what happens if we re-deploy a custom function again, just for the sake of curiosity)?

╰─ cp -rv tools/vod-helpers amplify/backend/video/videotest1/custom
tools/vod-helpers -> amplify/backend/video/videotest1/custom
tools/vod-helpers/LambdaFunctions -> amplify/backend/video/videotest1/custom/LambdaFunctions
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda -> amplify/backend/video/videotest1/custom/LambdaFunctions/SetupTriggerLambda
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js -> amplify/backend/video/videotest1/custom/LambdaFunctions/SetupTriggerLambda/index.js

╰─ amplify push
✔ All resources are updated in the cloud

Admin UI Screenshot after restoring custom function:

Screen Shot 2021-04-23 at 9 24 10 AM

Deployed Lambdas list

Screen Shot 2021-04-23 at 9 25 54 AM

Bonus Step 9 - Remove custom trigger function again, deploy with vanilla trigger

╰─ rm -rf amplify/backend/video/videotest1/custom

╰─ amplify push

Admin UI Screenshot after removing custom function (again) - Note the browser console errors

Screen Shot 2021-04-23 at 9 27 35 AM

Deployed Lambdas:

Screen Shot 2021-04-23 at 9 25 54 AM

Step 10 Reset ALL THE THINGS!

╰─ amplify remove video
╰─ amplify push
✔ All resources are updated in the cloud

Admin UI after (API data/models require a redeploy according to Admin UI)

Admin UI --> navigate to "Content" --> Content still says "Redeploy your models"

So...redeploy models

Screen Shot 2021-04-23 at 9 43 34 AM
Screen Shot 2021-04-23 at 9 55 33 AM

Step 11: Add video again (just for fun because it's Friday!)

╰─ amplify add video
? Please select from one of the below mentioned services: Video-On-Demand
? Provide a friendly name for your resource to be used as a label for this category in the project: friendlyname2
? Select a system-provided encoding template, specify an already-created template name:  Default HLS Adaptive Bitrate
? Is this a production enviroment? Yes
? Do you want to protect your content with signed urls? Yes
? Do you want Amplify to create a new GraphQL API to manage your videos? (Beta) Yes
Using testvidoecategory1 to manage API
? Define your permission schema Any authenticated user can upload videos
? Do you want to override your GraphQL schema? No
? Do you want to edit your newly created model? No

The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth


GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
✔ All resources built.

╰─ amplify push ...

⠸ Updating resources in the cloud. This may take a few minutes...
GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
⠴ Updating resources in the cloud. This may take a few minutes...Successfully generated models. Generated models can be found in /Users/armenr/Development/new/boiler-prettier/src
⠋ Generating.../boiler-prettier/src/graphql/mutations.ts: Unknown type "CreateVodAssetInput". Did you mean "CreateTodoInput" or "UpdateTodoInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvodAssetConditionInput". Did you mean "ModelTodoConditionInput" or "ModelTodoFilterInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "createVodAsset" on type "Mutation". Did you mean "createTodo"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "UpdateVodAssetInput". Did you mean "UpdateTodoInput" or "CreateTodoInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvodAssetConditionInput". Did you mean "ModelTodoConditionInput" or "ModelTodoFilterInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "updateVodAsset" on type "Mutation". Did you mean "updateTodo"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "DeleteVodAssetInput". Did you mean "DeleteTodoInput" or "ModelTodoFilterInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvodAssetConditionInput". Did you mean "ModelTodoConditionInput" or "ModelTodoFilterInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "deleteVodAsset" on type "Mutation". Did you mean "deleteTodo"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "CreateVideoObjectInput". Did you mean "CreateTodoInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvideoObjectConditionInput". Did you mean "ModelTodoConditionInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "createVideoObject" on type "Mutation".
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "UpdateVideoObjectInput". Did you mean "UpdateTodoInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvideoObjectConditionInput". Did you mean "ModelTodoConditionInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "updateVideoObject" on type "Mutation".
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "DeleteVideoObjectInput". Did you mean "DeleteTodoInput"?
.../boiler-prettier/src/graphql/mutations.ts: Unknown type "ModelvideoObjectConditionInput". Did you mean "ModelTodoConditionInput"?
.../boiler-prettier/src/graphql/mutations.ts: Cannot query field "deleteVideoObject" on type "Mutation".
.../boiler-prettier/src/graphql/queries.ts: Unknown type "ModelvodAssetFilterInput". Did you mean "ModelTodoFilterInput", "ModelSizeInput", "ModelStringInput", "ModelTodoConditionInput", or "ModelBooleanInput"?
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "syncVodAssets" on type "Query". Did you mean "syncTodos"?
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "getVodAsset" on type "Query".
.../boiler-prettier/src/graphql/queries.ts: Unknown type "ModelvodAssetFilterInput". Did you mean "ModelTodoFilterInput", "ModelSizeInput", "ModelStringInput", "ModelTodoConditionInput", or "ModelBooleanInput"?
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "listVodAssets" on type "Query". Did you mean "listTodos"?
.../boiler-prettier/src/graphql/queries.ts: Unknown type "ModelvideoObjectFilterInput". Did you mean "ModelTodoFilterInput" or "ModelTodoConditionInput"?
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "syncVideoObjects" on type "Query".
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "getVideoObject" on type "Query".
.../boiler-prettier/src/graphql/queries.ts: Unknown type "ModelvideoObjectFilterInput". Did you mean "ModelTodoFilterInput" or "ModelTodoConditionInput"?
.../boiler-prettier/src/graphql/queries.ts: Cannot query field "listVideoObjects" on type "Query".
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onCreateVodAsset" on type "Subscription". Did you mean "onCreateTodo"?
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onUpdateVodAsset" on type "Subscription". Did you mean "onUpdateTodo"?
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onDeleteVodAsset" on type "Subscription". Did you mean "onDeleteTodo"?
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onCreateVideoObject" on type "Subscription". Did you mean "onCreateTodo"?
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onUpdateVideoObject" on type "Subscription". Did you mean "onUpdateTodo"?
.../boiler-prettier/src/graphql/subscriptions.ts: Cannot query field "onDeleteVideoObject" on type "Subscription". Did you mean "onDeleteTodo"?
✖ Validation of GraphQL query document failed
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Successfully generated models in the cloud.
✔ All resources are updated in the cloud

GraphQL endpoint: https://4xhhegu75fejnp4nr4ke5pjbhy.appsync-api.us-east-1.amazonaws.com/graphql



Video on Demand:

Input Storage bucket:
friendlyname2-dev-input-REDACTED

Output URL for content:
https://REDACTED.cloudfront.net


Video on Demand:

Input Storage bucket:
friendlyname2-dev-input-REDACTED

Output URL for content:
https://REDACTED.cloudfront.net

...So, that didn't go well. Let's run some api/gql commands to see what happens next

amplify codegen models && amplify codegen && amplify api gql-compile && amplify push


⠧ Updating resources in the cloud. This may take a few minutes...
GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
⠋ Updating resources in the cloud. This may take a few minutes...Successfully generated models. Generated models can be found in /Users/armenr/Development/new/boiler-prettier/src
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Successfully generated models in the cloud.
✔ All resources are updated in the cloud

Looks good. So, now what?

Admin UI after deploy of non-custom video category friendlyname2

Screen Shot 2021-04-23 at 11 09 01 AM

BUT - When I click on "Content" to quickly add sample data or inspect any data I may have inserted/added:
Screen Shot 2021-04-23 at 11 11 19 AM

And Chrome console shows:
Screen Shot 2021-04-23 at 11 12 02 AM

...So, back to Data we go:
Screen Shot 2021-04-23 at 11 13 09 AM

Deploy finishes:

Screen Shot 2021-04-23 at 11 18 02 AM

Go to "Content" -->

Screen Shot 2021-04-23 at 11 18 42 AM

Step 12 (because I like to be thorough) - Add back Custom Trigger + job template

╰─ cp -rv tools/vod-helpers amplify/backend/video/friendlyname2/custom
tools/vod-helpers -> amplify/backend/video/friendlyname2/custom/vod-helpers
tools/vod-helpers/LambdaFunctions -> amplify/backend/video/friendlyname2/custom/vod-helpers/LambdaFunctions
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda -> amplify/backend/video/friendlyname2/custom/vod-helpers/LambdaFunctions/SetupTriggerLambda
tools/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js -> amplify/backend/video/friendlyname2/custom/vod-helpers/LambdaFunctions/SetupTriggerLambda/index.js
╭─ armenr  ~/Dev/new/boiler-prettier                                                                                                                                                                                                                                                                                                               ✔  10124  11:20:28
├─  staging-armenr/uploads-part2 ● ? ↑1 ⍟2 
╰─ cp tools/mediaconvert-job-temp.json amplify/backend/video/friendlyname2/mediaconvert-job-temp.json

╭─ armenr  ~/Dev/new/boiler-prettier                                                                                                                                                                                                                                                                                                     SIGINT(2) ↵  10126  11:22:48
├─  staging-armenr/uploads-part2 ● ? ↑1 ⍟2 
╰─ amplify push
✔ All resources copied.
✔ Successfully pulled backend environment dev from the cloud.

Current Environment: dev

| Category | Resource name              | Operation | Provider plugin   |
| -------- | -------------------------- | --------- | ----------------- |
| Api      | testvidoecategory1         | Update    | awscloudformation |
| Video    | friendlyname2              | Update    | awscloudformation |
| Auth     | testvidoecategory1bf848835 | No Change | awscloudformation |
? Are you sure you want to continue? Yes

The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth

GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
? Do you want to update code for your updated GraphQL API Yes
? Do you want to generate GraphQL statements (queries, mutations and subscription) based on your schema types?
This will overwrite your current graphql queries, mutations and subscriptions Yes
⠼ Updating resources in the cloud. This may take a few minutes...

UPDATE_IN_PROGRESS amplify-testvidoecategory1-dev-83111 AWS::CloudFormation::Stack Fri Apr 23 2021 11:23:11 GMT-0700 (Pacific Daylight Time) User Initiated
⠼ Updating resources in the cloud. This may take a few minutes...

<Everything seems to be updating/deploying well --> coming back complete>

UPDATE_COMPLETE videofriendlyname2 AWS::CloudFormation::Stack Fri Apr 23 2021 11:28:07 GMT-0700 (Pacific Daylight Time)
⠦ Updating resources in the cloud. This may take a few minutes...

UPDATE_COMPLETE apitestvidoecategory1 AWS::CloudFormation::Stack Fri Apr 23 2021 11:28:42 GMT-0700 (Pacific Daylight Time)
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Generated GraphQL operations successfully and saved at src/graphql
⠸ Updating resources in the cloud. This may take a few minutes...
The following types do not have '@auth' enabled. Consider using @auth with @model
	 - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth

⠇ Updating resources in the cloud. This may take a few minutes...
GraphQL schema compiled successfully.

Edit your schema at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema.graphql or place .graphql files in a directory at /Users/armenr/Development/new/boiler-prettier/amplify/backend/api/testvidoecategory1/schema
⠹ Updating resources in the cloud. This may take a few minutes...Successfully generated models. Generated models can be found in /Users/armenr/Development/new/boiler-prettier/src
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/graphql/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
✔ Code generated successfully and saved in file src/API.ts
⠏ Generating models in the cloud...

<We get stuck here for at least 7 minutes> "Generating models in the cloud..."

Finally looks like it times out/fails:

Failed to create models in the cloud: Modelgen job creation failed
✔ All resources are updated in the cloud

GraphQL endpoint: https://4xhhegu75fejnp4nr4ke5pjbhy.appsync-api.us-east-1.amazonaws.com/graphql

Video on Demand:

Input Storage bucket:
friendlyname2-dev-input-REDACTED

Output URL for content:
https://REDACTED.cloudfront.net


Video on Demand:

Input Storage bucket:
friendlyname2-dev-input-REDACTED

Output URL for content:
https://REDACTED.cloudfront.net

Last step: What does Amplify Admin UI tell us? Same thing as the errors in Step 6 screenshot!

Screen Shot 2021-04-23 at 11 44 19 AM

And at this point, I'm totally bewildered.

Expected behavior

  1. Expect that adding a custom function as per the instructions in wiki & github Issues should work
  2. Expect removing re-adding vanilla setup (without custom trigger) should work
  3. Expect not to break the app, api, or Admin UI

Desktop (please complete the following information):

  • OS: MacOS11 - 11.2.3 (20D91)
  • Browser: Chrome Version 89.0.4389.128 (Official Build) (x86_64)
  • Amlpify CLI - 4.49.0
  • amplify-video: v3.5.0
@armenr
Copy link
Contributor Author

armenr commented Apr 23, 2021

I've also seen the following error:

455.225c1cce.chunk.js:2 [WARN] 12:53.430 DataStore - subscriptionError Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field 'onCreatevodAsset' in type 'Subscription' is undefined @ 'onCreatevodAsset'"}]}

455.225c1cce.chunk.js:2 [WARN] 12:53.431 DataStore - Sync error Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field 'onCreatevodAsset' in type 'Subscription' is undefined @ 'onCreatevodAsset'"}]}

Screen Shot 2021-04-23 at 1 14 22 PM

@armenr
Copy link
Contributor Author

armenr commented Apr 25, 2021

Update:

WHATEVER is causing this, it appears to only happen when enabling Admin UI.

I can make all of the changes I want, without issue, if the Admin UI is NOT enabled for the backend.

I have no idea why/how, since Admin UI console messages and CLI failures (failed to build models in the cloud) don't provide much context and there appear to be multiple open/outstanding issues across the amplify-cli, amplify-admin-ui, and amplify-js GitHub issues section.

Currently ,I have a working/compiling/successfully push-ing backend with the following configuration:

  • Auth + custom required fields (family name, given name, DOB, phone number)
  • API + DataStore enabled w/ conflict resolution + Cognito Auth & optional API Key auth
  • VoD Audio-only "amplify-video" category, with CMS API enabled + custom trigger function + custom CloudFrontTokenGen function

@armenr
Copy link
Contributor Author

armenr commented Apr 26, 2021

So, here's what I've been able to deduce:

If you leave the vodAsset + videoObject models in tact, but remove all other custom resources & evidence/references to the video category (amplify remove video, but leave models in-place), you can get DataStore/Amplify Admin UI (even the "Content"/CMS feature) working (just need to comment out the resolver for the tokenGen lambda function).

When I add the video plugin resources (S3 buckets, Lambdas, CFN Distro, Media job template), that's when I start to see the following in my Chrome console when trying to access the Admin UI.

455.c6270385.chunk.js:2 i18next::translator: key "schemaDesign.inputError.empty" for languages "en-US, en" won't get resolved as namespace "translation" was not yet loaded This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!

455.c6270385.chunk.js:2 POST https://9ardnongjf.execute-api.us-east-1.amazonaws.com/prod/backend/d3h1jwudc0zzp7/details 404

main.3c913cd2.chunk.js:1 UnknownError: undefined - An error occurred while processing your request:  NotFound: null
    at Object.extractError (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:1886130)
    at constructor.extractError (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:2039786)
    at constructor.callListeners (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:2059387)
    at constructor.emit (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:2059097)
    at constructor.emitEvent (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3464729)
    at constructor.e (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3460247)
    at n.runTo (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3466593)
    at https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3466799
    at constructor.<anonymous> (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3460517)
    at constructor.<anonymous> (https://us-east-1.admin.amplifyapp.com/static/js/455.c6270385.chunk.js:2:3464785)

@armenr armenr closed this as completed May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant