[GH-ISSUE #1968] [Bug]: Import from nYNAB fails with unknown error #26551

Closed
opened 2026-04-18 02:47:24 -05:00 by GiteaMirror · 20 comments
Owner

Originally created by @Arnoud-B on GitHub (Nov 24, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/1968

Verified issue does not already exist?

  • 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

Originally created by @Arnoud-B on GitHub (Nov 24, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/1968 ### 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
GiteaMirror added the needs infobug labels 2026-04-18 02:47:24 -05:00
Author
Owner

@MatissJanis commented on GitHub (Dec 13, 2023):

👋 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.

<!-- gh-comment-id:1853617455 --> @MatissJanis commented on GitHub (Dec 13, 2023): 👋 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.
Author
Owner

@Arnoud-B commented on GitHub (Dec 19, 2023):

Please find the automatically obfuscated file attached.
ynab-budget-export.obfuscated.json.zip

<!-- gh-comment-id:1862616529 --> @Arnoud-B commented on GitHub (Dec 19, 2023): Please find the automatically obfuscated file attached. [ynab-budget-export.obfuscated.json.zip](https://github.com/actualbudget/actual/files/13715183/ynab-budget-export.obfuscated.json.zip)
Author
Owner

@MatissJanis commented on GitHub (Dec 19, 2023):

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

<!-- gh-comment-id:1863354251 --> @MatissJanis commented on GitHub (Dec 19, 2023): 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
Author
Owner

@Arnoud-B commented on GitHub (Dec 19, 2023):

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.

<!-- gh-comment-id:1863408163 --> @Arnoud-B commented on GitHub (Dec 19, 2023): 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.
Author
Owner

@MatissJanis commented on GitHub (Dec 20, 2023):

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
<!-- gh-comment-id:1865021243 --> @MatissJanis commented on GitHub (Dec 20, 2023): 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
Author
Owner

@krelltunez commented on GitHub (Jan 6, 2024):

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:

  1. Within YNAB, I did a "Fresh Start" and tested the import to Actual (which still failed).
  2. 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.
  3. 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.
  4. 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!

<!-- gh-comment-id:1879746015 --> @krelltunez commented on GitHub (Jan 6, 2024): 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: 1. Within YNAB, I did a "Fresh Start" and tested the import to Actual (which still failed). 2. 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. 3. 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. 4. 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!
Author
Owner

@twk3 commented on GitHub (Jan 6, 2024):

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.

<!-- gh-comment-id:1879872395 --> @twk3 commented on GitHub (Jan 6, 2024): 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.
Author
Owner

@krelltunez commented on GitHub (Jan 6, 2024):

My issue very well may have been a duplicate hidden category too.

<!-- gh-comment-id:1879879810 --> @krelltunez commented on GitHub (Jan 6, 2024): My issue very well may have been a duplicate hidden category too.
Author
Owner

@Arnoud-B commented on GitHub (Jan 7, 2024):

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

<!-- gh-comment-id:1880111861 --> @Arnoud-B commented on GitHub (Jan 7, 2024): 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](https://github.com/actualbudget/actual/files/13854227/budget.json)
Author
Owner

@Marethyu1 commented on GitHub (Jan 7, 2024):

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:
8c43c78fc7/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

<!-- gh-comment-id:1880192146 --> @Marethyu1 commented on GitHub (Jan 7, 2024): 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
Author
Owner

@Marethyu1 commented on GitHub (Jan 7, 2024):

I have put up #2191 which I think should address the 'starting balance' issue

<!-- gh-comment-id:1880200100 --> @Marethyu1 commented on GitHub (Jan 7, 2024): I have put up #2191 which I think should address the 'starting balance' issue
Author
Owner

@Arnoud-B commented on GitHub (Jan 9, 2024):

I can confirm that after replacing STARTING BALANCE with Starting Balance, the original export from YNAB is successfully imported!

<!-- gh-comment-id:1882687703 --> @Arnoud-B commented on GitHub (Jan 9, 2024): I can confirm that after replacing `STARTING BALANCE` with `Starting Balance`, the original export from YNAB is successfully imported!
Author
Owner

@Hbicari commented on GitHub (May 26, 2024):

Importing is not working again today.

<!-- gh-comment-id:2132166645 --> @Hbicari commented on GitHub (May 26, 2024): Importing is not working again today.
Author
Owner

@Marethyu1 commented on GitHub (May 26, 2024):

👋 @Hbicari if you can share the file you tried to import someone might be able to take a look for you

<!-- gh-comment-id:2132406958 --> @Marethyu1 commented on GitHub (May 26, 2024): 👋 @Hbicari if you can share the file you tried to import someone might be able to take a look for you
Author
Owner

@Hbicari commented on GitHub (May 30, 2024):

Hello, this is the file i was trying to import.
ynab-budget-export 4.json

<!-- gh-comment-id:2139356282 --> @Hbicari commented on GitHub (May 30, 2024): Hello, this is the file i was trying to import. [ynab-budget-export 4.json](https://github.com/actualbudget/actual/files/15499123/ynab-budget-export.4.json)
Author
Owner

@twk3 commented on GitHub (May 30, 2024):

@Hbicari I'm able to import your file without errors on latest. What version of actual are you using?

<!-- gh-comment-id:2139768664 --> @twk3 commented on GitHub (May 30, 2024): @Hbicari I'm able to import your file without errors on latest. What version of actual are you using?
Author
Owner

@Hbicari commented on GitHub (May 30, 2024):

24.5.0 is the version.

<!-- gh-comment-id:2139792210 --> @Hbicari commented on GitHub (May 30, 2024): 24.5.0 is the version.
Author
Owner

@Hbicari commented on GitHub (May 30, 2024):

Sorry i attached the wrong one. Here is the one im having issues.

<!-- gh-comment-id:2139825557 --> @Hbicari commented on GitHub (May 30, 2024): Sorry i attached the wrong one. Here is the one im having issues.
Author
Owner

@Marethyu1 commented on GitHub (May 31, 2024):

@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

<!-- gh-comment-id:2141077903 --> @Marethyu1 commented on GitHub (May 31, 2024): @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
Author
Owner

@Hbicari commented on GitHub (May 31, 2024):

That Worked, thank you for the help.

<!-- gh-comment-id:2141448851 --> @Hbicari commented on GitHub (May 31, 2024): That Worked, thank you for the help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#26551