ReplicationInformer error

234 views
Skip to first unread message

Matt Burton

unread,
Dec 15, 2012, 7:15:31 PM12/15/12
to rav...@googlegroups.com
We've been seeing a number of these errors pop up lately - mostly when the app starts up and we're creating/updating the indexes. Is this something to be concerned about or can it be safely ignored? The RavenHQ support staff suggested I post the issue here for you to take a look at.

Thanks for your help,
Matt

Client: 1.0.992
Server: RavenHQ version
Stack Trace:

Sat Dec 15 21:38:15.2936 +00:00 2012 Raven.Client.Connection.ReplicationInformer : Error, Could not persist the replication information, System.IO.IOException: The process cannot access the file 'RavenDB Replication Information For - 7C-1B-2F-D3-C1-98-BF-18-15-5D-9C-F8-47-B0-83-BA' because it is being used by another process.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath)

at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)

at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf)

at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, IsolatedStorageFile isf)

at Raven.Client.Connection.ReplicationInformer.TrySavingReplicationInformationToLocalCache(String serverHash, JsonDocument document) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ReplicationInformer.cs:line 360


Oren Eini (Ayende Rahien)

unread,
Dec 16, 2012, 8:52:05 AM12/16/12
to rav...@googlegroups.com
Do you have multiple document store startups at the same time?

Matt Burton

unread,
Dec 17, 2012, 10:55:35 AM12/17/12
to rav...@googlegroups.com
No - the document store instance is a singleton in our application.

Thanks,
Matt

Oren Eini (Ayende Rahien)

unread,
Dec 17, 2012, 11:22:25 AM12/17/12
to rav...@googlegroups.com
Can you show how you create it ?

Matt Burton

unread,
Dec 17, 2012, 12:32:53 PM12/17/12
to rav...@googlegroups.com

Sure - pretty standard stuff - register a singleton instance of IDocumentStore in Autofac:

public static class DocumentStoreFactory

{

    public static IDocumentStore CreateUsingConnectionString(string connectionStringName)

    {

        var parser = ConnectionStringParser<RavenConnectionStringOptions>.FromConnectionStringName(connectionStringName);

        parser.Parse();

        var documentStore = new DocumentStore

        {

            ApiKey = parser.ConnectionStringOptions.ApiKey,

            Url = parser.ConnectionStringOptions.Url

        };

        documentStore.Initialize();

        return documentStore;

    }

}

Container configuration:

var documentStore = DocumentStoreFactory.CreateUsingConnectionString("RavenDB");

builder.RegisterInstance(documentStore).As<IDocumentStore>().SingleInstance();

Using WebActivator the container is then initialized once after application startup.

Thanks,
Matt

John Bennett

unread,
Dec 17, 2012, 10:09:05 PM12/17/12
to rav...@googlegroups.com
Based on the mention of WebActivator, it sounds like you are hosting in IIS.  Yes?  If so, are you sure you have set "Disable Overlapped Recycle" to true for the app pool?
-JB

Matt Burton

unread,
Dec 17, 2012, 10:14:37 PM12/17/12
to rav...@googlegroups.com
Yes - we are hosting in IIS, but we're using AppHarbor so we're at the whim of their setup. I take it the issue is multiple document stores starting simultaneously causing lockups in replicated scenarios - Oren replied on another channel that the issue is fixed in a different build, so I guess we're set for the time being. Thanks for the help though, most appreciated.

- Matt

Matt Burton

unread,
Jan 31, 2013, 12:54:20 PM1/31/13
to rav...@googlegroups.com
Just wanted to follow up on this issue in case anyone else hits it. Oren's original question was spot on, and I didn't know it at the time. Due to some leftover Autofac registration code from an earlier iteration the DocumentStore was indeed being created twice - the Autofac module containing the registration for it was being registered manually in addition to being automatically registered.

Because we were also wrestling with our replication setup at the time the assumption was that the error was related to that in some way. Now that I understand what is actually going on the error message makes sense, but perhaps it could be improved to make it more idiot proof - something along the lines of "Could not persist the replication information to the local cache as the file is in use - this can occur if there is more than one DocumentStore instance in your current process" or similar.

Thanks,
Matt


On Monday, December 17, 2012 9:14:37 PM UTC-6, Matt Burton wrote:
Yes - we are hosting in IIS, but we're using AppHarbor so we're at the whim of their setup. I take it the issue is multiple document stores starting simultaneously causing lockups in replicated scenarios - Oren replied on another channel that the issue is fixed in a different build, so I guess we're set for the time being. Thanks for the help though, most appreciated.

- Matt

Ninad Goswami

unread,
Apr 24, 2017, 10:32:01 AM4/24/17
to RavenDB - 2nd generation document database
How did you fix this error we are getting the same error lately and it is critical to our business and we are not able to update/add documents randomly,

client version 2.0.03
server build 960

we do have replication setup and seems to work correct however whenever we try to run test from studio and documents getting replicated across

we get following error
Replication error :
ERROR Raven.Client.Connection.ReplicationInformer Could not persist the replication information
System.IO.IOException: The process cannot access the file 'RavenDB Replication Information For - 16-F4-C6-76-2A-BB-8D-80-C6-62-04-1E-AC-27-EE-CF' because it is being used by another process.

Please somebody help as we are not able to access and modify documents intermittently.

Thanks,
Ninad

Oren Eini (Ayende Rahien)

unread,
Apr 24, 2017, 10:45:39 AM4/24/17
to ravendb
This should have no impact on operations, it is reported, but it is handled and shouldn't have any impact.
Please create a new post with full details.

That said, please be aware that build 960 was released 5 years ago, and is no longer under support.

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Naresh Kumar

unread,
May 4, 2017, 7:00:42 AM5/4/17
to RavenDB - 2nd generation document database
Adding details code of replication error (as mentioned Ninad Goswami <ninadg...@gmail.com>)

var session = ObjectFactory.GetInstance<Cch.Data.RavenDocumentStore>();
if (session != null)

         session.Store((uint)id, data); 
         return true; 

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
May 4, 2017, 7:05:10 AM5/4/17
to ravendb
Not following here.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages