kreeben / resin

Vector space index based search engine that's available as a HTTP service or as an embedded library.
MIT License
568 stars 40 forks source link

Application startup exception: System.PlatformNotSupportedException: The named version of this synchronization primitive is not supported on this platform. #57

Closed kburman closed 5 years ago

kburman commented 5 years ago

I'm getting the following error while trying to run Http server in macos.

Application startup exception: System.PlatformNotSupportedException: The named version of this synchronization primitive is not supported on this platform.
   at System.Threading.Semaphore.CreateSemaphore(Int32 initialCount, Int32 maximumCount, String name)
   at System.Threading.Semaphore..ctor(Int32 initialCount, Int32 maximumCount, String name, Boolean& createdNew)
   at Sir.Store.SessionFactory..ctor(ITokenizer tokenizer, IConfigurationProvider config) in /Users/kshitij/github/resin/src/Sir.Store/Session/SessionFactory.cs:line 36
   at Sir.Store.Start.OnApplicationStartup(IServiceCollection services, ServiceProvider serviceProvider, IConfigurationProvider config) in /Users/kshitij/github/resin/src/Sir.Store/Start.cs:line 16
   at Sir.HttpServer.ServiceConfiguration.Configure(IServiceCollection services) in /Users/kshitij/github/resin/src/Sir.HttpServer/ServiceConfiguration.cs:line 66
   at Sir.HttpServer.Startup.ConfigureServices(IServiceCollection services) in /Users/kshitij/github/resin/src/Sir.HttpServer/Startup.cs:line 26
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

Dotnet version

01:13 $ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.107
 Commit:    2212cac826

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.107/

Host (useful for support):
  Version: 2.2.5
  Commit:  0a3c9209c0

.NET Core SDKs installed:
  2.2.106 [/usr/local/share/dotnet/sdk]
  2.2.107 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

I have tried to run the server on tag v0.3a and it worked completely fine.

@kreeben - Can you please take a look at it. I have some experience working with C# and I'm ready to help if you could guide me.

And I want to thank you for making this open source.

kreeben commented 5 years ago

Thx for the error report. I will have a look.

kreeben commented 5 years ago

I read on .Net Core's issue stream here on GitHub that they had fixed named synchronization on Unix/MacOs but because you were having problems I replaced them with plain 'ol locks: https://github.com/kreeben/resin/commit/4ffa49406ec895a18b589accd4127883026071fa

Patch applied to both master and dev. Please let me know if this fixed it for you. I don't have access to a Mac ATM.

kreeben commented 5 years ago

@kburman Once you get your dev environment going then I'd be happy have you join as a contributor.

kburman commented 5 years ago

@kreeben - I will test the new commit and would let you know.

@kburman Once you get your dev environment going then I'd be happy have you join as a contributor.

Sure, Right now I'm exploring the codebase, once I get little familiar with it. Would like to contribute to the project.

kburman commented 5 years ago

I have tested the master branch, It's working fine but I'm getting some error on the dev branch.

Steps to reproduce


System.IO.InvalidDataException: Found invalid data while decoding.
   at Sir.Store.ValueIndexReader.Read(Int64 id) in /Users/kshitij/github/kburman-resin/src/Sir.Store/IO/ValueIndexReader.cs:line 51
   at Sir.Store.ReadSession.ReadDocs(IEnumerable`1 docs) in /Users/kshitij/github/kburman-resin/src/Sir.Store/Session/ReadSession.cs:line 211
   at Sir.Store.ReadSession.Read(Query query) in /Users/kshitij/github/kburman-resin/src/Sir.Store/Session/ReadSession.cs:line 66
   at Sir.Store.StoreReader.Read(String collectionName, HttpRequest request) in /Users/kshitij/github/kburman-resin/src/Sir.Store/StoreReader.cs:line 106
   at Sir.HttpServer.Controllers.SearchController.Index(String q, String collection) in /Users/kshitij/github/kburman-resin/src/Sir.HttpServer/Controllers/SearchController.cs:line 37
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)```
kreeben commented 5 years ago

Could you perhaps also give me the URL you tested with. Either way, I'll take a look ASAP.

kburman commented 5 years ago

http://coding-geek.com/how-databases-work/

kreeben commented 5 years ago

This https://github.com/kreeben/resin/commit/f596130a72d86a3d301766273bea4380200633cb fixed it for me. If you pull from dev branch you should be good.

kburman commented 5 years ago

Can confirm, It's working for me.