Database Locked - use force-unlock option.
Got this message trying to open my Tree…how/where do I find the “force-unlock” option ?
I have read the Gramps 5.0 Wiki Manual - Manage Family Trees - Gramps
But I do not get ANY of those screen print examples, the Tree is not shown in the startup Manage Family Trees (thus no status) and when I open via the “Open latest” I get the Locked Database message.
Gramps i not running twice, that is checked.
Using version 5.2.4 in Windows 11 - Gramps in Danish version
hopefully somebody can help, please !
When you see the error window with the text “database locked”, you just click [Close]. Then a window with a list of trees (“Slægtsbøger” if you’re running Gramps in Danish).
Select the line that are marked with a lock in the “Status” column, and click [Open] ([Indlæs slægtsbog] in Danish). You will then get a pop-up window with text explaining the status.
Click the button [Remove lock] ([Fjern lås]). You can now open the database.
This is important: the recent-files-gramps.xml
in your Gramps User Directory only stores the last few databases that were opened. You do not want to do a lot of experiments before saving a copy of that file. You could lose track of the Tree that is locked. (Make copies of your recent-files-gramps.xml
and gramps.ini
files and reply with the contents of the recent-files-gramps.xml
file.)
Regarding the documentation page you mentioned: whenever your Google searching finds a wiki page that has a different major version in the URL, change it to your version to match your version. (You are using a 5.2.x version but the URL says Gramps_5.
0_Wiki_Manual
… so change that to Gramps_5.
2_Wiki_Manual
) There may be more information for your version.
https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Manage_Family_Trees#Unlocking_a_Family_Tree
Next, from that dialog, I am guessing that you had opened the tree in Gramps using a command line interface.
And your Preferences has a different Database path
from the path used in your CLI (command line interface). The “Open latest” remembers that CLI path … but the “Manage Family Trees” GUI will not.
So you either want to change Preference to the path for the CLI path file or consolidate the CLI Tree’s folder into the Database folder to where your Preferences (
Database sti
) are set.
@csam the Wiki does not have dansk translation of the Preferences page. Could you post a screen capture of the Danish Family Tree tab of Preferences?
@MariannJD
Clearing the lock
is the easy part of this problem. That is just finding the lock
file in the tree folder and renaming it. (I prefer rename
over delete
. It is easier to undo.)
The force-unlock (in the Manage Family Trees dialog) simply deletes that lock file.
The lock is automatically deleted when Gramps is closed normally. So either your Gramps crashed or you forced an exit. (If you started Gramps from the CLI, my guess is that you closed the CLI window while Gramps was still running.)
@csam and @emyoulation - thanks for your input. I did actually change the database path…stupid of me!
Preferences:
3/3
should I change the Database path in the Preference settings to this path C:Users\MD\AppData\Local\gramps\grampsdb ?
screenshot from the gramps.ini file:
thanks
/mariann
Your next step depends on how your OS is configured…
If your “Documents” folder is part of your MS Windows automated backup, it probably makes more sense to move the currently orphaned grampsdb
folder into “Documents/Familien Jenson”, then move any other folders in Familien Jenson
that are named with an 8 character hexadecimal foldername into that grampsdb
, and set the Database path in preferences to that new location.
But if you are NOT using an automated OS backup, then that is too fragile for few benefits. (Anytime you flush the gramps.ini
, the path will revert and you’ll need to set the path again. And Tech Support is harder if you don’t remind us of a non-standard database path.) In that case, I would move any stranded Tree database folders to the default database path.
After the Database path points to the right folder, that missing Tree will re-appear in the Manage Family Trees dialog with the lock in the Status column. Double clicking the row will offer the option to break the lock.
(You could break the lock manually from Windows, but it is generally better to use the GUI… there are more safeties built into the GUI.)
Since you have tweaked paths, you definitely want to check the recent-files-gramps.xml
too. The <Path>
for each <Recent Item>
will tell you if any of the last 10 trees has been stranded in another folder.
For example, the last 10 trees in my Linux OS for User districtsupport
were all from a disable
test subfolder:
<?xml version="1.0" encoding="utf-8"?>
<RecentFiles>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/5f261f52]]></Path>
<Name><![CDATA[Royals]]></Name>
<Timestamp>1740973459</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/67c482d9]]></Path>
<Name><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/67c482d9]]></Name>
<Timestamp>1740931801</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/648d07bc]]></Path>
<Name><![CDATA[Mercer2023]]></Name>
<Timestamp>1741484946</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/64f6893a]]></Path>
<Name><![CDATA[Example52]]></Name>
<Timestamp>1741461881</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/663ad237]]></Path>
<Name><![CDATA[Cluster]]></Name>
<Timestamp>1740085797</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/61f41273]]></Path>
<Name><![CDATA[_GrampsContacts]]></Name>
<Timestamp>1741399476</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/627aa799]]></Path>
<Name><![CDATA[_McCullough_2022_04_Jan28edits_]]></Name>
<Timestamp>1741497933</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/67a3bf51]]></Path>
<Name><![CDATA[France]]></Name>
<Timestamp>1739902187</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/668b6dc7]]></Path>
<Name><![CDATA[Example]]></Name>
<Timestamp>1740241871</Timestamp>
</RecentItem>
<RecentItem>
<Path><![CDATA[/home/districtsupport/.gramps/disable/grampsdb/64432098]]></Path>
<Name><![CDATA[Ferree2023]]></Name>
<Timestamp>1740877112</Timestamp>
</RecentItem>
</RecentFiles>
I do not have any automated backup for the “Documents” folder, so now I have changed the preferred database path back to C:\Users\MD\AppData\Local\gramps\grampsdb\6793937b, and I have changed the path in the gramps.ini acordingly.
After this I see my Tree in the “Manage Family Trees” and I could unlock the database.
Thank You for your detailed support !!
ditto - I was using this great program - then the battery caused the laptop to die; since then I cannot use Gramps - it does open but states locked; & won’t unlock. How can I continue to use this lovely program, not lose my data, &/or how can I collect the data to place in a new version without loss of data? Please respond in baby steps for this non-computer expert oldie.
When you say that it “won’t unlock”, are you saying that padlock remains after you use the Break Lock button after double-clicking the Tree in the Family Tree Manager? (As shown below.)
Or are you referring to this dialog when restarting Gramps after the unexpected battery shutdown?
You should be using the Family Tree Manager to break the lock.
The process is covered in the “Unlocking a Family Tree” section of the wiki.
Thank you for replying.
I’ve gone to that break lock button, I’ve gone to that tree manager button - this new laptop refuses to allow me to click on these buttons or refuses to accept this program - all I see is it’s locked ;-(
and I don’t know how to unlock it, & I’m afraid to download the latest version for fear my information won’t be accepted &/or completed accepted.
I’m so frustratedly confused,
Let’s do a manual lock break then.
(To simulate your problem for screen captures, I just started gramps, loaded my “Example52” tree and killed the gramps task. This abnormal exit caused a Lock to be left behind.)
Select your locked file in the Family Trees → Manage Family Trees… dialog and click the Info button:
This will tell you the exact path to the database folder for that Tree. (My database path is very unusual because it is a testing box. The really important part is the final 8 characters because the folder has a “hexadecimal” filename that is hard to remember. In the Example52 tree example, the foldername is
64f6893a
) Navigate to that folder in your OS then leave the folder open but quit Gramps.
Delete the lock
file (This screen capture is from the Files Manager in Fedora Linux. A macOS file manager will have a somewhat different appearance.)
Restarting Gramps should now allow the Tree to load.
Once your tree loads again:
Make a Backup immediately.
Then use the Tools → Family Tree Repair → Check and Repair Database… tool to fix any damage that might be related to the unexpected power-down.