-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to import. gnucash file #158
Comments
I am also facing similar problem. When I try to open the .gnucash file created with Gnucash for desktop, Gnucash Pocket just stays in the importing popup. It never completes. When I tap anywhere on the screen the popup just disappears, without any error message.
|
I just found that, the gnucash file format I had for the desktop was gzipped XML file. I switched to SQLite3 backend and this file fails with the message "An error occurred while opening the GnuCash accounts", as mentioned in this issue. |
did you try to use not gzipped XML file? |
@Kaligula0 I'm not using a gzipped version, just a plain old .gnucash file. Is there a way to debug this further through adb or something? I'm ready to dig around figure out what is causing this, but I have no experience with android apps. |
Just an update, I have set up android studio and is able to build the app and run it. How to proceed further? |
@djbrown @Kaligula0 So I managed to get the logs, Turns out the problem is probably caused by the custom commodities that I made. Not sure what is the cause though. I am attaching the log file. |
Thank you for providing the log.
And the following exception comes from here: gnucash-android/app/src/main/kotlin/org/gnucash/android/model/Money.kt Lines 320 to 324 in d3af73d
@MadFisa can you give minimum steps to reproduce the problem from scratch, or even better provide an automated unit or instrumentation-test? |
Can you attach the problematic file?
…On Wed, 3 Jul 2024, 22:58 Daniel Brown, ***@***.***> wrote:
Thank you for providing the log.
The following errors remind me of #156
<#156>:
D Start import
I Creating database tables
I Bulk adding 224 Commodity records to the database
E Commodity not found in the database: ASIANPAINT
E Commodity not found in the database: HDFC_MIDC_OPPO_UP4UI9
E Commodity not found in the database: ICIC_PRU_TECH_1027WGP
E Commodity not found in the database: NIPP_INDI_LARG_COGPO7
E Commodity not found in the database: NIPP_INDI_SMAL_1AOBL3E
E Commodity not found in the database: PGIM_INDI_ELSS_156PSD9
E Commodity not found in the database: template
E Commodity not found in the database: QUAN_ELSS_TAX_KBGFAS
And the following exception comes from here:
https://github.com/GnuCash-Pocket/gnucash-android/blob/d3af73d6460c728746c42ee08ef3bc709b5a264d/app/src/main/kotlin/org/gnucash/android/model/Money.kt#L320-L324
Error importing: content://com.android.providers.downloads.documents/document/3881
org.gnucash.android.model.Money$CurrencyMismatchException: Cannot perform operation on Money instances with different currencies
at org.gnucash.android.model.Money.minus(Money.kt:324)
at org.gnucash.android.model.Transaction.getImbalance(Transaction.kt:239)
at org.gnucash.android.model.Transaction.createAutoBalanceSplit(Transaction.kt:130)
at org.gnucash.android.importer.GncXmlHandler.endElement(GncXmlHandler.java:680)
at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:167)
at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:526)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:487)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:324)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:287)
at org.gnucash.android.importer.GncXmlImporter.parse(GncXmlImporter.java:70)
at org.gnucash.android.importer.ImportAsyncTask.doInBackground(ImportAsyncTask.java:84)
at org.gnucash.android.importer.ImportAsyncTask.doInBackground(ImportAsyncTask.java:44)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
@MadFisa <https://github.com/MadFisa> can you give minimum steps to
reproduce the problem from scratch, or even better provide an automated
unit or instrumentation-test?
also @pnemonic78 <https://github.com/pnemonic78> could you look into this?
—
Reply to this email directly, view it on GitHub
<#158 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3GXCXYGT3ES3T7H6CPQNDZKRJWPAVCNFSM6AAAAABJVU7UHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBXGEYTSNRUHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi, I'm happy to share the file, I have uploaded the file in the following link. https://drive.google.com/file/d/11iNqXt07zR0r_N7Fk8774r9D1dR5cgLb/view?usp=sharing Let me know when you try to access the file. I will have to accept the request. My laptop is fried, so I'm unable to reproduce the situation for now.
|
@pnemonic78 I believe I recieved your request for access. You should be able to download the file now. |
examples of problematic ocmmodities in the gnucash file:
|
I had a similar problem with the import of GnuCash files from desktop, but could fix it like this: Thank you for your work 👍 |
I also have had errors importing my GnuCash desktop accounts into GnuCash Pocket. I have tried both exported csv accounts (habit, from the GnucashMobile app I was using previously and an exported .XML file. "An error occurred when importing the GnuCash acco..." The XML file was obtained in the Desktop application via: File>Export>Export, I used the .gnucash extension, as well as a renamed .XML extension. The CSV file was obtained via File>Export>Export Account Tree to CSV I have enabled crash logging. I am not sure where to find this log, despite looking broadly, including: I do see a lot of 'backup' gz files in:
|
So this is the same problem as reported in #34 ? |
I don't see the similarity between 'unable to import .gnucash file' and 'non-currency assets are displayed as "XXX"'. Is this the issue you meant to reference? |
@bdmartens Yes I think they're connected. djbrown and pneumonic78 found that the issue is caused by custom commodities. fisian noted that their currency becomes XXX. |
@pnemonic78 I'm able to import with newer versions of the app without any issues and custom commodities are imported successfully. |
Steps to reproduce the behaviour
Expected behaviour
GnuCash accounts on pc is successfully imported
Actual behaviour
A message popup with message
"An error occurred while importing gnucash accoimts".
No further information is show regarding the nature of error.
Software specifications
Suggested Resolution
I don't have enough knowledge, but could it be due to some kind of lock on file by desktop gnucash?? Sometimes desktop application shows the file has not been properly closed by previous instance or something and suggest to open as read only. You can still force to open it and continue to use without any problems.
The text was updated successfully, but these errors were encountered: