actual icon indicating copy to clipboard operation
actual copied to clipboard

[Bug]: Unable to open budget file: This budget cannot be loaded with this version of the app

Open KuroSetsuna29 opened this issue 1 year ago • 9 comments

Verified issue does not already exist?

  • [X] I have searched and found no existing issue

What happened?

Last time I opened my budget was probably a couple of weeks ago. Now when I try to open my budget I am getting following error:

This budget cannot be loaded with this version of the app. Make sure the app is up-to-date. Do you want to load a backup?

It seems like there are no backups available either.

Note: I am using edge-alpine docker tag, but I have tried using all alpine tags in the past month, each have the same issue.

What error did you receive?

This budget cannot be loaded with this version of the app. Make sure the app is up-to-date. Do you want to load a backup?

I also see the following in the browser console:

Reading meta... Got meta for documents-Actual-My-Finances-1-7257e87-db.sqlite: {size: 20201472} Opened! Error updating Error: out-of-sync-migrations at migrations.ts:114:13 at p (migrations.ts:123:3) at async update.ts:9:1 at async g (update.ts:32:23) at async ut (main.ts:2182:3) at async ot.load-budget (main.ts:1925:3)

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Windows 10

KuroSetsuna29 avatar Jun 21 '23 19:06 KuroSetsuna29

I had that same issue when I tried to use Firefox with my budget for the first time. I ended up exporting my budget and re-importing it, which caused the error to go away. Clearing the cache and data of the offending browser didn't help in my case. Sorry to not be much help, but if you can find a browser that will open it, I'd export a backup and re-import.

shall0pass avatar Jun 21 '23 19:06 shall0pass

Unfortunately, I have tried Chrome, Firefox, and Edge. All unable to open it.

KuroSetsuna29 avatar Jun 21 '23 19:06 KuroSetsuna29

If you open the developer tools (ctrl+shift+i) and switch to the Console tab, then attempt to open the file again, are there any log messages printed? Can you send them over if so?

j-f1 avatar Jun 21 '23 20:06 j-f1

If you open the developer tools (ctrl+shift+i) and switch to the Console tab, then attempt to open the file again, are there any log messages printed? Can you send them over if so?

I am getting the following in the browser console log:

Reading meta... Got meta for documents-Actual-My-Finances-1-7257e87-db.sqlite: {size: 20201472} Opened! Error updating Error: out-of-sync-migrations at migrations.ts:114:13 at p (migrations.ts:123:3) at async update.ts:9:1 at async g (update.ts:32:23) at async ut (main.ts:2182:3) at async ot.load-budget (main.ts:1925:3)

KuroSetsuna29 avatar Jun 21 '23 20:06 KuroSetsuna29

I don't know if this provides any clues. But, when I tried to run the Edge version towards the end of May, I got the same error. Updating to the June release resolved it for me.

Kidglove57 avatar Jun 21 '23 20:06 Kidglove57

Opened #1161 which will hopefully be included in an edge release in the near future. That will output additional debugging information we can use to figure out what went wrong here.

j-f1 avatar Jun 21 '23 20:06 j-f1

Oh, I think I see what happened. You must have used a version of the edge image that included the bad change introduced in a25327d37000cbc1c7f4bcaf11526cc4d1f9fb61 and fixed in 6e6d765699430520c3adfb8f206eef1fc258aafd. The easiest solution would be to restore from a recent backup (this is why we recommend keeping backups if you use the edge image). If you don’t have a backup, you might be able to manually update the migration table to remove the bad migration and insert the new one.

j-f1 avatar Jun 21 '23 20:06 j-f1

Thank you, that fixed it!

For anyone else that has this problem (and does not have a backup, if you do just use the backup is easier), I did the following:

  1. Extract the budget file on the server ({actualbudget_appdata_path}/user-files/file-{random_uuid}.blob), this should output a db.sqlite and metadata.json file
unzip file-25cc91b2-382f-4d49-a854-a403d5a6e430.blob
  1. Use sqlite3 to edit the db.sqlite file
sqlite3 db.sqlite
  1. Select the __migrations__, if you have a record with id 1682265217543 then you have this issue
select * from __migrations__;
  1. Delete 1682265217543 from __migrations__
delete from __migrations__ where id = 1682265217543;
  1. I had to also add back the type column to accounts table as it looks like the bad migration already removed and prevents the good migration from running
alter table accounts add column type text;
  1. Save database changes
.exit
  1. Update the blob with the new db.sqlite
zip file-25cc91b2-382f-4d49-a854-a403d5a6e430.blob db.sqlite
  1. Delete the local copy of the database in the browser (three dots > delete > local only)

Funny enough, I was updating my server filesystem from btrfs to zfs, and lost my appdata backups which I probably could have restored from. I'll look into creating backups in actual app.

KuroSetsuna29 avatar Jun 21 '23 21:06 KuroSetsuna29

Nice work. Might be useful to stick that in a doc help page?

Shazib avatar Jun 22 '23 00:06 Shazib

Closing this off as solved.

MatissJanis avatar Aug 06 '23 15:08 MatissJanis