Closed armenr closed 3 years ago
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'"}]}
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:
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)
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
Step 2 - Add Auth
Step 3 - Add API
Step 4 - Add Video
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
Step 6: Push & Check Amplify Admin UI
^^ Looks good, so far, right? :)
Admin UI Screenshot (yes, I did click on "dev" from the drop-down)
Step 7 (unbreak my heart...and the Admin UI)
Admin UI Screenshot after custom function removal:
Bonus: Step 8 (what happens if we re-deploy a custom function again, just for the sake of curiosity)?
Admin UI Screenshot after restoring custom function:
Deployed Lambdas list
Bonus Step 9 - Remove custom trigger function again, deploy with vanilla trigger
Admin UI Screenshot after removing custom function (again) - Note the browser console errors
Deployed Lambdas:
Step 10 Reset ALL THE THINGS!
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
Step 11: Add video again (just for fun because it's Friday!)
...So, that didn't go well. Let's run some api/gql commands to see what happens next
Looks good. So, now what?
Admin UI after deploy of non-custom video category
friendlyname2
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](https://user-images.githubusercontent.com/7662191/115912791-a2ada900-a424-11eb-8c7a-6e2de4d4994e.png)
And Chrome console shows:![Screen Shot 2021-04-23 at 11 12 02 AM](https://user-images.githubusercontent.com/7662191/115912965-d8eb2880-a424-11eb-8a2a-62c9ead934cb.png)
...So, back to Data we go:![Screen Shot 2021-04-23 at 11 13 09 AM](https://user-images.githubusercontent.com/7662191/115913001-e4d6ea80-a424-11eb-9d53-b853d14b3d3a.png)
Deploy finishes:
Go to "Content" -->
Step 12 (because I like to be thorough) - Add back Custom Trigger + job template
<Everything seems to be updating/deploying well --> coming back complete>
<We get stuck here for at least 7 minutes> "Generating models in the cloud..."
Finally looks like it times out/fails:
Last step: What does Amplify Admin UI tell us? Same thing as the errors in Step 6 screenshot!
And at this point, I'm totally bewildered.
Expected behavior
Desktop (please complete the following information):