[Bug]: "invalid schema" shows misleading "Update required" error message #162

Closed
opened 2026-02-28 18:50:40 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @albertogasparin on GitHub (Jan 17, 2023).

Verified issue does not already exist?

I have searched and found no existing issue

What happened?

After creating, removing and recreating a file on my laptop, sync broke on my iPad and was not able to make it work until I triggered reset sync from the laptop itself. The error message showing up on the iPad was "Update required" even if was using the latest web version directly from the server 😕

I thought the problem was on some cache on iPad, so deleted all data there (tried network caches, local dbs, ...) but Actual would still start syncing and then log an "invalid schema" error in the console.
Turns out the problem (likely) was the server sending a partial file even when no file was available on the device. I saw from the logs that "Got meta for documents-Actual-My-Finances-ea6e8ff-db.sqlite" size was very different between the broken sync (300KB) vs when the full sync happened (1.1MB).

I think it would be helpful to improve the messaging on the error (or have a complete different errors for these "invalid schema" exceptions) and provide a way for the device where this error occurs to discard local data and have the server send a full sync again.

App: 23.1.12 | Server: 23.1.12

What error did you receive?

No response

Where are you hosting Actual?

Fly.io

What browsers are you seeing the problem on?

Safari

Operating System

Mobile Device

Originally created by @albertogasparin on GitHub (Jan 17, 2023). ### Verified issue does not already exist? I have searched and found no existing issue ### What happened? After creating, removing and recreating a file on my laptop, sync broke on my iPad and was not able to make it work until I triggered reset sync from the laptop itself. The error message showing up on the iPad was "Update required" even if was using the latest web version directly from the server 😕 I thought the problem was on some cache on iPad, so deleted all data there (tried network caches, local dbs, ...) but Actual would still start syncing and then log an "invalid schema" error in the console. Turns out the problem (likely) was the server sending a partial file even when no file was available on the device. I saw from the logs that "Got meta for documents-Actual-My-Finances-ea6e8ff-db.sqlite" size was very different between the broken sync (300KB) vs when the full sync happened (1.1MB). I think it would be helpful to improve the messaging on the error (or have a complete different errors for these "invalid schema" exceptions) and provide a way for the device where this error occurs to discard local data and have the server send a full sync again. App: 23.1.12 | Server: 23.1.12 ### What error did you receive? _No response_ ### Where are you hosting Actual? Fly.io ### What browsers are you seeing the problem on? Safari ### Operating System Mobile Device
GiteaMirror added the needs infobug labels 2026-02-28 18:50:40 -06:00
Author
Owner

@Kidglove57 commented on GitHub (Jan 18, 2023):

I am a non technical user. I agree the wording of the message is misleading - I had got so used to it that I did not report it.

In your situation, I
a) close the file on my iPad,then
b) delete that file on the iPad being very careful to select local only.
C) I then click on the file again to re-download it and all is well

Please excuse me if I have misunderstood.

@Kidglove57 commented on GitHub (Jan 18, 2023): I am a non technical user. I agree the wording of the message is misleading - I had got so used to it that I did not report it. In your situation, I a) close the file on my iPad,then b) delete that file on the iPad being very careful to select local only. C) I then click on the file again to re-download it and all is well Please excuse me if I have misunderstood.
Author
Owner

@jlongster commented on GitHub (Jan 18, 2023):

The reason that is the error message is because 95% of the time the reason this happens is because the app has been updated with some new fields in the database, and another client has started using these new fields. An older version of the app will then run into this error, and the likely fix is it just needs an update. The error shouldn't be any scarier than that.

It's weird that you ran into "invalid schema" -- usually local db problems are more like a corrupt database entirely. I'd be curious to dig into what happened more. If anyone runs into this again, it could be worth looking at what changes are trying to be applied and why they aren't working. Usually, if there's a bug (and it's usually the browser's problem of messing with the persisted data) with the db in the browser it'll mess up the data in more serious ways that shows other error messages.

@jlongster commented on GitHub (Jan 18, 2023): The reason that is the error message is because 95% of the time the reason this happens is because the app _has_ been updated with some new fields in the database, and another client has started using these new fields. An older version of the app will then run into this error, and the likely fix is it just needs an update. The error shouldn't be any scarier than that. It's weird that you ran into "invalid schema" -- usually local db problems are more like a corrupt database entirely. I'd be curious to dig into what happened more. If anyone runs into this again, it could be worth looking at what changes are trying to be applied and why they aren't working. Usually, if there's a bug (and it's _usually_ the browser's problem of messing with the persisted data) with the db in the browser it'll mess up the data in more serious ways that shows other error messages.
Author
Owner

@jlongster commented on GitHub (Jan 18, 2023):

And yes @Kidglove57 is right. You can always delete a file locally and then select it to re-download it.

I don't trust the iPad browser's storage to be honest. I've heard these kinds of problem before and it might not be good enough to run a fully local app. But I haven't looked into it more :)

@jlongster commented on GitHub (Jan 18, 2023): And yes @Kidglove57 is right. You can always delete a file locally and then select it to re-download it. I don't trust the iPad browser's storage to be honest. I've heard these kinds of problem before and it might not be good enough to run a fully local app. But I haven't looked into it more :)
Author
Owner

@Kidglove57 commented on GitHub (Jan 18, 2023):

I have been using Actual open source on my iPad for quite some months and this is the only issue I have run into on iPad. In other words having to re-download the file after I had (for example)re-imported it on laptop.

I do export regularly though, just in case, so that I have a backup!

However, I have run into a similar error from time to time in Safari on my laptop. And I have solved it by deleting the local version and re-downloading. After doing so, I have immediately tested my existing Actual links in Firefox and Brave on laptop and found that there were no issues with them. This is leading me to wonder if there is something "unique" about the way Safari handles the cached data? To reiterate Safari is the only browser in which I have had an issue with Actual, on laptop or iPad

@Kidglove57 commented on GitHub (Jan 18, 2023): I have been using Actual open source on my iPad for quite some months and this is the only issue I have run into on iPad. In other words having to re-download the file after I had (for example)re-imported it on laptop. I do export regularly though, just in case, so that I have a backup! However, I have run into a similar error from time to time in Safari on my laptop. And I have solved it by deleting the local version and re-downloading. After doing so, I have immediately tested my existing Actual links in Firefox and Brave on laptop and found that there were no issues with them. This is leading me to wonder if there is something "unique" about the way Safari handles the cached data? To reiterate Safari is the only browser in which I have had an issue with Actual, on laptop or iPad
Author
Owner

@j-f1 commented on GitHub (Jan 18, 2023):

Maybe it would be helpful to add a bit more info to this error? For example I hit it while testing locally because I added a column (for #268) to my budget and now I get the error. Maybe there could be more detailed diagnostic info in the message? (there definitely was in my case)

@j-f1 commented on GitHub (Jan 18, 2023): Maybe it would be helpful to add a bit more info to this error? For example I hit it while testing locally because I added a column (for #268) to my budget and now I get the error. Maybe there could be more detailed diagnostic info in the message? (there definitely was in my case)
Author
Owner

@jlongster commented on GitHub (Jan 18, 2023):

@Kidglove57 Actual stresses browser's local persistence layer because it stores everything locally. That means the implementation (called IndexedDB) must be rock solid to have a smooth and solid experience 100% of the time. Safari's unfortunately is not quite there; it's a complex thing to get right and Safari tends to have less devs working on it than Chrome/Firefox. (I personally use Safari! I do love it but have to accept this tradeoff)

@j-f1 Yeah for sure. It could be better, y'all feel free to change it however you like. Just wanted to give some context for why it was written that way in the first place.

@jlongster commented on GitHub (Jan 18, 2023): @Kidglove57 Actual stresses browser's local persistence layer because it stores everything locally. That means the implementation (called IndexedDB) must be rock solid to have a smooth and solid experience 100% of the time. Safari's unfortunately is not quite there; it's a complex thing to get right and Safari tends to have less devs working on it than Chrome/Firefox. (I personally use Safari! I do love it but have to accept this tradeoff) @j-f1 Yeah for sure. It could be better, y'all feel free to change it however you like. Just wanted to give some context for why it was written that way in the first place.
Author
Owner

@j-f1 commented on GitHub (Feb 21, 2023):

Update: with #671, there is now more information logged into the console.

@j-f1 commented on GitHub (Feb 21, 2023): Update: with #671, there is now more information logged into the console.
Author
Owner

@MatissJanis commented on GitHub (Mar 30, 2023):

👋 Hey @albertogasparin just checking in if this issue is still something you experience in the latest version?

If not - lets close it off. :)

@MatissJanis commented on GitHub (Mar 30, 2023): 👋 Hey @albertogasparin just checking in if this issue is still something you experience in the latest version? If not - lets close it off. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#162