gramps database open by two gramps processes - any way to recover?

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

gramps database open by two gramps processes - any way to recover?

Deborah Bennett
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.

-degb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

enno
Op 30-12-17 om 10:16 schreef Deborah Bennett:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.
The simplest that I can think of is to ignore Gramps' advice about running any tools, and do the following:

1. Start Gramps, and close the error message about the missing environment, but don't close Gramps itself,

2. Open the family tree manager, or whatever it's called, and select the offending database,

3. When the database is selected, you may see that it is locked, or needs repair. In the latter case, you see an active repair button. Click that.

4. If the database is locked, trying to open it will generate a warning. If you click OK on that, Gramps will unlock the database, but not load it. You need to click open another time for it to load.

5. In case of repair, Gramps will use the built-in recovery tools, so you don't need to download anything.

Gramps' database is stored in ~/.gramps/grampsdb, with individual trees stored in subdirectories with hexadecimal names. These subdirectories have loads of DB files in them, and a file named name.txt, which stores the name of the tree itself.

See also:

https://gramps-project.org/wiki/index.php?title=Gramps_4.2_Wiki_Manual_-_Manage_Family_Trees#Repairing_a_damaged_Family_Tree

Regards,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by Deborah Bennett
Operating system: Ubuntu 14.04 LTS (yes I know it is old)
Gramps version: 4.0.4-1

This is a more detailed description of what happens when I try to load the database.
Start gramps.
Family Trees -> Open Recent, choose the database (Current)
It shows as locked. Break the lock, then try to load it again.

See a popup with this error message: 

Cannot open database

Gramps has detected a problem in opening the 'environment' of the underlying Berkeley database used to store this Family Tree. The most likely cause is that the database was created with an old version of the Berkeley database program, and you are now using a new version. It is quite likely that your database has not been changed by Gramps.
If possible, you should revert to your old version of Gramps and its support software; export your database to XML; close the database; then upgrade again to this version of Gramps and import the XML file in an empty Family Tree. Alternatively, it may be possible to use the Berkeley database recovery tools.

(-30973, 'BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery -- BDB1544 process-private: unable to find environment')

I do see a directory ~/.gramps/grampsdb/<hex number> with a name.txt file which has the name Current in it.

I ran db_verify on all the files in the directories under grampsdb with no errors.

-degb




On Sat, Dec 30, 2017 at 4:28 AM, Sam Manzi <[hidden email]> wrote:
>> Now when I open Gramps I receive the error message about the missing environment.

Which one? Can you provide the actual error message,operating system and version of Gramps?

Suggest you make a copy of your Gramps user directory and then on a copy attempt to follow some of the advice on the following page:

https://gramps-project.org/wiki/index.php?title=Recover_corrupted_family_tree

If none of that helps, please raise a private issue on the bug tracker.

-
Sam


On 30 December 2017 at 20:16, Deborah Bennett <[hidden email]> wrote:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.

-degb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by Deborah Bennett
Further attempts to recover the corrupted database.

db5.3_recover -c
db5.3_recover: BDB2506 file /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN 3/5735651, past end of log at 3/5609473
db5.3_recover: BDB2507 Commonly caused by moving a database from one database environment
db5.3_recover: BDB2508 to another without clearing the database LSNs, or by removing all of
db5.3_recover: BDB2509 the log files from a database environment
db5.3_recover: BDB1521 Recovery function for LSN 3 126915 failed
db5.3_recover: BDB0061 PANIC: Invalid argument
db5.3_recover: BDB1544 process-private: unable to find environment
db5.3_recover: DB_ENV->open: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery


On Sat, Dec 30, 2017 at 4:28 AM, Sam Manzi <[hidden email]> wrote:
>> Now when I open Gramps I receive the error message about the missing environment.

Which one? Can you provide the actual error message,operating system and version of Gramps?

Suggest you make a copy of your Gramps user directory and then on a copy attempt to follow some of the advice on the following page:

https://gramps-project.org/wiki/index.php?title=Recover_corrupted_family_tree

If none of that helps, please raise a private issue on the bug tracker.

-
Sam


On 30 December 2017 at 20:16, Deborah Bennett <[hidden email]> wrote:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.

-degb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by enno
Thanks for your suggestions. I did check out the manual before I wrote to the list.

As you may have seen from my replies to Sam, these steps will not work. Once I break the lock, Gramps will not load my corrupted database (fails with the missing environment message), nor does it indicate it is broken with the red mark. This problem is beyond what the Gramps built-in repair tools can handle.

On Sat, Dec 30, 2017 at 4:44 AM, Enno Borgsteede <[hidden email]> wrote:
Op 30-12-17 om 10:16 schreef Deborah Bennett:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.
The simplest that I can think of is to ignore Gramps' advice about running any tools, and do the following:

1. Start Gramps, and close the error message about the missing environment, but don't close Gramps itself,

2. Open the family tree manager, or whatever it's called, and select the offending database,

3. When the database is selected, you may see that it is locked, or needs repair. In the latter case, you see an active repair button. Click that.

4. If the database is locked, trying to open it will generate a warning. If you click OK on that, Gramps will unlock the database, but not load it. You need to click open another time for it to load.

5. In case of repair, Gramps will use the built-in recovery tools, so you don't need to download anything.

Gramps' database is stored in ~/.gramps/grampsdb, with individual trees stored in subdirectories with hexadecimal names. These subdirectories have loads of DB files in them, and a file named name.txt, which stores the name of the tree itself.

See also:

https://gramps-project.org/wiki/index.php?title=Gramps_4.2_Wiki_Manual_-_Manage_Family_Trees#Repairing_a_damaged_Family_Tree

Regards,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Nick Hall
In reply to this post by Deborah Bennett
On 30/12/17 18:21, Deborah Bennett wrote:
> Further attempts to recover the corrupted database.
>
> db5.3_recover -c
> db5.3_recover: BDB2506 file
> /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN
> 3/5735651, past end of log at 3/5609473

The most important files to recover are:

person.db
family.db
event.db
place.db
repo.db
source.db
citation.db
media.db
note.db
tag.db

These store the primary objects.

Make a file-level backup first.  Don't try to open the backup in Gramps.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by Deborah Bennett
Is it time for me to open a case on the bug tracker, and take this discussion off this list?

-degb

On Sat, Dec 30, 2017 at 10:21 AM, Deborah Bennett <[hidden email]> wrote:
Further attempts to recover the corrupted database.

db5.3_recover -c
db5.3_recover: BDB2506 file /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN 3/5735651, past end of log at 3/5609473
db5.3_recover: BDB2507 Commonly caused by moving a database from one database environment
db5.3_recover: BDB2508 to another without clearing the database LSNs, or by removing all of
db5.3_recover: BDB2509 the log files from a database environment
db5.3_recover: BDB1521 Recovery function for LSN 3 126915 failed
db5.3_recover: BDB0061 PANIC: Invalid argument
db5.3_recover: BDB1544 process-private: unable to find environment
db5.3_recover: DB_ENV->open: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery


On Sat, Dec 30, 2017 at 4:28 AM, Sam Manzi <[hidden email]> wrote:
>> Now when I open Gramps I receive the error message about the missing environment.

Which one? Can you provide the actual error message,operating system and version of Gramps?

Suggest you make a copy of your Gramps user directory and then on a copy attempt to follow some of the advice on the following page:

https://gramps-project.org/wiki/index.php?title=Recover_corrupted_family_tree

If none of that helps, please raise a private issue on the bug tracker.

-
Sam


On 30 December 2017 at 20:16, Deborah Bennett <[hidden email]> wrote:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.

-degb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by Nick Hall
Note that we always open the environment with the DB_RECOVER flag, so you will probably want to specify catastrophic recovery with the -c flag.

Yes, I have been using db_recover -c.
db_recover is not getting far enough to attempt a recoveyr - it is failing due to the LSN error. It cannot find the environment for the database so it errors out before doing any recovery.

This was in my reply to Sam which was copied to the list.

db5.3_recover -c
db5.3_recover: BDB2506 file /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN 3/5735651, past end of log at 3/5609473
db5.3_recover: BDB2507 Commonly caused by moving a database from one database environment
db5.3_recover: BDB2508 to another without clearing the database LSNs, or by removing all of
db5.3_recover: BDB2509 the log files from a database environment
db5.3_recover: BDB1521 Recovery function for LSN 3 126915 failed
db5.3_recover: BDB0061 PANIC: Invalid argument
db5.3_recover: BDB1544 process-private: unable to find environment
db5.3_recover: DB_ENV->open: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery

On Sat, Dec 30, 2017 at 11:54 AM, Nick Hall <[hidden email]> wrote:
On 30/12/17 19:15, Deborah Bennett wrote:
Is it possible to attempt to recover them using db_ commands? It appears db_recover tries to recover the whole database (not one of those files) and it fails due to the LSN error you included.

Yes.  db_recover will attempt to use the latest log files to restore the database to a consistent state.  See:

https://docs.oracle.com/cd/E17275_01/html/programmer_reference/transapp_recovery.html

Note that we always open the environment with the DB_RECOVER flag, so you will probably want to specify catastrophic recovery with the -c flag.

Failing that, the gbkp files contain backups of the important tables.

It may also be possible to open a file outside of Gramps without an environment, but I have never tried this.

Nick.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
I also attempted to recover the database to a previous timestamp. Again, it appears the recovery errors out because of the environment problem.

db_recover -v -c -t 201712292351
BDB2526 Finding last valid log LSN: file: 3 offset 5609473
db_recover: BDB2506 file /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN 3/5735651, past end of log at 3/5609473
db_recover: BDB2507 Commonly caused by moving a database from one database environment
db_recover: BDB2508 to another without clearing the database LSNs, or by removing all of
db_recover: BDB2509 the log files from a database environment
db_recover: BDB1521 Recovery function for LSN 3 126915 failed
db_recover: BDB0061 PANIC: Invalid argument
db_recover: BDB1544 process-private: unable to find environment
db_recover: DB_ENV->open: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery


On Sat, Dec 30, 2017 at 12:31 PM, Deborah Bennett <[hidden email]> wrote:
Note that we always open the environment with the DB_RECOVER flag, so you will probably want to specify catastrophic recovery with the -c flag.

Yes, I have been using db_recover -c.
db_recover is not getting far enough to attempt a recoveyr - it is failing due to the LSN error. It cannot find the environment for the database so it errors out before doing any recovery.

This was in my reply to Sam which was copied to the list.

db5.3_recover -c
db5.3_recover: BDB2506 file /home/deborah/.gramps/grampsdb/546975ca/meta_data.db has LSN 3/5735651, past end of log at 3/5609473
db5.3_recover: BDB2507 Commonly caused by moving a database from one database environment
db5.3_recover: BDB2508 to another without clearing the database LSNs, or by removing all of
db5.3_recover: BDB2509 the log files from a database environment
db5.3_recover: BDB1521 Recovery function for LSN 3 126915 failed
db5.3_recover: BDB0061 PANIC: Invalid argument
db5.3_recover: BDB1544 process-private: unable to find environment
db5.3_recover: DB_ENV->open: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery

On Sat, Dec 30, 2017 at 11:54 AM, Nick Hall <[hidden email]> wrote:
On 30/12/17 19:15, Deborah Bennett wrote:
Is it possible to attempt to recover them using db_ commands? It appears db_recover tries to recover the whole database (not one of those files) and it fails due to the LSN error you included.

Yes.  db_recover will attempt to use the latest log files to restore the database to a consistent state.  See:

https://docs.oracle.com/cd/E17275_01/html/programmer_reference/transapp_recovery.html

Note that we always open the environment with the DB_RECOVER flag, so you will probably want to specify catastrophic recovery with the -c flag.

Failing that, the gbkp files contain backups of the important tables.

It may also be possible to open a file outside of Gramps without an environment, but I have never tried this.

Nick.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

enno
In reply to this post by Nick Hall
Hello Nick,

I don't know much about BSDDB, but I'm somewhat intrigued by this
environment thing. What is it?

Reason to ask is that apparently, when Gramps creates a database, it
comes with an environment, and then users add data to it, which goes
into the DB files. Where is the environment stored, and when it gets
lost, is there a way to copy it from another database? Or is there a way
for Gramps to add an environment to a broken non empty database?

I don't know if the analogy works, but sometimes we are confronted with
errors caused by missing DLLs and things like that, and then things can
be restored by downloading one and putting it in the right folder? Would
that work for this too? Is it possible to create an empty tree, close
Gramps, and overwrite the DB files with the ones copied from the broken
tree? Or is that too primitive to work?

Regards,

Enno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
NdK
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

NdK
Il 01/01/2018 11:48, Enno Borgsteede ha scritto:

> I don't know if the analogy works, but sometimes we are confronted with
> errors caused by missing DLLs and things like that, and then things can
> be restored by downloading one and putting it in the right folder? Would
> that work for this too? Is it possible to create an empty tree, close
> Gramps, and overwrite the DB files with the ones copied from the broken
> tree? Or is that too primitive to work?
Being a Neanderthal, I tried that when it happened to me. Didn't work.
:( If it were so easy, it could be automated...

Lesson learned: since then, before closing Gramps I export to xml. Every
time I changed something during the session.

BYtE,
 Diego

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Nick Hall
In reply to this post by enno
On 01/01/18 10:48, Enno Borgsteede wrote:
> I don't know much about BSDDB, but I'm somewhat intrigued by this
> environment thing. What is it?
>

The environment handles transactions, locking, log files etc... See:

https://docs.oracle.com/cd/E17276_01/html/programmer_reference/env.html

> Reason to ask is that apparently, when Gramps creates a database, it
> comes with an environment, and then users add data to it, which goes
> into the DB files. Where is the environment stored, and when it gets
> lost, is there a way to copy it from another database? Or is there a
> way for Gramps to add an environment to a broken non empty database?

The environment has a remove method, so it should be possible to remove
a broken environment and create a new one.

>
> I don't know if the analogy works, but sometimes we are confronted
> with errors caused by missing DLLs and things like that, and then
> things can be restored by downloading one and putting it in the right
> folder? Would that work for this too? Is it possible to create an
> empty tree, close Gramps, and overwrite the DB files with the ones
> copied from the broken tree? Or is that too primitive to work?
>
If the database files have not been corrupted, it may be possible to
copy them to an empty database.  Alternatively, database files can be
opened without an environment.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Ron Johnson
In reply to this post by enno
On 01/01/2018 04:11 PM, Nick Hall wrote:

> On 01/01/18 10:48, Enno Borgsteede wrote:
>> I don't know much about BSDDB, but I'm somewhat intrigued by this
>> environment thing. What is it?
>>
>
> The environment handles transactions, locking, log files etc... See:
>
> https://docs.oracle.com/cd/E17276_01/html/programmer_reference/env.html
>
>> Reason to ask is that apparently, when Gramps creates a database, it
>> comes with an environment, and then users add data to it, which goes into
>> the DB files. Where is the environment stored, and when it gets lost, is
>> there a way to copy it from another database? Or is there a way for
>> Gramps to add an environment to a broken non empty database?
>
> The environment has a remove method, so it should be possible to remove a
> broken environment and create a new one.

How hard would it be to write such a utility?

--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Nick Hall
On 01/01/18 22:48, Ron Johnson wrote:
The environment has a remove method, so it should be possible to remove a broken environment and create a new one.

How hard would it be to write such a utility?

I'm not sure it is a good idea.  The method may even fail with a corrupt environment.

We really need the advice of a BSDDB expert.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Ron Johnson
In reply to this post by Ron Johnson
On 01/01/2018 07:29 PM, Nick Hall wrote:
On 01/01/18 22:48, Ron Johnson wrote:
The environment has a remove method, so it should be possible to remove a broken environment and create a new one.

How hard would it be to write such a utility?

I'm not sure it is a good idea.  The method may even fail with a corrupt environment.

We really need the advice of a BSDDB expert.


You aren't?

-- 
World Peace Through Nuclear Pacification

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Serge Noiraud-2
In reply to this post by enno
Le 01/01/2018 à 11:48, Enno Borgsteede a écrit :
> Hello Nick,
>
> I don't know much about BSDDB, but I'm somewhat intrigued by this environment thing. What is it?
I am not a database expert.

When you use transactions, the bsddb memorise all what is done in log files during the transaction.
This is used for a roolback during this operation. At the end of the transaction, the bsddb commit all modifications and remove the log(s).

If you start two gramps on the same database, the two processes use the same logs. You have a mixed log from the two processes.
When you stop one gramps, this process clears the logs. The second gramps continue to use them.
When you stop the second gramps, things are in a bad state.
In this case, you have a bad environnement when you try to restart gramps.
>
> Reason to ask is that apparently, when Gramps creates a database, it comes with an environment, and then users add data to it, which goes into the DB files. Where is the environment stored, and when it gets lost, is there a way to copy it from another database? Or is there a way for Gramps to add an environment to a broken non empty database?
I already tried to remove all logs and restart gramps without success.
Perhaps in this case, the bsddb recovery tool as an option for that.
>
> I don't know if the analogy works, but sometimes we are confronted with errors caused by missing DLLs and things like that, and then things can be restored by downloading one and putting it in the right folder? Would that work for this too? Is it possible to create an empty tree, close Gramps, and overwrite the DB files with the ones copied from the broken tree? Or is that too primitive to work?
I don't think it will work.
>
> Regards,
>
> Enno

Serge


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: gramps database open by two gramps processes - any way to recover?

Deborah Bennett
In reply to this post by Deborah Bennett
If none of that helps, please raise a private issue on the bug tracker.

Are there directions on how to do this?

Thanks,
-deborah

On Sat, Dec 30, 2017 at 4:28 AM, Sam Manzi <[hidden email]> wrote:
>> Now when I open Gramps I receive the error message about the missing environment.

Which one? Can you provide the actual error message,operating system and version of Gramps?

Suggest you make a copy of your Gramps user directory and then on a copy attempt to follow some of the advice on the following page:

https://gramps-project.org/wiki/index.php?title=Recover_corrupted_family_tree

If none of that helps, please raise a private issue on the bug tracker.

-
Sam


On 30 December 2017 at 20:16, Deborah Bennett <[hidden email]> wrote:
I am a former UNIX system software developer, so I consider myself a power user.

I have been working on my family tree on Gramps for the last three days. Tonight I mistakenly broke the lock on Gramps and opened a family tree which was already open. I believe I did at least one transaction on the newer window. As soon as I realized I had two copies open I closed them both. 

Now when I open Gramps I receive the error message about the missing environment.

No, I do not have any recent Gramps database backups. Yes, that was stupid of me.

Is there a way to use database repair tools to recover the database which I assume is corrupted? I am not that familiar with Berkeley DB, nor how Gramps stores its database in files.

-degb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org