Exception: Access is denied on upgrade to v3.5

97 views
Skip to first unread message

Pete

unread,
Feb 15, 2018, 10:44:06 AM2/15/18
to RavenDB - 2nd generation document database
Hi there, we recently upgraded RavenDB from 3.0.3660 to 3.5.5 in because of a bug which caused an invalid index.

Now running locally with Ctrl+F5 produces this error. If I run Visual Studio as Administrator it doesn't happen. (This isn't an acceptable workaround though.)

The [Win32Exception (0x80004005): Access is denied]
[IOException: Failed to open file storage of Win32MemoryMapPage+r]
   Voron.Platform.Win32.Win32MemoryMapPager..ctor(String file, Nullable`1 initialFileSize, Win32NativeFileAttributes options, Win32NativeFileAccess access) +900
   Voron.PureMemoryStorageEnvironmentOptions.CreateScratchPager(String name) +312
   Voron.Impl.Scratch.ScratchBufferPool.NextFile() +47
   Voron.Impl.Scratch.ScratchBufferPool..ctor(StorageEnvironment env) +231
   Voron.StorageEnvironment..ctor(StorageEnvironmentOptions options) +764
   Raven.Database.Storage.Voron.Impl.TableStorage..ctor(StorageEnvironmentOptions options, IBufferPool bufferPool) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Storage\Voron\Impl\TableStorage.cs:64
   Raven.Storage.Voron.TransactionalStorage.Initialize(IUuidGenerator generator, OrderedPartCollection`1 documentCodecs, Action`1 putResourceMarker, Action`2 onError) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Storage\Voron\TransactionalStorage.cs:447
   Raven.Database.DocumentDatabaseInitializer.InitializeTransactionalStorage(IUuidGenerator uuidGenerator, Action`2 onErrorAction) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\DocumentDatabase.cs:1504
   Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase systemDatabase, TransportState recievedTransportState, Action`2 onError) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\DocumentDatabase.cs:186
   Raven.Database.Server.RavenDBOptions..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase db) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Server\RavenDBOptions.cs:94
   Raven.Database.Server.OwinHttpServer..ctor(InMemoryRavenConfiguration config, DocumentDatabase db, Boolean useHttpServer, Action`1 configure) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Server\OwinHttpServer.cs:24
   Raven.Server.RavenDbServer.Initialize(Action`1 configure) in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Server\RavenDbServer.cs:131
   Raven.Database.Client.EmbeddedDocumentStore.Initialize() in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Client\EmbeddedDocumentStore.cs:243
   Raven.Client.Embedded.EmbeddableDocumentStore.Initialize() in C:\Builds\RavenDB-Stable-3.5\Raven.Database\Client\EmbeddableDocumentStore.cs:155
   Catalogue.Data.Test.InMemoryDatabaseHelper.Create() in C:\Work\topcat\Catalogue.Data\Test\InMemoryDatabaseHelper.cs:37
   Catalogue.Data.DatabaseFactory.InMemory(Int32 port) in C:\Work\topcat\Catalogue.Data\DatabaseFactory.cs:26
   Catalogue.Web.WebApiApplication.InitializeDataStore() in C:\Work\topcat\Catalogue.Web\Global.asax.cs:67
   Catalogue.Web.WebApiApplication.Application_Start() in C:\Work\topcat\Catalogue.Web\Global.asax.cs:28

The source code is https://github.com/jncc/topcat and should run with Visual Studio with no setup. 

Any advice appreciated.

Oren Eini (Ayende Rahien)

unread,
Feb 15, 2018, 11:16:49 AM2/15/18
to ravendb
Please check the file permissions, it looks like it fails opening the file.

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.

Pete

unread,
Feb 15, 2018, 11:25:44 AM2/15/18
to RavenDB - 2nd generation document database
Hi, file permissions of what? The intention is that this is an in-memory DB at development time. 
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Feb 15, 2018, 11:29:56 AM2/15/18
to ravendb
We still use temporary files (that are never written to disk) for various things. 
Does the user running this has access to the temp / current directory? Can you check what is the actual file that it is failing to open?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Pete

unread,
Feb 16, 2018, 6:36:56 AM2/16/18
to RavenDB - 2nd generation document database
Hi Oren, 

Sorry I don't know which directories you mean by the temp / current directories.

This is happening at dev time. The user is the logged in Windows user, I guess. I've tried on two different Windows machines. On the second it gave me an error about Voron being prone to failure in 32-bit mode; when I added AllowOn32Bits I get the same permissions error.

All we did was upgrade a minor version change. The link I gave is a full repro of this issue.  Please could you clone the repo and run it to diagnose the problem? It's just the master branch of https://github.com/jncc/topcat

Thanks,
Pete

Oren Eini (Ayende Rahien)

unread,
Feb 18, 2018, 4:10:47 PM2/18/18
to ravendb
Can you try using Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) to check what it is trying to access?
I haven't been able to reproduce this, I'm afraid.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Enzmann Christoph

unread,
Feb 19, 2018, 8:17:10 AM2/19/18
to RavenDB - 2nd generation document database
This is a bug. PureMemoryStorageEnvironmentOptions CreateScratchPager doesn't add the the tempPath to the filename.

A fix would be:

diff --git a/Raven.Voron/Voron/StorageEnvironmentOptions.cs b/Raven.Voron/Voron/StorageEnvironmentOptions.cs
index 1b04b9bce4..b19cedbe38 100644
--- a/Raven.Voron/Voron/StorageEnvironmentOptions.cs
+++ b/Raven.Voron/Voron/StorageEnvironmentOptions.cs
@@ -460,7 +460,7 @@ public override unsafe void WriteHeader(string filename, FileHeader* header)

             public override IVirtualPager CreateScratchPager(string name)
             {
-                var filename = $"ravendb-{Process.GetCurrentProcess().Id}-{_instanceId}-{name}";
+                var filename = Path.Combine(tempPath, $"ravendb-{Process.GetCurrentProcess().Id}-{_instanceId}-{name}");
                 if (RunningOnPosix)
                     return new PosixTempMemoryMapPager(filename, InitialFileSize);
                 return new Win32MemoryMapPager(filename, InitialFileSize,

Oren Eini (Ayende Rahien)

unread,
Feb 19, 2018, 2:14:16 PM2/19/18
to ravendb
Thanks, merged your fix and ensured that we don't have the same issue in 4.0
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Pete

unread,
Feb 20, 2018, 9:10:16 AM2/20/18
to RavenDB - 2nd generation document database
Thank you, are we able to get a Nuget release for this bug fix?

Oren Eini (Ayende Rahien)

unread,
Feb 20, 2018, 9:37:24 AM2/20/18
to ravendb
Yes, that should be part of our regularly scheduled patches, I think we should have one next week.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Message has been deleted

Oren Eini (Ayende Rahien)

unread,
Mar 13, 2018, 10:09:35 AM3/13/18
to ravendb

Hibernating Rhinos Ltd  

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

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

 


On Tue, Mar 13, 2018 at 4:07 PM, Peter Balzli <elias....@gmail.com> wrote:
Unfortunately, it's not yet fixed. I still have the same error in 3.5.6-patch-35253.

Failed to open file storage of Win32MemoryMapPage+
r

--IOException
   bei Voron.Platform.Win32.Win32MemoryMapPager..ctor(String file, Nullable`1 initialFileSize, Win32NativeFileAttributes options, Win32NativeFileAccess access)
   bei Voron.StorageEnvironmentOptions.PureMemoryStorageEnvironmentOptions.CreateScratchPager(String name)
   bei Voron.Impl.Scratch.ScratchBufferPool.NextFile()
   bei Voron.Impl.Scratch.ScratchBufferPool..ctor(StorageEnvironment env)
   bei Voron.StorageEnvironment..ctor(StorageEnvironmentOptions options)
   bei Raven.Database.Storage.Voron.Impl.TableStorage..ctor(StorageEnvironmentOptions options, IBufferPool bufferPool)
   bei Raven.Storage.Voron.TransactionalStorage.Initialize(IUuidGenerator generator, OrderedPartCollection`1 documentCodecs, Action`1 putResourceMarker, Action`2 onError)
   bei Raven.Database.DocumentDatabase.DocumentDatabaseInitializer.InitializeTransactionalStorage(IUuidGenerator uuidGenerator, Action`2 onErrorAction)
   bei Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase systemDatabase, TransportState recievedTransportState, Action`2 onError)
   bei Raven.Database.Server.RavenDBOptions..ctor(InMemoryRavenConfiguration configuration, DocumentDatabase db)
   bei Raven.Database.Server.OwinHttpServer..ctor(InMemoryRavenConfiguration config, DocumentDatabase db, Boolean useHttpServer, Action`1 configure)
   bei Raven.Server.RavenDbServer.Initialize(Action`1 configure)
   bei Raven.Database.Client.EmbeddedDocumentStore.Initialize()
   bei Raven.Client.Embedded.EmbeddableDocumentStore.Initialize()


Reply all
Reply to author
Forward
0 new messages