Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Time disagreement causes sync to fail without explanation #3786

Open
2 tasks done
MikeBishop opened this issue Nov 4, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@MikeBishop
Copy link

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)

What happened?

Due to external confluence of circumstances, my laptop wound up being an hour off from the correct time. When Actual attempted to sync, it told me that there was a "problem syncing your changes" but didn't give any information about what the problem was. If the file was deleted locally, attempting to redownload produced this message:
image

It would be preferable to display something about time disagreement, etc. to point the user in the direction of identifying the failure. I don't think Actual needs to create custom error messages for this specific case, but if the error that appears in the browser console (something about "maximum clock drift exceeded") made it a little higher in the stack, this would have been much easier to find and fix.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome, Desktop App (Electron)

Operating System

Windows 11

@MikeBishop MikeBishop added the bug Something isn't working label Nov 4, 2024
@jmuzina
Copy link

jmuzina commented Jan 31, 2025

I'm having this issue as well. I have a server hosted on Pika Pods, and a dual boot setup with Ubuntu & Windows 11. I use Firefox to access a web client. I was initially editing the budget on Ubuntu.

I switched to the Windows partition, and began editing my budget. At some point, I noticed that my Windows time was 5 hours ahead the real time (I live in UTC -5 timezone) due to the difference in how Linux & Windows sync their clocks to the hardware clock (see article for more).

I disabled and re-enabled the Windows "Set time automatically" setting to fix my clock.

Then, whenever I make any change in the Actual client, the following toast appears:

Something internally went wrong. You may want to restart the app if anything looks wrong. Please report this as a new issue on Github.

This error is printed to the console:

[Exception] Error: maximum clock drift exceeded 1738304264196 1738286704242 300000
    K kcab.worker.cc739dc2474a9f737cb9.js:16
    r kcab.worker.cc739dc2474a9f737cb9.js:16
    tl kcab.worker.cc739dc2474a9f737cb9.js:16
    r kcab.worker.cc739dc2474a9f737cb9.js:16
    value timestamp.ts:215
    cY index.ts:195
    cY index.ts:189
    c2 index.ts:279
    fT index.ts:705
    g1 transactions.ts:114
    g1 transactions.ts:104

Restarting the server on PikaPods did not help, nor did restarting my computer.

This is probably related to #1040

Looks like the error is thrown here:

if (lNew - phys > config.maxDrift) {
throw new Timestamp.ClockDriftError(lNew, phys, config.maxDrift);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants