Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

Error: Sync error: HttpError: 403

Open ericdudley opened this issue 11 months ago • 3 comments

I'm stuck trying to fix authentication with a stale client. I've attempted to mitigate this by calling db.cloud.login() as well as db.cloud.sync(); however, both result in the same logs seen below. The same logs also appear on page refresh / load.

I am able to successfully start a new session in an incognito tab; however, in an existing browser instance I never am asked to re-auth and am instead stuck with this sync state: {phase: 'offline', status: 'offline', license: 'expired'}.

Likewise, after a fresh logout -> login, I immediately start to get expired license logs.

Sync state: {phase: 'initial', error: undefined, progress: undefined, status: 'not-started', license: 'ok'}
index.CZhEZDov.js:9 Sync state: {phase: 'offline', status: 'offline', license: 'expired'}

Any ideas on what could help mitigate?

index.CZhEZDov.js:9  Uncaught (in promise) Error: Sync error: HttpError: 403 
    at Object.<anonymous> (index.CZhEZDov.js:9:38328)
    at Generator.next (<anonymous>)
    at a (index.CZhEZDov.js:3:21792)
    at import-wrapper-prod.CES7U1kg.js:3:9342
    at Tr (import-wrapper-prod.CES7U1kg.js:3:4447)
    at Ne (import-wrapper-prod.CES7U1kg.js:3:4844)
    at import-wrapper-prod.CES7U1kg.js:3:5203
    at w.onsuccess (import-wrapper-prod.CES7U1kg.js:3:41284)
(anonymous) @ index.CZhEZDov.js:9
a @ index.CZhEZDov.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
Tr @ import-wrapper-prod.CES7U1kg.js:3
Ne @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
w.onsuccess @ import-wrapper-prod.CES7U1kg.js:3
IndexedDB
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
t @ import-wrapper-prod.CES7U1kg.js:3
K @ import-wrapper-prod.CES7U1kg.js:3
get @ import-wrapper-prod.CES7U1kg.js:3
p.<computed> @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
a @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
Ke @ import-wrapper-prod.CES7U1kg.js:3
ve @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
t @ import-wrapper-prod.CES7U1kg.js:3
K @ import-wrapper-prod.CES7U1kg.js:3
ue._promise @ import-wrapper-prod.CES7U1kg.js:3
c @ import-wrapper-prod.CES7U1kg.js:3
M._trans @ import-wrapper-prod.CES7U1kg.js:3
M.get @ import-wrapper-prod.CES7U1kg.js:3
getPersistedSyncState @ index.CZhEZDov.js:8
(anonymous) @ index.CZhEZDov.js:9
a @ index.CZhEZDov.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
Tr @ import-wrapper-prod.CES7U1kg.js:3
Ne @ import-wrapper-prod.CES7U1kg.js:3
(anonymous) @ import-wrapper-prod.CES7U1kg.js:3
index.CZhEZDov.js:9 Sync state: {phase: 'offline', status: 'offline', license: 'expired'}

ericdudley avatar Jan 07 '25 20:01 ericdudley

It sounds as if the evaluation period of the user you are logging in as is expired. Login to https://manager.dexie.cloud and find the user you are logging in to. See if it has the orange eval pill along with an upgrade link. Click the upgrade link and the user will get a production license.

image

The free version allows upgrading up to 3 users to production. You can also purchase a subscription and give production access to upgrading more users.

NOTE: Expired users can always login and pull down all data but it will fail to sync if they change and try to upload any data. Your application can advertise to your users when their evaluation is about to expire or has expired to contact you to get a production license. An example of that can be found in this code snippet

dfahlander avatar Jan 07 '25 22:01 dfahlander

Thanks @dfahlander that was the issue! Thanks for the code reference.

Some thoughts:

  1. Is there a place in the documentation for this? If not, perhaps it could live on the authentication or access control pages?
  2. I'm a bit embarrassed to admit that I didn't know https://manager.dexie.cloud/ existed. I looked for a web admin site, but I could never find any reference to one. It might've been useful if the CLI outputted links to the manager app?

ericdudley avatar Jan 08 '25 02:01 ericdudley

Thanks for this feedback! I'll make sure the docs get updated.

dfahlander avatar Jan 08 '25 06:01 dfahlander