when moving from Gremlin.net 3.6.1, to 3.6.2 I get a FileNotFound Exception pointing to "rootOfProject"/Gremlin.net.dll
This is happening in my startup.cs when instantiating the GremlinClient
services.AddSingleton<GremlinClient>(s =>
{
GremlinServer server = new GremlinServer(hostname: "host", port: 443, enableSsl: true, username: $"collection", password: "password"]);
var connectionPoolSettings = new ConnectionPoolSettings
{
MaxInProcessPerConnection = 32,
PoolSize = 4,
ReconnectionAttempts = 4,
ReconnectionBaseDelay = TimeSpan.FromSeconds(1)
};
var socket = new Action<ClientWebSocketOptions>(o =>
{
o.KeepAliveInterval = TimeSpan.FromSeconds(10);
});
return new GremlinClient(server, new GraphSON2MessageSerializer(), connectionPoolSettings, socket);
I have tried to copy the Gremlin.net.dll to the root folder of the project. And then it works.
I find it strange that the code is suddenly looking for the .dll at the root and not in the bin folder
----------
{
"developerMessage": "One or more errors occurred. (Could not find file 'C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Gremlin.Net.dll'.)",
"userMessage": "Server error, contact system responsible",
"code": "500",
"httpStatusCode": 500,
"exception": {
"ClassName": "System.AggregateException",
"Message": "One or more errors occurred.",
"Data": null,
"InnerException": {
"ClassName": "System.IO.FileNotFoundException",
"Message": "Could not find file 'C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Gremlin.Net.dll'.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)rn at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)rn at System.Reflection.Metadata.MetadataReader.GetAssemblyName(String assemblyFile)rn at Gremlin.Net.Process.Utils.GenerateUserAgent()rn at Gremlin.Net.Process.Utils.get_UserAgent()rn at Gremlin.Net.Driver.WebSocketConnection..ctor(IClientWebSocket client, WebSocketSettings settings)rn at Gremlin.Net.Driver.ConnectionFactory.CreateConnection()rn at Gremlin.Net.Driver.ConnectionPool.CreateNewConnectionAsync()rn at Gremlin.Net.Driver.ConnectionPool.FillPoolAsync()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2147024894,
"Source": "System.Private.CoreLib",
"WatsonBuckets": null,
"FileNotFound_FileName": "C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Gremlin.Net.dll",
"FileNotFound_FusionLog": null
},
"HelpURL": null,
"StackTraceString": " at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)rn at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)rn at Gremlin.Net.Driver.ConnectionPool.FillPoolAsync()rn at Gremlin.Net.Driver.ConnectionPool.ReplaceDeadConnectionsAsync()rn at Gremlin.Net.Process.Utils.WaitUnwrap(Task task)rn at Gremlin.Net.Driver.ConnectionPool..ctor(IConnectionFactory connectionFactory, ConnectionPoolSettings settings, ILogger`1 logger)rn at Gremlin.Net.Driver.GremlinClient..ctor(GremlinServer gremlinServer, IMessageSerializer messageSerializer, ConnectionPoolSettings connectionPoolSettings, Action`1 webSocketConfiguration, String sessionId, Boolean disableCompression, ILoggerFactory loggerFactory)rn at Equinor.Vsm.Api.Startup.<>c__DisplayClass7_0.<ConfigureServices>b__8(IServiceProvider s) in C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Startup.cs:line 205rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)rn at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)rn at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)rn at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)rn at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)rn at MediatR.Wrappers.RequestHandlerWrapperImpl`2.<>c__DisplayClass1_0.<Handle>g__Handler|0()rn at Equinor.Vsm.Api.Application.Behaviors.DiscardGraphCacheBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken) in C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Application\Behaviours\DiscardGraphCacheBehavior.cs:line 23rn at Equinor.Vsm.Api.Application.Behaviors.ValidationBehavior`2.Handle(TRequest request, RequestHandlerDelegate`1 next, CancellationToken cancellationToken)rn at Equinor.Vsm.Api.Controllers.V2.GraphController.MoveVertex(IGremlinQuerySource g, String projectId, MoveCommandDto moveCommand) in C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Controllers\V2\GraphController.cs:line 88rn at lambda_method30(Closure, Object)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()rn--- End of stack trace from previous location ---rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()rn--- End of stack trace from previous location ---rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)rn at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)rn at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)rn at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)rn at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)rn at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146233088,
"Source": "System.Private.CoreLib",
"WatsonBuckets": null,
"InnerExceptions": [
{
"ClassName": "System.IO.FileNotFoundException",
"Message": "Could not find file 'C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Gremlin.Net.dll'.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)rn at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)rn at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)rn at System.Reflection.Metadata.MetadataReader.GetAssemblyName(String assemblyFile)rn at Gremlin.Net.Process.Utils.GenerateUserAgent()rn at Gremlin.Net.Process.Utils.get_UserAgent()rn at Gremlin.Net.Driver.WebSocketConnection..ctor(IClientWebSocket client, WebSocketSettings settings)rn at Gremlin.Net.Driver.ConnectionFactory.CreateConnection()rn at Gremlin.Net.Driver.ConnectionPool.CreateNewConnectionAsync()rn at Gremlin.Net.Driver.ConnectionPool.FillPoolAsync()",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2147024894,
"Source": "System.Private.CoreLib",
"WatsonBuckets": null,
"FileNotFound_FileName": "C:\SourceEquinor\repos\mad-vsm-api\Equinor.Vsm.Api\Gremlin.Net.dll",
"FileNotFound_FusionLog": null
}
]
}
}
2
Answers
If you really need the functionality of 3.6.2 release, one way would be to add copy command inside .csproj file. This is a temporary solution while you wait for the next Gremlin version.
This issue only seems to happen for local environment, so could write something like this:
Note that you need to add the environment variable
ASPNETCORE_ENVIRONMENT: local
as well. The value you decide yourself, either it’s local, development etc.After that is done, add
Gremlin.Net.dll
file to the .gitignore, so that it is not tracked via source control.Watch https://github.com/apache/tinkerpop/pull/2005. When it gets merged, the next release will contain a fix.