Skip to content
New issue

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

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

Already on GitHub? # to your account

Crashing on OFX import #342

Closed
VeraStray opened this issue Mar 2, 2023 · 17 comments · Fixed by #369
Closed

Crashing on OFX import #342

VeraStray opened this issue Mar 2, 2023 · 17 comments · Fixed by #369
Assignees
Labels
bug Something isn't working in-beta This issue is fixed in a beta version
Milestone

Comments

@VeraStray
Copy link

I just installed Denaro. It is crashing when I try to import OFX. I am on Fedora 37 Gnome 43.3. No error message. Just closes and I have to re-launch. I tried importing CSV as well and it just says 0 transactions imported. I have confirmed the CSV file is not empty.

@fsobolev
Copy link
Member

fsobolev commented Mar 2, 2023

I tried importing CSV as well and it just says 0 transactions imported. I have confirmed the CSV file is not empty.

A CSV file not created in Denaro is expected to give "0 transactions imported" result. From user documentation:

While CSV is a common format and some banks allow their users to export information as CSV, these files are in fact tables that can contain arbitrary data. Importing a CSV file created in other program will fail, because its data will not be compatible with what Denaro tries to get from a file. The purpose of CSV import/export is to provide a way to add data to an account using external programs such as text editors and office suites. Import will only add new transactions without overriding existing ones.

But crash on OFX import is definitely a bug. Could you please run the app in terminal and copy the output? If installed using flatpak, you can use this command:

flatpak run org.nickvision.money

@fsobolev fsobolev added the bug Something isn't working label Mar 2, 2023
@fsobolev fsobolev added this to the V2023.3.0 milestone Mar 2, 2023
@VeraStray
Copy link
Author

VeraStray commented Mar 2, 2023

Thanks for the quick reply. Here is the terminal output after opening and trying to import...

[leira@leira ~]$ flatpak run org.nickvision.money

(NickvisionMoney.GNOME:2): Gtk-CRITICAL **: 11:18:20.224: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

(NickvisionMoney.GNOME:2): Gtk-CRITICAL **: 11:18:20.224: gtk_widget_add_css_class: assertion 'GTK_IS_WIDGET (widget)' failed
Registering new type NickvisionMoneyGNOMEControlsGroupRow with parent AdwActionRow
Unhandled exception. OfxSharp.OFXParseException: OFX security unsupported
at OfxSharp.OFXDocumentParser.CheckHeader(String[] header)
at OfxSharp.OFXDocumentParser.ParseHeader(String file)
at OfxSharp.OFXDocumentParser.SGMLToXML(String file)
at OfxSharp.OFXDocumentParser.ParseOfxDocument(String ofxString)
at OfxSharp.OFXDocumentParser.Import(String ofx)
at OfxSharp.OFXDocumentParser.Import(FileStream stream)
at NickvisionMoney.Shared.Models.Account.ImportFromOFXAsync(String path, String rgba) in /run/build/org.nickvision.money/NickvisionMoney.Shared/Models/Account.cs:line 1279
at NickvisionMoney.Shared.Models.Account.ImportFromFileAsync(String path, String rgba) in /run/build/org.nickvision.money/NickvisionMoney.Shared/Models/Account.cs:line 1089
at NickvisionMoney.Shared.Controllers.AccountViewController.ImportFromFileAsync(String path) in /run/build/org.nickvision.money/NickvisionMoney.Shared/Controllers/AccountViewController.cs:line 893
at NickvisionMoney.GNOME.Views.AccountView.<>c__DisplayClass88_1.<b__1>d.MoveNext() in /run/build/org.nickvision.money/NickvisionMoney.GNOME/Views/AccountView.cs:line 867
--- End of stack trace from previous location ---
at NickvisionMoney.GNOME.Views.AccountView.<>c__DisplayClass88_0.<b__0>d.MoveNext() in /run/build/org.nickvision.money/NickvisionMoney.GNOME/Views/AccountView.cs:line 867
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
[leira@leira ~]$

@nlogozzo
Copy link
Member

nlogozzo commented Mar 2, 2023

Could you attach the ofx file you tried importing? (Remove any important information from the file) Its seems as the ofx library had trouble parsing the file and I'd like to make sure it's formatted correctly or atleast update Denaro to match your file's format.

@nlogozzo
Copy link
Member

nlogozzo commented Mar 2, 2023

By the looks of the error message, is the ofx file encrypted in any way? Password-protected?

@VeraStray
Copy link
Author

It's not encrypted or password-protected. Is there a way I can send it to you in a less public way?

This is the start of the file:
OFXHEADER:100
DATA:OFXSGML
VERSION:102
SECURITY:TYPE1
ENCODING:USASCII
CHARSET:1252
COMPRESSION:NONE
OLDFILEUID:NONE
NEWFILEUID:NONE

@nlogozzo
Copy link
Member

nlogozzo commented Mar 2, 2023

You can email it to me: nlogozzo225@gmail.com

Like I said feel free to replace sensitive amounts and descriptions with garbage data.

@ascpial
Copy link

ascpial commented Mar 10, 2023

As this issue is related to imports, I should mention than QIF import is broken as well.

I tried to import data from an other app, HomeBank, as well as the example file given in #265 and the toaster says "0 transactions imported".

The format of the date in both files is correct (US date: MM/DD/YYYY).

I'm using the latest version at the time of writing, which is 2023.2.2.

There is also no output in console when launching the app from the terminal.

@nlogozzo
Copy link
Member

@ascpial Could you also attach here or email me a sample QIF file that you are using?

@nlogozzo
Copy link
Member

@VeraStray it turns out that your issue is rather quite easy to fix. It's not Denaro's fault.
You just have to change the security line in your OFX file from TYPE1 to NONE.
See: https://support.cosmolex.com/knowledge-base/statement-import-error-ofx-security-unsupported/

I did however commit a fix that won't crash the whole program when ofx import fails, but say 0 transactions imported

@fsobolev Could we add something to docs for OFX that says make sure the security line is NONE and not TYPE1?

@nlogozzo
Copy link
Member

@ascpial Since QIF is different from OFX, open another issue with your QIF file attached so we can fix that there.

@fsobolev
Copy link
Member

@fsobolev Could we add something to docs for OFX that says make sure the security line is NONE and not TYPE1?

Or we could make Denaro parse ofx file to check if it contains security TYPE1 and if it does, create new temporary file with replaced security value and pass this file to OFXSharp.

@nlogozzo
Copy link
Member

Or we could make Denaro parse ofx file to check if it contains security TYPE1 and if it does, create new temporary file with replaced security value and pass this file to OFXSharp.

Yeah, i guess we can do that. I'll implement it now :)

@nlogozzo
Copy link
Member

#369 Will check for and handle the security automatically, so @VeraStray no need to make changes to your file. I'll make a beta release later today/tomorrow so that you can test the fix.

@VeraStray
Copy link
Author

@nlogozzo That's awesome! Thanks for this!

@nlogozzo nlogozzo added the in-beta This issue is fixed in a beta version label Mar 16, 2023
@nlogozzo
Copy link
Member

@VeraStray
Copy link
Author

VeraStray commented Mar 16, 2023 via email

@fsobolev
Copy link
Member

Reports are the main thing. To be able to find out how much was spent in a specific group over a specific period.
<...>
But as I said, just the ability to get some totals from groups and periods is my main need, so I know how much we are spending on groceries, etc...

#366, #367 and #289 are probably what you are interested in.

The ability to see what group a transaction is in from the main list of transactions.

I don't think there's a good way to place group label in transaction rows in current design. But I hope you will find #339 useful for your needs

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working in-beta This issue is fixed in a beta version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants