Unable to load DLL 'libsodium.x64.dll' on 32 bit system

61 views
Skip to first unread message

Yogesh Jagota

unread,
Dec 13, 2017, 8:06:44 AM12/13/17
to RavenDB - 2nd generation document database
I am getting the following error at Session.Load:
System.DllNotFoundException: Unable to load DLL 'libsodium.x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Sparrow.Platform.Win32.WinSodium.X64.crypto_generichash_bytes()
   at Sparrow.Platform.Win32.WinSodium.crypto_generichash_bytes() in C:\Builds\RavenDB-4.0-RC\src\Sparrow\Platform\Win32\WinSodium.cs:line 32
   at Raven.Server.Documents.Handlers.DocumentHandler.ComputeEtagFor(List`1 documents, List`1 includes) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Handlers\DocumentHandler.cs:line 303
   at Raven.Server.Documents.Handlers.DocumentHandler.GetDocumentsById(DocumentsOperationContext context, StringValues ids, Boolean metadataOnly) in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Handlers\DocumentHandler.cs:line 178
   at Raven.Server.Documents.Handlers.DocumentHandler.Get() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Documents\Handlers\DocumentHandler.cs:line 71
   at Raven.Server.Routing.RequestRouter.<HandlePath>d__5.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Routing\RequestRouter.cs:line 107
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Raven.Server.RavenServerStartup.<RequestHandler>d__11.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\RavenServerStartup.cs:line 159

Stack Trace:
   at Raven.Client.Exceptions.ExceptionDispatcher.<Throw>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Raven.Client.Http.RequestExecutor.<HandleUnsuccessfulResponse>d__83`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Raven.Client.Http.RequestExecutor.<ExecuteAsync>d__68`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Raven.Client.Http.RequestExecutor.<ExecuteAsync>d__68`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Util.AsyncHelpers.<>c__DisplayClass2_1.<<RunSync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Raven.Client.Util.AsyncHelpers.RunSync(Func`1 task)
   at Raven.Client.Http.RequestExecutor.Execute[TResult](RavenCommand`1 command, JsonOperationContext context, CancellationToken token, SessionInfo sessionInfo)
   at Raven.Client.Documents.Session.DocumentSession.LoadInternal(String[] ids, LoadOperation operation, Stream stream)
   at Raven.Client.Documents.Session.DocumentSession.Load[T](IEnumerable`1 ids)
   at OrderManager.Data.DataAccessLayer.RavenDB.RavenDBRepository.Get[TEntity](IEnumerable`1 ids) in D:\Projects\OrderManager\OrderManager\Data\DataAccessLayer\RavenDB\RavenDBRepository.cs:line 66

As suggested in multiple locations, this means that Visual C++ Redistributable for Visual Studio 2015 needs to be installed, but the thing is it is already installed (32 bit version). The 64 bit version won't install as this is a 32 bit system. And from the error, it seems, the system requires 64 bit assemblies on the 32 bit system.

Please suggest what should be done.

Adi Avivi

unread,
Dec 13, 2017, 8:11:42 AM12/13/17
to RavenDB - 2nd generation document database
RavenDB determines if the system is a 32bits one by testing : IntPtr.Size == sizeof(int)

Can you try simple console app printing the above 2 sizes?

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hibernating Rhinos Ltd                       cid:image001.png@01CF95E2.8ED1B7D0
Avivi Adi l Core Team
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
RavenDB paving the way to "Data Made Simple"   http://ravendb.net

--
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.

Yogesh Jagota

unread,
Dec 13, 2017, 8:54:51 AM12/13/17
to RavenDB - 2nd generation document database
On my 64bit system:
Console.WriteLine("IntPtr.Size: {0}", IntPtr.Size);
Console.WriteLine("sizeof(int): {0}", sizeof(int));

Gives this result:

.Net Framework 4.7
IntPtr.Size: 4
sizeof(int): 4

.Net Core 2.0
IntPtr.Size: 8
sizeof(int): 4

So that logic used to determine a 32bit system is definitely flawed.

PS: I could not run it on the 32 bit system as it didn't had core sdk installed, but .Net Framework 4.7 returned this:
IntPtr.Size: 4
sizeof(int): 4


Iftah Ben Zaken

unread,
Dec 13, 2017, 9:01:21 AM12/13/17
to rav...@googlegroups.com
Please also add:
Environment.Is64BitProcess

Yogesh Jagota

unread,
Dec 14, 2017, 3:58:46 AM12/14/17
to RavenDB - 2nd generation document database

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 4:13:08 AM12/14/17
to ravendb
Great, so that is perfectly aligned with my expectations. IntPtr.Size = 8 means 64 bits.
You are running a 64 bits process, so we load the 64 bits libsodium. This requires the std library for C to be installed, in 64 bits mode, obviously

Hibernating Rhinos Ltd  

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


On Thu, Dec 14, 2017 at 10:58 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:

Yogesh Jagota

unread,
Dec 14, 2017, 5:00:53 AM12/14/17
to RavenDB - 2nd generation document database
I didn't get that. The issue appears on a 32 bit system, not on the 64 bit system. See the attached picture, i.e. the 32bit one, IntPtr.Size is 4 not 8. 


On Thursday, December 14, 2017 at 2:43:08 PM UTC+5:30, Oren Eini wrote:
Great, so that is perfectly aligned with my expectations. IntPtr.Size = 8 means 64 bits.
You are running a 64 bits process, so we load the 64 bits libsodium. This requires the std library for C to be installed, in 64 bits mode, obviously

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 Thu, Dec 14, 2017 at 10:58 AM, Yogesh Jagota <justj...@jagotagroup.com> wrote:

--
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.

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 5:55:19 AM12/14/17
to ravendb
What is the full error on that machine?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Yogesh Jagota

unread,
Dec 14, 2017, 6:16:16 AM12/14/17
to RavenDB - 2nd generation document database
The one I posted originally:

System.DllNotFoundException: Unable to load DLL 'libsodium.x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

It is a 32bit system, but it is looking for the 64bit version of VC++ redistributables, which cannot be installed.

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 6:23:30 AM12/14/17
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

 


Yogesh Jagota

unread,
Dec 14, 2017, 8:03:56 AM12/14/17
to RavenDB - 2nd generation document database
I understood what you are saying. What I am not understanding is why is IntPtr.Size == sizeof(int) is returning false on a 32 bit system. I will investigate more into this. Seems like it is not an issue linked with RavenDb.

Thanks.

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 8:08:23 AM12/14/17
to ravendb
There shouldn't be any way that can be the case. That is literally the meaning of 32 bits vs 64 bits.

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 Thu, Dec 14, 2017 at 3:03 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
I understood what you are saying. What I am not understanding is why is IntPtr.Size == sizeof(int) is returning false on a 32 bit system. I will investigate more into this. Seems like it is not an issue linked with RavenDb.

Thanks.

--

Yogesh Jagota

unread,
Dec 14, 2017, 8:14:27 AM12/14/17
to RavenDB - 2nd generation document database
You are absolutely right, but wmic os get osarchitecture is clearly returning 32 bits on the system as you can see in the attached screenshot. Even more surprising is the fact that both values are 4 in both core and framework. This is pretty baffling to be honest.


On Thursday, December 14, 2017 at 6:38:23 PM UTC+5:30, Oren Eini wrote:
There shouldn't be any way that can be the case. That is literally the meaning of 32 bits vs 64 bits.

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 Thu, Dec 14, 2017 at 3:03 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
I understood what you are saying. What I am not understanding is why is IntPtr.Size == sizeof(int) is returning false on a 32 bit system. I will investigate more into this. Seems like it is not an issue linked with RavenDb.

Thanks.

--
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.

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 8:50:33 AM12/14/17
to ravendb
You are running the process in 32 bits mode, probably because that is the default.
But RavenDB is configured to run in 64 bits mode if possible.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Yogesh Jagota

unread,
Dec 14, 2017, 9:37:00 AM12/14/17
to RavenDB - 2nd generation document database
Yes. The client/software is on a 32bit machine and Raven is installed on a 64 bit machine on the same network. But that shouldn't make a difference as the IntPtr.Size comparison is done at the client side, right?

Oren Eini (Ayende Rahien)

unread,
Dec 14, 2017, 9:38:00 AM12/14/17
to ravendb
The error comes from the server side, the client side has nothing to do with it 

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 Thu, Dec 14, 2017 at 4:37 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
Yes. The client/software is on a 32bit machine and Raven is installed on a 64 bit machine on the same network. But that shouldn't make a difference as the IntPtr.Size comparison is done at the client side, right?

Yogesh Jagota

unread,
Dec 15, 2017, 12:51:23 AM12/15/17
to RavenDB - 2nd generation document database
Isn't DllNotFoundException means the client cannot find the dll? And the client on 32bit also works fine. Only when I use Load with multiple ids (more than one) this error is thrown. The server and other machines which are 64bit are also working perfectly.

That's why I am surprised that the system is demanding a 64bit file on a 32bit machine. Shouldn't it use the 32bit file on a 32bit machine regardless on which arch the server is? And if can't, that means I cannot use 32bit machines if the server is on a 64bits machine?


On Thursday, December 14, 2017 at 8:08:00 PM UTC+5:30, Oren Eini wrote:
The error comes from the server side, the client side has nothing to do with it 

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 Thu, Dec 14, 2017 at 4:37 PM, Yogesh Jagota <justj...@jagotagroup.com> wrote:
Yes. The client/software is on a 32bit machine and Raven is installed on a 64 bit machine on the same network. But that shouldn't make a difference as the IntPtr.Size comparison is done at the client side, right?

--
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.

Oren Eini (Ayende Rahien)

unread,
Dec 15, 2017, 2:14:05 AM12/15/17
to ravendb
Yes, but it can also be caused because the dll couldn't be loaded.
Note that this particular error happens when we do some hashing using libsodium when computing etag for multiple docs, not related to the client at all.
If the server is 64 bits, please check that the actual file is there and that the VC++ runtime is installed
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Yogesh Jagota

unread,
Dec 15, 2017, 3:11:52 AM12/15/17
to RavenDB - 2nd generation document database
Yes. You were right. The VC++ runtime  installation had some issue as when I reinstalled it on the server, the error went away. Thanks for the help. 
Reply all
Reply to author
Forward
0 new messages