should detect stale lock files

Bug #382728 reported by Jamin W. Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GnuCash
Fix Released
Wishlist
gnucash (Debian)
Confirmed
Unknown
gnucash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: gnucash

Depending on how gnucash is shut down or the user's session terminated, a previous gnucash session may not properly clean up its LCK file. When this happens, gnucash will indicate on the next startup that it can not open the account files due to the, now stale, LCK file. Rather than trying to account for all possible means of exiting/shutdown, which is an admirable goal, a fair solution would be detecting whether the LCK file is stale or not. Perhaps the process ID of the original locking process could be stored in the LCK file? Then the new instance could read the information and check for the given process? Or the original process could hold the LCK file open and the new process could check to see if there are any open file handles on it?

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia ath_hal
Package: gnucash 2.2.6-2ubuntu5
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnucash
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
In , Thomas Bushnell BSG (tb-becket) wrote : not a bug

severity 249763 wishlist
thanks

Revision history for this message
In , Irrevenant (irrevenant) wrote :

Version details: Fluxbox
Distribution/Version: Debian Sarge

1. Open GnuCash (it will load the current database).
2. Open a second instance of Gnucash.

Gnucash will come up with a screen that says (paraphrasing) "Cannot obtain a
lock for <database name>. <Quit> <Open Anyway> <Create New File>".

There's no "Open a different database option". This is a pain if you want to
open two different databases to compare them like I do.

Thanks.

Revision history for this message
In , Irrevenant (irrevenant) wrote :

It would probably be appropriate to have both an "Open" and an "Open Recent"
option (though one button could lead to a dialog that handled both).

Revision history for this message
In , Christian Stimming (stimming-deactivatedaccount) wrote :

As a workaround, you could start gnucash with the --nofile command line option...

Revision history for this message
In , Jsled (jsled) wrote :

Or just hit 'Cancel'.

Revision history for this message
In , Christian Stimming (stimming-deactivatedaccount) wrote :

(In reply to comment #3)
> Or just hit 'Cancel'.

Err, the three buttons are "Open anyway", "Create new file", and "Quit". There is no "Cancel", is there?

On gnucash-de there were more proposals:

- Either to have only two buttons, "Open anyway" and "Don't open anything" (which could just as well be labeled "Cancel"), which will result in the empty gnucash screen. Pro: In the empty gnucash screen it is totally obvious how to open a different file or a "Recently used" file or a new file or Quit gnucash. Contra: If people start to use the button "create new account" in the empty gnucash window, IIRC we run into all sorts of problems because there isn't a clearly defined new empty gnc-book. OTOH the empty gnucash window still shows up if people press "cancel" in the new file druid, so this has to be dealt with anyway.

- Or have three buttons, "Open anyway", "Open a different file", "Create new file"

Revision history for this message
In , Christian Stimming (stimming-deactivatedaccount) wrote :

*** Bug 355500 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Christian Stimming (stimming-deactivatedaccount) wrote :

To revisit this again: Which of the buttons represent a use-case that is actually really used?

- "Open anyway" - gnucash has crashed. Probably used regularly.

- "Create new file" - does anyone actually use this one here at this location?

- "Quit" - was added as a specific RFE in bug#92191 which said "most of the time, this means you accidentally opened a second copy of gnucash when one was already open".

I propose to add the button

- "Open a different file" - if you want to run two gnucash instances with a different file each.

And we should think about throwing out the button "Create new file", because I think the decision of starting a new file is seldomly made at this accidental startup dialog. Actually this used to be the option "Don't open anything", but as this in turn is even more confusing, it was replaced by "Create new file" here http://svn.gnucash.org/trac/changeset/7244 (wow, that's a long time ago).

Revision history for this message
In , Neil Williams (linux-codehelp) wrote :

I'll second the proposal to add "Open a different file" and remove "Create New File".

IMHO this would seem the best solution to the Debian bug reports too.

'--nofile' is already documented in the manpage for anyone who needs to use that option.

Revision history for this message
In , Christian Stimming (stimming-deactivatedaccount) wrote :

On IRC there was even more agreement on "Open a different file". So someone (heh) needs to implement that.

Revision history for this message
In , Neil Williams (linux-codehelp) wrote : bug 249763 is forwarded to http://bugzilla.gnome.org/show_bug.cgi?id=355500, merging 345580 249763

# Automatically generated email from bts, devscripts version 2.9.21
forwarded 249763 http://bugzilla.gnome.org/show_bug.cgi?id=355500
merge 345580 249763

Revision history for this message
In , Bts-link-upstream (bts-link-upstream) wrote : [bts-link] source package gnucash

#
# bts-link upstream status pull for source package gnucash
# see http://lists.debian.org/debian-devel-announce/2006/05/msg00001.html
#

user <email address hidden>

# remote status report for #387031
# * http://bugzilla.gnome.org/show_bug.cgi?id=355660
# * remote status changed: (?) -> NEW
usertags 387031 + status-NEW

# remote status report for #345580
# * http://bugzilla.gnome.org/show_bug.cgi?id=309943
# * remote status changed: NEW -> ASSIGNED
forwarded 345580 http://bugzilla.gnome.org/show_bug.cgi?id=355500, merged-upstream: http://bugzilla.gnome.org/show_bug.cgi?id=309943
usertags 345580 - status-NEW
usertags 345580 + status-ASSIGNED

# remote status report for #345580
# * http://bugzilla.gnome.org/show_bug.cgi?id=309943
# * remote status changed: NEW -> ASSIGNED
forwarded 345580 http://bugzilla.gnome.org/show_bug.cgi?id=355500, merged-upstream: http://bugzilla.gnome.org/show_bug.cgi?id=309943
usertags 345580 - status-NEW
usertags 345580 + status-ASSIGNED

thanks

Revision history for this message
In , Micha Lenk (micha) wrote :

Just for the records: This is still not implemented in 2.2.6.

Revision history for this message
In , Micha Lenk (micha) wrote : found 249763 in 2.2.6-1

# Automatically generated email from bts, devscripts version 2.10.29~bpo40+1
found 249763 2.2.6-1

Revision history for this message
Jamin W. Collins (jcollins) wrote :

Binary package hint: gnucash

Depending on how gnucash is shut down or the user's session terminated, a previous gnucash session may not properly clean up its LCK file. When this happens, gnucash will indicate on the next startup that it can not open the account files due to the, now stale, LCK file. Rather than trying to account for all possible means of exiting/shutdown, which is an admirable goal, a fair solution would be detecting whether the LCK file is stale or not. Perhaps the process ID of the original locking process could be stored in the LCK file? Then the new instance could read the information and check for the given process? Or the original process could hold the LCK file open and the new process could check to see if there are any open file handles on it?

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia ath_hal
Package: gnucash 2.2.6-2ubuntu5
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnucash
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
Jamin W. Collins (jcollins) wrote :
Changed in gnucash (Debian):
status: Unknown → Confirmed
Changed in gnucash:
status: Unknown → In Progress
skorasaurus (skoraw)
Changed in gnucash (Ubuntu):
status: New → Confirmed
Changed in gnucash:
importance: Unknown → Wishlist
Changed in gnucash:
status: In Progress → Expired
Revision history for this message
In , David-carlson-417 (david-carlson-417) wrote :

Ten years later release 2.6.17 this bug is still languishing. If the user finds that GnuCash is trying to open a different file than the one he wants to use, there is no option to open a different file. it might not be very convenient to start over from the command line, especially if the file is buried down a long path or even on a remote resource.

Is it so hard to add a button to open a different file?

Changed in gnucash:
status: Expired → Confirmed
Revision history for this message
In , 14ubobit (14ubobit) wrote :

I pushed a change for version 4.3 that changes the 'New File' option to 'Open with No File'. That way the main Gnucash Window will allow you to do 'File->New' to create a new file, 'File->Open' to browse for a file or use the history.

Changed in gnucash:
status: Confirmed → Fix Released
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.