actual
actual copied to clipboard
[Bug]: Import from nYNAB fails with unknown error
Verified issue does not already exist?
- [X] I have searched and found no existing issue
What happened?
Importing a ~12MB .json from nYNAB fails with an unknown error. I tried the .json output resulting from the instructions for using the Terminal, and the .json output from the netifly app. Both give the same error and have the same size. The .json contains about 6 years of data, which is hard to share for obvious reasons..
What error did you receive?
An unknown error occurred while importing. Please report this as a new issue on Github.
Where are you hosting Actual?
Locally via Yarn
What browsers are you seeing the problem on?
Firefox, Other
Operating System
Mac OSX
👋 Can you provide an example file to reproduce the issue? Even if it's filled with dummy data. There's not much we can do to help without being able to reproduce.
Please find the automatically obfuscated file attached. ynab-budget-export.obfuscated.json.zip
Thanks. I think the problem is with the recursive sorting solution we have. I've implemented a quick patch that falls back to unsorted list if this problem occurs. Try importing by using the demo link provided there and let me know if that fixes your problem (though I don't exactly know what other knock-on effect this unsorted-ness issue might create).
https://github.com/actualbudget/actual/pull/2104
When testing either the obfuscated or non-obfuscated json at https://deploy-preview-2104.demo.actualbudget.org/, unfortunately, I keep getting the same (unknown) error.
Your budget should have these entries. Could you please de-obfuscate them and reupload the export?
Category groups:
- Internal Master Category
- Credit Card Payments
Categories:
- Income
- Starting Balances
Payees:
- Starting Balances
I experienced this as well with a budget going back to 1/1/2016, but I was able to figure out the problem (at least for me) using the process of elimination. Here's what I did:
- Within YNAB, I did a "Fresh Start" and tested the import to Actual (which still failed).
- At first, I (unsuccessfully) focused on payees. I deleted many of them, and also removed any "renaming" rules (which isn't important to me because I don't import transactions anymore). As noted, this was not successful, and I still got the import error after doing this.
- Next, I focused (successfully) on Hidden Categories. In the "Fresh Start" file, I deleted all my hidden categories and the import WORKED. Unfortunately, I knew it wouldn't be that simple for the real budget, since you can't delete hidden categories that contain transactions.
- In the real budget file, I moved all the transactions in the hidden categories to a new category that I set up for this purpose (called "Hidden Categories"), and then I deleted the old hidden categories. Tested again and it worked!!!
I'm not sure what about my hidden categories caused the import to fail, but there you have it!
My nYNAB budget (old data from earlier last year) export now contains one duplicate category in the hidden categories called 'Software Subscriptions' which throws this error. I didn't see this a few months ago when I first moved to actual. But saw it while doing some debugging where I wanted to import a bunch of data.
My issue very well may have been a duplicate hidden category too.
OK, so I resubscribed to YNAB to try the Fresh Start approach. After removing most accounts and categories, plus all payees, and entering a fake transaction, then exporting to JSON and importing in Actual, I still get the error.
I've attached the JSON (hardly obfuscated this time but quite empty, hope that helps). budget.json
I get the following error when uploading the attached budget:
failed to run import
TypeError: undefined is not an object (evaluating 'data.payees.find((payee)=>payee.name === 'Starting Balance').id')
(anonymous function) — ynab5.ts:144
Looks like @Arnoud-B's attached budget has STARTING BALANCE
in uppercase, where as the corresponding block is searching for Starting Balance
:
https://github.com/actualbudget/actual/blob/8c43c78fc7d718d1d6a37d618d2bf568c71aa04c/packages/loot-core/src/server/importers/ynab5.ts#L140
Think it might be as simple as making the check case insensitive. Ill put up a pr
I have put up #2191 which I think should address the 'starting balance' issue
I can confirm that after replacing STARTING BALANCE
with Starting Balance
, the original export from YNAB is successfully imported!
Importing is not working again today.
👋 @Hbicari if you can share the file you tried to import someone might be able to take a look for you
Hello, this is the file i was trying to import. ynab-budget-export 4.json
@Hbicari I'm able to import your file without errors on latest. What version of actual are you using?
24.5.0 is the version.
Sorry i attached the wrong one. Here is the one im having issues.
@Hbicari looks like it doesn't like that you have a category group called 'Income' - this bit in your json file
"category_groups": [
{
"id": "35b1d775-605c-4a5b-8c80-473a5f4de675",
"name": "Income",
"hidden": false,
"deleted": false
},
I think this is because Income is a default category group in actual by default. As a short term fix you can get around this by naming the category group something else (even just Income with a space at the end income
, that will enable you to import your budget. (just edit the json file and try reupload).
Longer term something should be done to handle imports that have a category group set as income, this can probably be raised as a bug
That Worked, thank you for the help.