[GNC] Unable to open GnuCash file: "No suitable backend was found for <FILE>."
Tomer Altman
me at tomeraltman.net
Fri Jul 14 15:19:28 EDT 2023
On 7/14/23 12:15 PM, john wrote:
>
>> On Jul 13, 2023, at 23:52, Tomer Altman <me at tomeraltman.net> wrote:
>>
>> On 7/13/23 8:55 AM, john wrote:
>>>
>>>> On Jul 13, 2023, at 01:34, Tomer Altman <me at tomeraltman.net> wrote:
>>>>
>>>> On 7/12/23 6:26 PM, john wrote:
>>>>>
>>>>>> On Jul 12, 2023, at 16:16, Tomer Altman <me at tomeraltman.net> wrote:
>>>>>>
>>>>>> Hi everyone,
>>>>>>
>>>>>> Due to filesystem errors, I had to reinstall MacOS on my 2015 Macbook Air (current OS version: Monterey 12.6.7). After doing so, and restoring my files from a TimeMachine backup using Migration Assistant, I started getting this error when trying to open my accounting file:
>>>>>>
>>>>>> "No suitable backend was found for <FILE>."
>>>>>>
>>>>>> (where "<FILE>" is a stand-in for the actual file name)
>>>>>>
>>>>>> I was at the time using a version of GnuCash from December 2022. I then reinstalled using the installer available from gnucash.org (current version: "5.3+(2023-06-26)" ). Unfortunately, the error persists.
>>>>>>
>>>>>> Looking at this error message in the mailing list archives, it seems like this has something to do with using the SQLite back-end. I looked at the 'environment' text file, and it is implementing already the environment variable recommended as a fix:
>>>>>>
>>>>>> GNC_DBD_DIR={SYS_LIB}/dbd
>>>>>>
>>>>>> It seems like my install is still unable to find the libraries that it needs, though.
>>>>>>
>>>>>> It's unclear to me how to diagnose which version of the back-end my file is using, since I cannot open it. Using 'file' and 'head' shows that it is not XML, and I am unable to decompress the file using Gzip. I'm also unable to open it using the sqlite3 command line tool.
>>>>>>
>>>>>> So, two questions:
>>>>>>
>>>>>> 1. What's the correct way to verify the back-end type using something other than GnuCash itself?
>>>>>>
>>>>>> 2. What is wrong with my fresh install that is preventing me from opening up the file?
>>>>>>
>>>>>> Thanks in advance for any and all advice and assistance!
>>>>> If it's a SQLite file you can open it with sqlite3, provided by macOS. Just open Terminal and run
>>>>> sqlite3 /path/to/my/gnucash/file
>>>>> You can use the `.tables` command to list the tables and `.schema <tablename>` to show the structure and compare it with https://wiki.gnucash.org/wiki/SQL.
>>>>>
>>>>> 99% of the time when users report this problem it's because they're trying to open a log file or a .gcm file instead of their actual book.
>>>>>
>>>>> Regards,
>>>>> John Ralls
>>>>>
>>>> Hi John,
>>>>
>>>> Thank you very much for taking the time to reply. I appreciate it.
>>>>
>>>> I've tried doing what you are suggesting. Let's say that my "<FILE>" name is "foo.gnucash". When I type the following:
>>>>
>>>> sqlite3 foo.gnucash
>>>>
>>>>> .tables
>>>> I get:
>>>>
>>>> "Error: file is not a database"
>>>>
>>>> I thought to myself, "Perhaps the SQLite3 file was corrupted?" So I went to a TimeMachine backup of the directory from April (before any issues with my laptop), and copied over foo.gnucash to a temporary directory. This file would open successfully with GnuCash. Using the command line, I see that 'file' correctly identifies it as a gzip compressed file.
>>>>
>>>> So it seems that this was an issue with the foo.gnucash file getting corrupted, perhaps from the filesystem errors that I was experiencing. Thanks for prompting me to debug this further. I'll restore my file using the *.gnucash backup files, and by adding in the relevant log files.
>>>>
>>>> If I may be so bold as to suggest a UI improvement: Telling the user "No suitable backend was found for <FILE>" implies that the file is fine, it's just that there's no back-end to support it. That impression was bolstered by the mailing list discussion of missing library paths. I'd suggest wording that makes it clear that the *FILE* is the issue, as in it's either the wrong type, or it is corrupted. Perhaps, "<FILE> is not a recognized GnuCash formatted file."
>>>>
>>> Tomer,
>>>
>>> Good that you sorted it. Note though that if it's gzip-compressed it's an XML file, not a sqlite3 database. Does `file` on the apparently corrupted gnucash file claim that it's a sqlite3 database?
>>>
>>> Regards,
>>> John Ralls
>>>
>>>
>> When I use the `file` command on the corrupted file, it just reports it as "data". It's a binary file, but not recognized as being in Gzip format.
> OK, it probably lost some bits from its header, and maybe some other places too. Good thing that you have backups!
>
> Regards,
> John Ralls
>
Yes, TimeMachine backups, plus GnuCash's backup files, saved the day!
Thanks again for your help,
~Tomer
--
Please do not send me sensitive information (e.g., passwords, personal details, financial/health information) via email, as it is not secure.
Please contact me to determine the best way to transfer sensitive information safely. Thank you!
More information about the gnucash-user
mailing list