stylus icon indicating copy to clipboard operation
stylus copied to clipboard

Sync Issues with 403 error in Google Drive

Open thetroublemaker opened this issue 1 year ago • 28 comments

Behavior:

  1. Shows a red X, bottom left of the bookmark icon in Chrome.
  2. Message in context menu:

failed to fetch [403]: { "error": { "code": 403, "message": "This revision cannot be downloaded by the authenticated user.", "errors": [ { "message": "This revision cannot be downloaded by the authenticated user.", "domain": "global", "reason": "forbidden" } ] } }

Resolution attempts:

  1. Refresh
  2. Clear Cache
  3. Log out and log in
  4. Sync off Sync on

Using:

  1. Latest Chrome on Windows 11

thetroublemaker avatar Aug 30 '25 14:08 thetroublemaker

@eight04, any ideas?

tophf avatar Aug 30 '25 16:08 tophf

Same issue on Firefox 142, Fedora Linux 42.

gegentan avatar Aug 30 '25 18:08 gegentan

  1. Which service do you use?
  2. Stylus version?
  3. How did you trigger the error e.g. after logging in? after pressing the "Sync now" button?

eight04 avatar Aug 30 '25 22:08 eight04

@tophf BTW is there a way to tell whether the user is using MV2 or MV3?

eight04 avatar Aug 30 '25 22:08 eight04

What do you mean by service?

There is no mention of a version in any portion of the plug-in interface.

No trigger besides just starting to browse my Chrome, like I do daily. I attempted to re-sync after I noticed the issue, as a remedy, but that did not fix it.

thetroublemaker avatar Aug 30 '25 22:08 thetroublemaker

I have the same problem. Using Vivaldi 7.5.3735.66 (Stable channel) (64 bits), Stylus 2.3.16.

rapierx avatar Aug 30 '25 23:08 rapierx

What do you mean by service?

Did you sync to Google Drive, One Drive, etc? Also try opening the option panel of the extension and take a screenshot.

There is no mention of a version in any portion of the plug-in interface.

In Chrome, you can view the information of extensions by visiting this address: chrome://extensions.

eight04 avatar Aug 31 '25 00:08 eight04

Version: 2.3.16 Yep, Google Drive, although I don't see any file named stylus as a backup; assuming a hidden folder in Drive. Just turned off the extension and turned back on; seems to be back to working.

thetroublemaker avatar Aug 31 '25 00:08 thetroublemaker

Also using Google Drive and 2.3.16, receiving the same error message described by others.

Just turned off the extension and turned back on; seems to be back to working.

I tried this a few times with no luck; is it still working for you now?

machinemessiah avatar Aug 31 '25 02:08 machinemessiah

Nope, back to not working again; why did you JINX it (jk)?

thetroublemaker avatar Aug 31 '25 03:08 thetroublemaker

I can't reproduce.

Windows 10 Stylus 2.3.16 Edge 139.0.3405.125 (Official build) (64-bit)

@thetroublemaker Can you help inspecting network requests? I'd like to know which request failed. According to the error message, something went wrong while checking the lock file.

  1. Go to chrome://extensions
  2. Enable Developer mode
  3. Find Stylus, Inspect views
  4. Click service worker link.
  5. A devtool should popup. Switch to the Network tab.
  6. Go back to the browser, open Stylus options page, click Sync now.
  7. Go to the devtool and take a screenshot. If you can't tell whether the screenshot contains sensitive info, email the screenshot to me.

You can also try Disconnect and Connect again in Stylus options.

eight04 avatar Aug 31 '25 07:08 eight04

Same issue too since two days ago.

Browser: Microsoft Edge Version 139.0.3405.125 (Official build) (64-bit) Stylus: v2.3.16 Cloud service: Google

I checked the network request with dev tool and it appears that the Google API (www.googleapis.com) returned a 403 Forbidden error. Switching to OneDrive and the sync works as normal.

anthonych avatar Aug 31 '25 16:08 anthonych

is there a way to tell whether the user is using MV2 or MV3

No explicit indication anywhere. Some implicit indications are: Style cache duration option is only present in MV3 and devtools for a Stylus UI page shows sw.js in Sources panel.

tophf avatar Aug 31 '25 16:08 tophf

I've been getting this for several days, now, too. I'm n Windows 10, tried Edge (a brand new installation), Brave, and Chrome, still get the error:

failed to fetch [403]: { "error": { "code": 403, "message": "This revision cannot be downloaded by the authenticated user.", "errors": [ { "message": "This revision cannot be downloaded by the authenticated user.", "domain": "global", "reason": "forbidden" } ] } }

I even went to Google Drive and revoked access to Stylus, then re-authorized it. Still the same error. Notice it IS authorizing, it's just having a problem with this file, which probably means some issue with Stylus. Other apps don't have an issue.

It's happening on all the major browsers, even on new installations, and we're not imagining it. It's not a permissions issue. Something HAS CHANGED and it's not on our end. The person saying they couldn't repro on Edge is doing something wrong, perhaps they're using that fake, imposter Chinese "Stylus" extension that shows up first in searches on Edge...

cbordeman avatar Sep 01 '25 05:09 cbordeman

  1. Go to chrome://extensions
  2. Enable Developer mode
  3. Find Stylus, Inspect views
  4. Click service worker link.
  5. A devtool should popup. Switch to the Network tab.
  6. Go back to the browser, open Stylus options page, click Sync now.
  7. Go to the devtool and take a screenshot. If you can't tell whether the screenshot contains sensitive info, email the screenshot to me.

You can also try Disconnect and Connect again in Stylus options.

I have this error too! Windows 11 Pro + Google Chrome 139.0.7258.155 I did the above and took a screenshot of the error.

https://i.imgur.com/qkrfEzL.jpeg

Csokis avatar Sep 01 '25 07:09 Csokis

https://i.imgur.com/qkrfEzL.jpeg

Thanks, now I can reproduce in db-to-cloud:

    - data should be written to drive
    - getState/setState should be able to access drive name
    - start and sync with the second instance
    - change should flow to other instances
    - cloud is locked while syncing
      1) run suite


  1 passing (2m)
  1 failing

  1) functional
       google
         run suite:
     AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected

  Comparison {
+   message: 'failed to fetch [403]: {\n' +
+     '  "error": {\n' +
+     '    "code": 403,\n' +
+     '    "message": "This revision cannot be downloaded by the authenticated user.",\n' +
+     '    "errors": [\n' +
+     '      {\n' +
+     '        "message": "This revision cannot be downloaded by the authenticated user.",\n' +
+     '        "domain": "global",\n' +
+     '        "reason": "forbidden"\n' +
+     '      }\n' +
+     '    ]\n' +
+     '  }\n' +
+     '}\n'
-   message: /the database is locked/i
  }

So this issue happens when the cloud drive is locked and the second client tries connecting to it. I guess something changed so the application failed downloading revisions.

eight04 avatar Sep 01 '25 08:09 eight04

There is still one problem. If this bug happens to a user, there will be an "invalid" revision stuck in the drive. The only solution is to delete the lock file.

I'm not really sure how to fix it. We probably need to 1) teach users to reset their Google Drive or 2) write some code and add a "Reset" button?

eight04 avatar Sep 01 '25 16:09 eight04

Is there a way to detect it programmatically so Stylus would delete the lock file automatically? I guess one way would be to generate a unique id in storage.local and add it inside the lock file so that this file can be deleted by this instance of Stylus next time it initializes sync and sees a lock file with just its own id.

tophf avatar Sep 01 '25 16:09 tophf

An additional reset button might still make sense even if my suggestion is implemented.

tophf avatar Sep 01 '25 16:09 tophf

Also the bug will reappear as long as there is at least one buggy client connected.

eight04 avatar Sep 01 '25 16:09 eight04