Open chirpavel opened 2 months ago
Now I tried to:
I cant use Amplify Data Manager, white blank page with errors in console
Help me please ASAP
After many attempts to get into the Data manager, I was able to. It opened without tables, I created a single one for testing and clicked Deploy. An error was displayed during deployment
Step 1: Deployment failed
Close
GraphQL API SplitPay already exists in the project","resolution":"Use amplify update api to make modifications","link":"https://docs.amplify.aws/cli/project/troubleshooting/"}
I tried update api in cli, but the same error:
**amplify update api**
? Select from one of the below mentioned services: GraphQL
General information
- Name: SplitPay
- API endpoint: https://qoju2h4htrh3xitgusj476izcy.appsync-api.eu-central-1.amazonaws.com/graphql
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
? Select a setting to edit Authorization modes
? Choose the default authorization type for the API Amazon Cognito User Pool
Use a Cognito user pool configured as a part of this project.
? Configure additional auth types? Yes
? Choose the additional authorization types you want to configure for the API API key, IAM
API key configuration
√ Enter a description for the API key: · No desc
√ After how many days from now the API key should expire (1-365): · 5
🛑 Syntax Error: Expected ":", found "@".
amplify pull shows this error several times:
amplify pull --appId d2bXXXX --envName staging
Pre-pull status:
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ ChangeSubscriptionPlanLambda │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ CognitoSignupTriggerLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ RMSIikoGetMenuLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
⚠️ Local changes detected.
⚠️ Pulling changes from the cloud will override your local changes.
? Are you sure you would like to continue? Yes
√ Successfully pulled backend environment staging from the cloud.
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
✅
GraphQLError: Syntax Error: Expected ":", found "@".
× Failed to sync the following components: MenuItemCreateForm, UserProfileUpdateForm, MenuItemSizeUpdateForm, MenuItemSizeCreateForm, BranchPublicInfoUpdateForm, MenuGroupUpdateForm, MenuGroupCreateForm, BranchOperatingHoursUpdateForm, MenuItemUpdateForm
GraphQLError: Syntax Error: Expected ":", found "@".
🛑 Syntax Error: Expected ":", found "@".
Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 6e0a7efe-dd6c-4c5a-92c2-2a7ab3433804
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721513470733.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
At this step AWS sends model with mistake (after decoding):
type SubscriptionPlan @model
@auth(
rules: [
{allow: private, provider: iam, operations: [read, create, update]},
{allow: groups, groups: ["eu-central-admins"], operations: [read, create, update, delete]}
]
) {
id: ID!
branchId: ID!
prevSubscriptionPlan: String
subscriptionPlan: String
price: Float
paidAmount: Float
isFake: Boolean
duration: Int
convertedDays: Int
extraDays: Int
expiryDate: AWSDateTime
detailsSnapshot: String
autoRenewal: Boolean
owner: String
type: String!
String @default(value: "SP")
@index(
name: "subscriptionPlansByDate"
queryField: "subscriptionPlansByDate"
sortKeyFields: ["createdAt"]
)
createdAt: String!
}
Mistake is here:
**String @default(value: "SP")**
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance.
But to mitigate the issue you will need to download the current-cloud-backend.zip
from the Amplify S3 deployment bucket, update the schema and carefully re-upload zip.
Then running the pull locally should build the schema.
Hey @chirpavel, Thanks for raising this. After reviewing your field that you are trying to the model seems to be not valid GraphQL format. Can you please update the field to like below and let us know if it resovles your issue.
type: String! @default(value: "SP")
@index(
name: "subscriptionPlansByDate"
queryField: "subscriptionPlansByDate"
sortKeyFields: ["createdAt"]
)
Thank you very much for your answers!!!
Yes, I know there was a typo in the model. Following the advice, I downloaded the #current-cloud-backend.zip archive from the deployment bucket. Changed the model to the correct one:
type SubscriptionPlan @model
@auth(
rules: [
{allow: private, provider: iam, operations: [read, create, update]},
{allow: groups, groups: ["eu-central-admins"], operations: [read, create, update, delete]}
]
) {
id: ID!
name: String
branchId: ID!
prevSubscriptionPlan: String
subscriptionPlan: String
price: Float
paidAmount: Float
isFake: Boolean
duration: Int
convertedDays: Int
extraDays: Int
expiryDate: AWSDateTime
detailsSnapshot: String
autoRenewal: Boolean
owner: String
}
I deleted all the bad fields at the end and packed it back into the file. Without deleting the file, I uploaded it under the same name (I enabled versioning first, just in case)
After that, the Syntax Error: Expected ":", found "@" error disappeared! But not everything is so good.
To make changes to the API, I added the "name" field and run amplify push:
\ Fetching updates to backend environment: staging from the cloud.⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Fetching updates to backend environment: staging from the cloud.✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Successfully pulled backend environment staging from the cloud.
\ Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
- Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ ChangeSubscriptionPlanLambda │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ CognitoSignupTriggerLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ RMSIikoGetMenuLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
√ Are you sure you want to continue? (Y/n) · yes
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
| Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\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
Deployment completed.
Deploying api SplitPay [ =======--------------------------------- ] 4/24
GraphQLAPITransformerSchema3C… AWS::AppSync::GraphQLSchema UPDATE_IN_PROGRESS Fri Jul 26 2024 12:23:43…
AuthRolePolicy02A05DD8DC AWS::IAM::ManagedPolicy UPDATE_IN_PROGRESS Fri Jul 26 2024 12:23:43…
AuthRolePolicy01921FC820 AWS::IAM::ManagedPolicy UPDATE_IN_PROGRESS Fri Jul 26 2024 12:23:43…
GraphQLAPIDefaultApiKey215A6D… AWS::AppSync::ApiKey UPDATE_IN_PROGRESS Fri Jul 26 2024 12:23:43…
Rolled back (2 of 2)
🛑 ["Index: 1 State: {\"deploy\":\"waitingForDeployment\"} Message: Resource is not in the state stackUpdateComplete","Index: 0 State: {\"rollback\":\"rollingBack\"} Message: Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated."]
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 558f4ebc-ee61-4332-a94e-90abed980eb0
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721967974818.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
Sending report:
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify diagnose --send-report
Learn more at https://docs.amplify.aws/cli/reference/diagnose/
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721968044142.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
After these actions, the page https://eu-central-1.admin.amplifyapp.com/admin/ХХХ/staging/datastore with the data model began to open
I decided to delete the SubscriptionPlan model completely. I checked before Deploying that the model disappeared in the "GraphQL schema" mode. But the deployment quickly ended with an error:
Step 1: Deployment failed
Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233/a3ae6d40-d0cb-11ee-a2e7-020aa4f89a6d is in UPDATE_ROLLBACK_FAILED state and cannot be updated
If I try not to delete, but to add 1 string field "name" in the web console, the deployment ends with such an error:
Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated
Attempts to delete the model locally and execute "amplify push" finished like this (without success):
amplify push -y --allow-destructive-graphql-schema-updates
- Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Successfully pulled backend environment staging from the cloud.
/ Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHouurs: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ ChangeSubscriptionPlanLambda │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ CognitoSignupTriggerLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ RMSIikoGetMenuLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [[owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
/ Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHouurs: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
\ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Deploying resources into staging environment. This will take a few minutes. ⠋
Deploying root stack SplitPay [ ---------------------------------------- ] 0/7
Deploying api SplitPay [ ---------------------------------------- ] 0/23
Deploying function CognitoSignupTriggerLambda [ ---------------------------------------- ] 0/4
Deploying resources into staging environment. This will take a few minutes. ⠙
Deploying root stack SplitPay [ ---------------------------------------- ] 0/7
Deploying api Deploying resources into staging environment. This will take a few minutes. ⠹
Deploying root stack SplitPay [ ---------------------------------------- ] 0/7
Deploying api SplitPay [ ---------------------------------------- ] 0/23
Deploying funDeploying resources into staging environment. This will take a few minutes. ⠼
Deploying root stack SplitPay [ ---------------------------------------- ] 0/7
Deploying api SplitPay [ ---------------------------------------- ] 0/23
Deploying function CognitoSignupTriggerLambda [ ---------------------------------------- ] 0/4
Deploying function RMSIikoGetMenuLambda [ ---------------------------------------- ] 0/4
Deploying function ChangeSubscriptionPlanLambda [ ---------------------------------------- ] 0/4
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
amplify pull finished without error:
amplify pull
⚠️ Local changes detected.
⚠️ Pulling changes from the cloud will override your local changes.
? Are you sure you would like to continue? Yes
- Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Successfully pulled backend environment staging from the cloud.
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
✅
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Synced UI components.
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [ownner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Successfully generated models. Generated models can be found in C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\src\models
Post-pull status:
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ CognitoSignupTriggerLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ RMSIikoGetMenuLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ ChangeSubscriptionPlanLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Synced UI components.
After the amplify pull command, I added one more "name" field to the SubscriptionPlan model and ran the amplify push command, it finished with error:
amplify push -y
/ Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
\ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Successfully pulled backend environment staging from the cloud.
- Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ CognitoSignupTriggerLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ RMSIikoGetMenuLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Function │ ChangeSubscriptionPlanLambda │ No Change │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [ownner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
/ Building resource api/SplitPay⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
- Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Deployment completed.
Rolled back (2 of 1)
🛑 ["Index: 0 State: {\"deploy\":\"deploying\"} Message: Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated."]
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 1b4cc10f-fc3f-4d5c-990c-578bc81d4e2c
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721971681919.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify diagnose --send-report
Learn more at https://docs.amplify.aws/cli/reference/diagnose/
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721971734190.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
The problem appears after the inscription "file uploading" (or something like that). And at the same time I noticed that the version of the file #current-cloud-backend.zip in the deployment bucket does not change. Maybe after I updated the file - I became its owner and the system does not have enough rights to change mine to the new one?
For additional information, amplify api gql-compile --allow-destructive-graphql-schema-updates works correctly:
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): BranchOperatingHours: [owner], BranchPublicInfo: [owner], UserProfile: [owner], MenuItemModifier: [owner], MenuItemSize: [owner], MenuItem: [owner], MenuGroup: [owner], Branch: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access.
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Before uploading the file, I decided to rename the file from #current-cloud-backend.zip to #current-cloud-backend-backup .zip at the moment indicated by the red arrow
But the file did not appear in the bucket, an error was displayed
Rolled back (2 of 1)
🛑 ["Index: 0 State: {\"deploy\":\"deploying\"} Message: Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated."]
At the same time, it is clear that some other files have changed their version many times
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
The task was closed by mistake when deleting a duplicate comment. The task is very relevant!
Deployment activity in Amplify Studio:
I tried to amplify push without #current-cloud-backend.zip (renamed to #current-cloud-backend-backup.zip):
amplify push
× There was an error pulling the backend environment staging.
🛑 The specified key does not exist.
Then I renamed to #current-cloud-backend-backup.zip to the original name: #current-cloud-backend.zip and changed the Object Ownership rules (original is yellow)
and added permissions for S3 log delivery group
But when I run amplify push, the error after "Uploading files..." is the same:
Rolled back (2 of 1)
🛑 ["Index: 0 State: {\"deploy\":\"deploying\"} Message: Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated."]
In the bucket there is deployment-state.json, it contains:
{
"version": "1",
"startedAt": "2024-07-26T06:50:22.449Z",
"finishedAt": "2024-07-26T06:50:27.142Z",
"status": "FAILED",
"currentStepIndex": 0,
"steps": [
{
"status": "ROLLING_BACK",
"previousMetaKey": "amplify-appsync-files/1d69b42f50e3cfe5208ebbf987083edb0b3bf116/states/initial-stack/deployment-meta.json"
},
{
"status": "WAITING_FOR_DEPLOYMENT"
}
]
}
amplify-appsync-files/1d69b42f50e3cfe5208ebbf987083edb0b3bf116/states/initial-stack/deployment-meta.json in bucket contains:
{
"stackTemplatePathOrUrl": "amplify-appsync-files/1d69b42f50e3cfe5208ebbf987083edb0b3bf116/states/initial-stack/cloudformation-template.json",
"previousMetaKey": "amplify-appsync-files/1d69b42f50e3cfe5208ebbf987083edb0b3bf116/states/initial-stack/deployment-meta.json",
"parameters": {
"DynamoDBModelTableReadIOPS": "5",
"authRoleName": "amplify-splitpay-staging-XXXXXX-authRole",
"DynamoDBEnableServerSideEncryption": "false",
"unauthRoleName": "amplify-splitpay-staging-XXXXXX-unauthRole",
"DynamoDBEnablePointInTimeRecovery": "false",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"S3DeploymentBucket": "amplify-splitpay-staging-XXXXXX-deployment",
"DynamoDBModelTableWriteIOPS": "5",
"env": "staging",
"S3DeploymentRootKey": "amplify-appsync-files/1d69b42f50e3cfe5208ebbf987083edb0b3bf116/states/initial-stack",
"AppSyncApiName": "SplitPay",
"AuthCognitoUserPoolId": "eu-central-1_XXXXXXXXXX"
},
"stackName": "arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-XXXXXX-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17",
"capabilities": [
"CAPABILITY_NAMED_IAM",
"CAPABILITY_AUTO_EXPAND"
],
"tableNames": []
}
Maybe new ideas?
Hey @chirpavel, Could you try rolling back the changes you made to the #current-cloud-backend.zip folder, run amplify push
, and let me know the results?
Hey @chirpavel, Could you try rolling back the changes you made to the #current-cloud-backend.zip folder, run
amplify push
, and let me know the results?
Hi What do you mean roll back? Upload the file #current-cloud-backend.zip with a broken scheme? It won't work.
And I didn't find how to roll back the version of #current-cloud-backend.zip in S3. You can only download the old version and upload it again as a new file. I didn't find a direct rollback to the previous version. In any case, rolling back a version with a broken scheme does not work.
The internal support team says that they has identified the root cause of the issue with the CloudFormation stack and the failed update of the 'SyncSubscriptionPlanResolver' resource. The error message indicates that the resolver is not found, which is causing the update to fail.
To resolve this issue, please follow these steps:
If the 'SyncSubscriptionPlanResolver' file does not exist in the resolvers directory, it means that the resolver is missing, and that's why the update is failing. You can create the missing resolver file manually or regenerate the resolver using the Amplify CLI.
To regenerate the resolver using the Amplify CLI, you can run the following command:
amplify update api
Follow the prompts to update the API and generate the missing resolver. Once the resolver is created, you can try updating the CloudFormation stack again to resolve the 'UPDATE_ROLLBACK_FAILED' status.
After creating or regenerating the resolver, you should be able to update the stack successfully without encountering the 'SyncSubscriptionPlanResolver' error.
I don't have rewritten resolvers, the amplify\backend\api\SplitPay\resolvers folder is empty (only README.md).
I successfully executed the amplify update api command, here is its log:
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify update api
? Select from one of the below mentioned services: GraphQL
General information
- Name: SplitPay
- API endpoint: https://qoju2h4htrh3xitgusj476izcy.appsync-api.eu-central-1.amazonaws.com/graphql
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
- Name: SplitPay
- API endpoint: https://qoju2h4htrh3xitgusj476izcy.appsync-api.eu-central-1.amazonaws.com/graphql
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
- API endpoint: https://qoju2h4htrh3xitgusj476izcy.appsync-api.eu-central-1.amazonaws.com/graphql
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
- IAM
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge
? Select a setting to edit Authorization modes
? Select a setting to edit Authorization modes
? Select a setting to edit Authorization modes
? Choose the default authorization type for the API Amazon Cognito User Pool
? Configure additional auth types? Yes
? Choose the additional authorization types you want to configure for the API API key, IAM
API key configuration
√ Enter a description for the API key: · some api desc
√ After how many days from now the API key should expire (1-365): · 30
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
✅ Successfully updated resource
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify codegen
√ Generated GraphQL operations successfully and saved at src\graphql
The "amplify push" was executed with exactly the same error as before:
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify push -y
| Fetching updates to backend environment: staging from the cloud.✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
√ Successfully pulled backend environment staging from the cloud.
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Current Environment: staging
┌──────────┬──────────────────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Api │ SplitPay │ Update │ awscloudformation │
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Auth │ SplitPay │ No Change │ awscloudformation │
...
├──────────┼──────────────────────────────┼───────────┼───────────────────┤
│ Storage │ s3splitpaystoragestaging │ No Change │ awscloudformation │
└──────────┴──────────────────────────────┴───────────┴───────────────────┘
✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
/ Building resource api/SplitPay✅ GraphQL schema compiled successfully.
Edit your schema at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema.graphql or place .graphql files in a directory at C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay\amplify\backend\api\SplitPay\schema
Deployment completed.
Rolled back (2 of 1)
🛑 ["Index: 0 State: {\"deploy\":\"deploying\"} Message: Stack:arn:aws:cloudformation:eu-central-1:675795832684:stack/amplify-splitpay-staging-151233-apiSplitPay-16AD5QGQ6UTRM/158a35d0-d314-11ee-9cef-064928585b17 is in UPDATE_ROLLBACK_FAILED state and can not be updated."]
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 2ad6a834-3f18-458c-bb25-4cf1525ef07d
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1722440294654.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
I sent a report:
PS C:\Users\chirp\Downloads\SplitPay\SplitPayReact\splitpay> amplify diagnose --send-report
Learn more at https://docs.amplify.aws/cli/reference/diagnose/
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1722440359395.zip
√ Done
Project Identifier: 70952c35bc147986b145b568d0636b2e
Maybe the missing resolver needs to be added on the AppSync side? Or something needs to be created in the file: s3://amplify-splitpay-staging-151233-deployment/#current-cloud-backend.zip
The advice here in the github to change the content of schema.graphql in this file helped me. We have moved one step forward. Maybe I should change something else?
I can delete this SubscriptionPlan model and all its associated resolvers in AppSync. But how?
@chirpavel , Are you available for a screen share tomorrow?
@AnilMaktala yes, sure!
For now I have some screenshots around yesterday message: No overwritten resolvers:
The problem appears after this step:
And "amplify push" error, rolled back:
Hey @chirpavel, Are you on Discord? If so, could you please share your Discord username with me?
Hey @chirpavel, are you still experiencing this issue?
Hey @chirpavel, are you still experiencing this issue?
Yeeess, the problem is still actual
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.12.2
Amplify CLI Version
12.12.4
What operating system are you using?
Windows
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
I added this model:
to the end of SubscriptionPlan model and execute amplify push - nothing work: amplify push and amplify pull return error: Syntax Error: Expected ":", found "@"
After error i tried amplify push --force and --no-gql-override flag Nothing helps
Expected behavior
Sorting by date like in the doc: https://docs.amplify.aws/gen1/javascript/build-a-backend/graphqlapi/best-practice/query-with-sorting/
Reproduction steps
Add this model:
amplify push
Change the model
amplify push
Project Identifier
Project Identifier: 70952c35bc147986b145b568d0636b2e
Log output
Additional information
Data manager doesnt work at all!
Before submitting, please confirm: