Gnucash accounts file gets removed when you tell Gnucash to save your changes

Bug #953621 reported by Guilherme Salgado
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Triaged
High
Ubuntu One Client Engineering team

Bug Description

I have my gnucash files in a folder synced with U1, and every time I save changes on Gnucash the main accounts file ends up removed from the server, even though it still exists locally. Once it gets into this state the only way I managed to re-upload the file was to quit the syncdaemon (u1sdtool -q) and then start it again (disconnecting/reconnecting via the control panel doesn't help). I can reproduce this all the time on Oneiric/Precise using a freshly created gnucash book.

From the syncdaemon.log (attached), it looks like that file (gnucash-test/accounts.gnucash) is being removed and re-created several times (probably because Gnucash renames the existing one and writes a new one), so I'd imagine that's what's causing it to end up removed from the server.

To reproduce this one just needs to create a new book on gnucash (following the startup wizard), save that book on a newly created directory, sync that directory on U1 and then enter a transaction into Gnucash and save it. After that the <book>.gnucash file will be removed from the server.

Tags: desktop+
Revision history for this message
Guilherme Salgado (salgado) wrote :
description: updated
John Lenton (chipaca)
Changed in ubuntuone-android-files:
importance: Undecided → High
affects: ubuntuone-android-files → ubuntuone-client
Leo Arias (elopio)
Changed in ubuntuone-client:
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
status: New → Triaged
tags: added: desktop+
Revision history for this message
Guilherme Salgado (salgado) wrote :

So, I've checked Gnucash's code and this seems to be a consequence of it using hard links, which are not supported by U1. When you hit save on Gnucash, it will:

1. create a new file (e.g. book.gnucash.tmp-xxxxxx) and writes all your data to it
2. remove the existing file (e.g. book.gnucash)
3. re-create book.gnucash as a hard-link (on OSs that support that) to book.gnucash.tmp-xxxxxx

This has already been reported, though (bug 809370), so I'm marking it as a dupe and will see if I can fix it

Revision history for this message
Guilherme Salgado (salgado) wrote :

I don't think it's going to be easy to fix bug 809370, so in the meantime I'm using a workaround which consists of touching my account.gnucash file after Gnucash exits. I've wrapped that in a script, which looks like this:

#!/bin/sh

gnucash <path-to-my-.gnucash-file>
touch <path-to-my-.gnucash-file>

Revision history for this message
Dieter Werthmuller (prisae) wrote : Re: [Bug 953621] Re: Gnucash accounts file gets removed when you tell Gnucash to save your changes

Dear Guilherme,

Thanks very much for this workaround, but even more to look into the bug
in the first place!

Very much appreciated.

Cheers,
Dieter

On 30/04/12 16:08, Guilherme Salgado wrote:
> *** This bug is a duplicate of bug 809370 ***
> https://bugs.launchpad.net/bugs/809370
>
> I don't think it's going to be easy to fix bug 809370, so in the
> meantime I'm using a workaround which consists of touching my
> account.gnucash file after Gnucash exits. I've wrapped that in a script,
> which looks like this:
>
> #!/bin/sh
>
> gnucash<path-to-my-.gnucash-file>
> touch<path-to-my-.gnucash-file>
>

Revision history for this message
flusi100 (flusi100) wrote :

I'm disappointed, because ubuntu one still is not able to handle hard links....

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.