Skip to content
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

Failed to generate GnuCash transactions CSV-divide by zero #98

Closed
pnemonic78 opened this issue May 11, 2024 · 6 comments
Closed

Failed to generate GnuCash transactions CSV-divide by zero #98

pnemonic78 opened this issue May 11, 2024 · 6 comments
Assignees
Labels
area/dataports import, export, backup bug Something isn't working

Comments

@pnemonic78
Copy link
Collaborator

pnemonic78 commented May 11, 2024

Non-fatal Exception: org.gnucash.android.export.Exporter$ExporterException: Failed to generate GnuCash transactions CSV-divide by zero
       at org.gnucash.android.export.csv.CsvTransactionsExporter.generateExport(CsvTransactionsExporter.java:177)
       at org.gnucash.android.export.csv.CsvTransactionsExporter.generateExport(CsvTransactionsExporter.java:86)
       at org.gnucash.android.export.ExportAsyncTask.doInBackground(ExportAsyncTask.java:136)
       at org.gnucash.android.export.ExportAsyncTask.doInBackground(ExportAsyncTask.java:89)
       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)

Caused by java.lang.ArithmeticException: divide by zero
       at java.math.BigDecimal.divideAndRound(BigDecimal.java:4695)
       at java.math.BigDecimal.divide(BigDecimal.java:5768)
       at java.math.BigDecimal.divide(BigDecimal.java:1659)
       at java.math.BigDecimal.divide(BigDecimal.java:1689)
       at org.gnucash.android.model.Money.div(Money.kt:337)
       at org.gnucash.android.model.Money.div(Money.kt:355)
       at org.gnucash.android.export.csv.CsvTransactionsExporter.writeSplitsToCsv(CsvTransactionsExporter.java:143)
       at org.gnucash.android.export.csv.CsvTransactionsExporter.generateExport(CsvTransactionsExporter.java:171)
       at org.gnucash.android.export.csv.CsvTransactionsExporter.generateExport(CsvTransactionsExporter.java:86)
       at org.gnucash.android.export.ExportAsyncTask.doInBackground(ExportAsyncTask.java:136)
       at org.gnucash.android.export.ExportAsyncTask.doInBackground(ExportAsyncTask.java:89)
       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)
@pnemonic78 pnemonic78 added the bug Something isn't working label May 11, 2024
@pnemonic78 pnemonic78 self-assigned this May 11, 2024
@Kaligula0
Copy link
Collaborator

When that happens?

@BaumiCoder
Copy link

I tested the export with version 2.5.3 (Update from the 9th January 2025), which should contain the changes form #196. I opened a database from gnucash desktop version and made an export for about the last 2 weeks, which contains some transactions:

  • CSV: Contains all transactions of the database.
  • QIF: Error message "Error when exporting the QIF file"

If the problems are not reproducible at your side after the changes, you can tell me which additional information (logs or something like this) I can provide to help.

@pnemonic78
Copy link
Collaborator Author

@BaumiCoder

  1. Export checks the modification date of transactions - so a newly imported book has all modifications set to that day.
  2. QIF export - can you send me the problematic gnucash file?

@BaumiCoder
Copy link

  1. Okay, this is no suitable behavior. Will be addressed with Export transactions since. #252, right?
  2. The problematic gnucash file contains my real financial data. Therefore, I don't want to share this file. I try to reproduce a similar file (XML format, German settings), but I am not able to create another file with this error. Can I somehow provide information about the reason without sharing the gnucash file? Are there any logs about such errors?

@pnemonic78
Copy link
Collaborator Author

pnemonic78 commented Feb 3, 2025 via email

@BaumiCoder
Copy link

I was able to export some logs from a reproduction with SysLog after giving permissions with adb. Gnucash produces some lines in the logcat.log (see logcat_gnucash.log). The most suspect entry seems to be this one:

02-04 11:42:44.840 E/ExportAsyncTask(17559): org.gnucash.android.export.Exporter$ExporterException: Failed to generate export with parameters: Export all transactions created since 2025-01-01 12:32:31.917 UTC as QIF to SHARING - split quantity has illegal denominator: 100000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dataports import, export, backup bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants