Databases not created because of ESENT errors

65 views
Skip to first unread message

Arun Noronha

unread,
Oct 22, 2014, 2:14:27 PM10/22/14
to rav...@googlegroups.com
HI 
We are occasionally getting errors creating databases in our development raven server. 
This happens maybe once a week and now it seems to be increasing ... about 2-3 times a week. 

Here is the snippet of the error log:
2014-10-22 13:54:19.3598,Raven.Database.Server.HttpServer,Warn,Failed to create database ABCDevHF,"System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Could not open transactional storage: C:\RavenDB\Databases\ABCDevHF\Data ---> Microsoft.Isam.Esent.Interop.EsentDbTimeCorruptedException: Dbtime on current page is greater than global database dbtime

It looks like this points to something regarding the ESENT engine. 
how do we go about troubleshooting or rectifying this issue.

Any insight would be greatly appreciated.

Thank you 
Arun


Oren Eini (Ayende Rahien)

unread,
Oct 23, 2014, 4:52:23 AM10/23/14
to ravendb
That happens when you create a new db?
It looks like you are trying to open an existing db, or as if you moved the data between machines

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arun Noronha

unread,
Oct 23, 2014, 9:26:44 AM10/23/14
to rav...@googlegroups.com
Sorry Ayende ...... 
Let me take a step back:
We are on build 2.5.2935

On Dev we have a process where we through automation for all databases on the raven server
1) Clear database instance 
2) Create the databases
3) Seed in some documents
4) Create indexes 

My assumption is after step 1 the it should look to raven like the database should have never existed. 
Yet we run into these issues (and this is not every time either which makes it hard to track down) 
Not sure why this is happening and I would be glad to provide you with any information.

Thank you 
Arun

Chris Marisic

unread,
Oct 23, 2014, 10:23:32 AM10/23/14
to rav...@googlegroups.com
And you need to actually explain what those steps do. For all I know step 1 involves a rag and windex.

Kijana Woodard

unread,
Oct 23, 2014, 11:31:35 AM10/23/14
to rav...@googlegroups.com
For step 1, the simplest way is to Delete the db and make sure to opt for deleting the physical files as well. Otherwise, the db will reappear with the data when the name is reused.

Arun Noronha

unread,
Oct 23, 2014, 12:50:02 PM10/23/14
to rav...@googlegroups.com
Thank you very much Kijana! 

Here is the code we use to delete the database. 
In essence we are assuming the request to delete is synchronous and are waiting for it to complete and waiting a second after that to continue. 
We also use the hard-delete option because that is what the silverlight client issues to delete the database with all data.
This seems to not work all the time though. 

using(var session = _documentStore.OpenSession()) {
var databaseCommands = _documentStore.DatabaseCommands;
var relativeUrl = "/admin/databases/" + cobrandSubdomain;

if (hardDelete) relativeUrl += "?hard-delete=true";

do {
try {
var serverClient = databaseCommands.ForSystemDatabase() as ServerClient;

Thread.Sleep(1000);

var httpJsonRequest = serverClient.CreateRequest("DELETE", relativeUrl);

Thread.Sleep(1000);

httpJsonRequest.ExecuteRequest();

Thread.Sleep(1000);

processComplete = true;
} catch (Exception ex) {
if (!(ex is IOException)) throw ex;
else Thread.Sleep(1000);
}
} while (processComplete != true);
}
return new OperationStatus {
Status = Models.Status.Success,
Message = "Successful Deletion of Database from Raven"
};


We will also look into deleting the physical files - but if we could delete it by just issuing a request to the server that would be great because we could run our utility remotely (as we currently do with our build/deploy server setup)
So maybe on our part we could try a small test of quickly issuing a create / delete loop and see if we get this to happen pretty consistently on different servers and then post the code?

Thank you again! 
Arun

Oren Eini (Ayende Rahien)

unread,
Oct 26, 2014, 3:25:52 AM10/26/14
to ravendb
This looks fine, yes. 
Assuming you are doing a hard delete, that would delete all the files. 
Is it possible that you are using custom directories for logs, system, indexes?
Reply all
Reply to author
Forward
0 new messages