amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Blocked error! Syntax Error: Expected ":", found "@" when executing amplify push and amplify pull, also admin.amplifyapp.com/admin/.. data-manager doesnt work

Open chirpavel opened this issue 7 months ago • 23 comments

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:

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!
}

This part to sort by createdAt:
type: String!
    String @default(value: "SP")
    @index(
      name: "subscriptionPlansByDate"
      queryField: "subscriptionPlansByDate"
      sortKeyFields: ["createdAt"]
    )
  createdAt: String!

### Describe the bug

When I added this part:
type: String!
    String @default(value: "SP")
    @index(
      name: "subscriptionPlansByDate"
      queryField: "subscriptionPlansByDate"
      sortKeyFields: ["createdAt"]
    )
  createdAt: String!

to the end of SubscriptionPlan model and execute amplify push - nothing work: amplify push and amplify pull return error: Syntax Error: Expected ":", found "@"

The same error in the browser: https://eu-central-1.admin.amplifyapp.com/admin/d2bvp8o95pga13/staging/data-manager
GraphQLError: Syntax Error: Expected ":", found "@".
The error may be correlated with this previous error:
GraphQLError: Syntax Error: Expected ":", found "@".
    at Sa (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:161300)
    at t.expectToken (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:189570)
    at t.parseFieldDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:183142)
    at t.optionalMany (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:190428)
    at t.parseFieldsDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:182944)
    at t.parseObjectTypeDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:182172)
    at t.parseTypeSystemDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:180669)
    at t.parseDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:174398)
    at t.many (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:190559)
    at t.parseDocument (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:174002)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:195496
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1185836
    at f (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1184785)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1185969
    at f (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1184785)
    at Object.current (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:309635)
    at Object.e [as onStateChange] (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1188845)
    at Object.i [as callback] (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180074)
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1179674
    at ll (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:206125)
    at Object.notify (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1179643)
    at Object.notifyNestedSubs (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180240)
    at Object._ [as onStateChange] (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1181633)
    at Object.i [as callback] (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180074)
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1179674
    at ll (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:206125)
    at Object.notify (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1179643)
    at Object.notifyNestedSubs (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180240)
    at i (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180074)
    at E (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:276448)
    at https://eu-central-1.admin.amplifyapp.com/static/js/44.824f95d4.chunk.js:3:460334
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:102575
    at dispatch (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:278216)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1307011
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1299533
    at Object.next (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1299638)
    at a (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1300278)


    at Sa (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:161300)
    at t.expectToken (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:189570)
    at t.parseFieldDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:183142)
    at t.optionalMany (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:190428)
    at t.parseFieldsDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:182944)
    at t.parseObjectTypeDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:182172)
    at t.parseTypeSystemDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:180669)
    at t.parseDefinition (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:174398)
    at t.many (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:190559)
    at t.parseDocument (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:174002)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:195496
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1185836
    at f (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1184785)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1185969
    at f (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1184785)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:309635
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1188491
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1189025
    at Eg (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:308847)
    at Xa (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:170059)
    at Go (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:178951)
    at vs (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:217401)
    at El (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:208925)
    at fl (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:208850)
    at sl (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:205859)
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:157337
    at t.unstable_runWithPriority (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:232575)
    at ji (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:157046)
    at $i (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:157282)
    at Qi (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:157217)
    at ll (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:206150)
    at Object.notify (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1179643)
    at Object.notifyNestedSubs (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180240)
    at i (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:1180074)
    at E (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:276448)
    at https://eu-central-1.admin.amplifyapp.com/static/js/44.824f95d4.chunk.js:3:460334
    at https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:102575
    at dispatch (https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js:4:278216)
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1307011
    at https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1299533
    at Object.next (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1299638)
    at a (https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js:4:1300278)
    
44.824f95d4.chunk.js:3 
 GET https://eu-central-1.admin.amplifyapp.com/static/js/44.824f95d4.chunk.js.map 404 (Not Found)
44.824f95d4.chunk.js:3 
 GET https://eu-central-1.admin.amplifyapp.com/static/js/38.948fc0bf.chunk.js.map 404 (Not Found)
44.824f95d4.chunk.js:3 
 GET https://eu-central-1.admin.amplifyapp.com/static/js/37.76c182c0.chunk.js.map 404 (Not Found)
44.824f95d4.chunk.js:3 
 POST https://o4505399133929472.ingest.sentry.io/api/4505399136092160/envelope/?s…bae4b0ae2f&sentry_version=7&sentry_client=sentry.javascript.react%2F7.57.0 429 (Too Many Requests)
 
 
 Session Identifier: 961eee15-0da6-458b-a4f2-2fb37d52f7ac
 Session Identifier: 9c55993b-53d7-49d7-89ca-c1cd94796a01
 Session Identifier: fb8e6830-83a8-4dec-808b-057654562da7
 Session Identifier: f17812a0-b421-4cec-be01-be2850c0a6a3
 
amplify diagnose --send-report
✅ Report saved: C:\Users\chirp\AppData\Local\Temp\SplitPay\report-1721509444518.zip
√ Done

Project Identifier: 70952c35bc147986b145b568d0636b2e

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

  1. Add this model:
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!
}
  1. amplify push

  2. Change the model

  3. amplify push

Project Identifier

Project Identifier: 70952c35bc147986b145b568d0636b2e

Log output

# Put your logs below this line


Additional information

data-manager-screenshot 2024-07-21 050628

Data manager doesnt work at all!

Before submitting, please confirm:

  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

chirpavel avatar Jul 20 '24 21:07 chirpavel