question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datastore initialization fails because one model do not sync

See original GitHub issue

Describe the bug This is driving me crazy…

Following the event order from Datastore start as described here: https://docs.amplify.aws/lib/datastore/datastore-events/q/platform/js

For some reason, one of my models (1 of 8) do not sync. This issue only apples on one my three ENVs (same app, different backends). The data in this model (compared to its dev + test counterparts) is slightly bigger, but only 462 rows.

Datastore emits no errors for me to catch.- Setting debug level to WARN shows “Utils - error on” (pic below). Consequently, I never get the “ready” event either.

I assume this relates to DynamoDB throttling, but my database is small (abt 1000 rows in total), however with three M:M relationship tables.

Expected behavior All models should sync, or at least emit an error event (with a good explaining why the error occurred).

Screenshots Setting warn levels to window.LOG_LEVEL = ‘DEBUG’ provides:

utils error (Successful result from model 7 + “silent” Utils error) As seen in the picture, the data from the 462 items have been downloaded from the cloud correctly, so the issue must be with initializing the model locally. (Datastore has correctly added the table in indexeddb, but it is not populating it with the data).

sdkclientexception (A second error appears at the same location. This happen about 3 seconds after the page has reloaded, so the error message regarding 10000 milliseconds cannot be accurate).

hot partition (A few times, I also got this error…)

Environment
System:
    OS: Windows 7 6.1.7601
    CPU: (8) x64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
    Memory: 5.93 GB / 15.98 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.9600.18921
  npmPackages:
    @aws-amplify/api: ^3.1.22 => 3.1.22
    @aws-amplify/auth: ^3.3.4 => 3.3.4
    @aws-amplify/datastore: ^2.2.9 => 2.2.9
    @aws-amplify/pubsub: ^3.0.23 => 3.0.23
    aws-sdk: ^2.736.0 => 2.736.0
    clean-webpack-plugin: ^3.0.0 => 3.0.0
    copy-webpack-plugin: ^5.1.1 => 5.1.1
    css-loader: ^3.5.3 => 3.6.0
    html-webpack-plugin: ^3.2.0 => 3.2.0
    ini: ^1.3.5 => 1.3.5
    inquirer: ^6.5.1 => 6.5.2
    save-dev: 0.0.1-security => 0.0.1-security
    style-loader: ^1.2.1 => 1.2.1
    terser-webpack-plugin: ^4.1.0 => 4.1.0
    webpack: ^4.44.1 => 4.44.1
    webpack-cli: ^3.3.12 => 3.3.12
    webpack-dev-server: ^3.11.0 => 3.11.0
    webpack-merge: ^5.1.1 => 5.1.2
    webpack-pwa-manifest: ^4.1.1 => 4.2.0
    workbox-webpack-plugin: ^5.1.3 => 5.1.3
  npmGlobalPackages:
    @aws-amplify/api: 3.1.10
    @aws-amplify/auth: 3.2.7
    @aws-amplify/cli: 4.27.0
    @aws-amplify/core: 2.2.4
    @aws-amplify/datastore: 1.0.7
    @aws-amplify/pubsub: 3.0.11
    http-server: 0.12.1
    npm: 6.14.8
    webpack-cli: 3.3.11
    webpack-dev-server: 3.10.3
    webpack: 4.41.6

Additional context Schema:

type BatchFile @model(queries:null) @auth(rules: [ {allow: owner}, {allow: groups, groups: [“admin”] }, {allow: groups, groups: [“users”] }, {allow: private, provider: iam } ]) @key(name: “filesByBatch”, fields: [“batchId”, “fileId”]) @key(name: “batchesByFile”, fields: [“fileId”, “batchId”]) { id: ID! batchId: ID! fileId: ID! batch: CADBatch @connection(fields: [“batchId”]) file: CADFile @connection(fields: [“fileId”]) }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
meducaticommented, Oct 11, 2020

Ivan, my best friend in the world right now! I think we have solved it!!! 😃

Updated models: `type CADBatch @model @auth(rules: [ {allow: owner}, {allow: groups, groups: [“admin”] }, {allow: groups, groups: [“users”], operations: [read] } ]) { id: ID! status: BatchStatus!
name: String! createdAt: AWSDateTime batchType: BatchType! schemaType: SchemaType schemaSettings: SchemaSettings schemaObjects: [SchemaObject] users:[UserBatch] @connection(keyName: “byBatch”, fields: [“id”]) #files: [BatchFile] @connection(keyName: “filesByBatch”, fields: [“id”]) }

type BatchFile @model(queries:null) @auth(rules: [ {allow: owner}, {allow: groups, groups: [“admin”] }, {allow: groups, groups: [“users”] }, {allow: private, provider: iam } ]) @key(name: “filesByBatch”, fields: [“batchId”, “fileId”]) @key(name: “batchesByFile”, fields: [“fileId”, “batchId”]) { id: ID! batchId: ID! fileId: ID! #batch: CADBatch @connection(fields: [“batchId”]) file: CADFile @connection(fields: [“fileId”]) } `

As you see, I broke the relationship between CADBatch and BatchFile.

  • Amplify api push
  • Amplify codegen models (I no longer got an error from having both auth -> userGroups and IAM in the models which is great. No need to edit schema.js anymore)

App now populates all 8 models locally and Datastore fires “ready” upon start.

I do recall that I, a long time ago, increased the “depth” somewhere. Was this in Amplify configure? (This is the only time I ever touched this setting). If you say this is not related to datastore, then it is so. Where can I check the nesting depth?

I will do some additional tests and get back to you on what I would have liked. (Documentation, error messages etc) that would have steered me away from this issue in the first place. (In theory, I still think the way I put up my schema would have been valid since there is not really any “relations” left once you get the data into indexeddb…

I´ll message you on Discord for the error log!

1reaction
amhinsoncommented, Oct 9, 2020

Would you be able to reach out to me (amhinson) on our Discord server? It’d be helpful to see more of your app code to debug a bit more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warnings and Errors - Oracle Help Center
Error number Error or warning message Details 403 Attempt to read from checkpoint truncated 412 Bad file‑open mode Internal error. Contact TimesTen C... 413 Bad file‑exists...
Read more >
Common Questions - Normcore.io
Normcore will not synchronize parent relationships between objects. And if the new parent gets destroyed, it will take the RealtimeView and its components ......
Read more >
Cisco HyperFlex Systems Troubleshooting Reference Guide, 4.0
If, during an upgrade, two nodes fail, the upgrade fails because controller VMs do not power on. Action: Restart EAM Service. Procedure. Step...
Read more >
Connect Amplify DataStore with existing SQL datasources
I introduce two new Delta Sync tables, one for each of our model tables. A Delta Sync table tracks changes to a versioned...
Read more >
Fix list for IBM WebSphere Application Server V8.5
PH30827, Session active for over 1 hour is not invalidated ... PH21008, OIDC RP: The TAI is completely disabled if any provider config...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found