Closed roji closed 7 years ago
From @BeranekCZ on November 19, 2015 21:11
I have same problem. On Windows is everything ok but on Linux I get this exception too. I have 64b Debian and coreclr runtime.
From @bdimag on November 21, 2015 10:19
I am getting this as well on Docker (microsoft/aspnet:1.0.0-rc1-final-coreclr) after e.g., Migrate()
or EnsureDeletedAsync()
The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception.
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Could not load file or assembly 'System.Net.NetworkInformation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
From @damageboy on November 23, 2015 19:59
@bdimage Hmm, Npgsql provides the postgres inet types. As part of this it needs classes coming in from the System.Net.NetworkInformation namespace, which also comes from the System.Net.NetworkInformation nuget/dll in CoreCLR.
Let me try and recreate this with the microsoft docker image and see what System.Net.NetworkInformation.dll I have when running under that runtime + docker image
From @bdimag on November 25, 2015 3:29
@damageboy I had it working in beta8 -- same code and environment (except FROM microsoft/aspnet:1.0.0-beta8
-- but I think that was mono?). Let me know if there's anything I can provide to help.
From @sirentek on November 25, 2015 5:33
@bdimag I have some questions to you..
You had it working in beta8 ? Does your project run without any exception ?
Could you provide your project.json file for the versions you have used ? Do you use coreclr final rc1 as runtime? Which feeds do you use ? Nuget.org only ?
From @bdimag on November 25, 2015 8:0
project.txt FROM microsoft/aspnet:1.0.0-rc1-final-coreclr
(coreclr -- more info) -- Nuget.org only
Will have to try and recreate for beta8 -- that is lost.
From @bdimag on November 26, 2015 3:25
@sirentek
project8.txt FROM microsoft/aspnet:1.0.0-beta8
(mono -- more info) -- Nuget.org only
No exceptions, creates a db, table and record
From @sirentek on November 28, 2015 9:43
@bdimag
Hi Brian, I had it working in beta8 using mono-runtime too. But I didn't use docker.
Thanks for the answers. It helped me a lot!
From @barhun on December 6, 2015 1:28
It was working in beta8, regardless of the runtime (running successfully on both mono and coreclr). After switching the version of the runtime to rc1-final or to rc1-update1 and using the nuget packages EntityFramework7.Npgsql rc1-final-1 or rc1-final-2, there have occurred issues dependent on the runtime.
When using coreclr, the stack trace is as follows:
web_1 | Application startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.TypeInitializationException: The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
web_1 | at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
web_1 | at System.Reflection.Assembly.GetTypes()
web_1 | at Npgsql.TypeHandlerRegistry..cctor()
web_1 | --- End of inner exception stack trace ---
web_1 | at Microsoft.Data.Entity.Storage.Internal.NpgsqlTypeMapper..ctor()
web_1 | --- End of stack trace from previous location where exception was thrown ---
Using mono runtime, it relates to some native call:
web_1 | Application startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.InvalidCastException: Cannot cast from source type to destination type.
web_1 | at Npgsql.TypeHandlerRegistry.get_GlobalCompositeMappings () [0x00000] in <filename unknown>:0
web_1 | at Microsoft.Data.Entity.Storage.Internal.NpgsqlTypeMapper..ctor () [0x00000] in <filename unknown>:0
web_1 | at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
web_1 | at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
web_1 | --- End of stack trace from previous location where exception was thrown ---
From @kpocza on December 6, 2015 12:20
I was facing the same Mono (v. 4.2.1) issue in Npgsql that @barhun mentioned.
It seems to me that ConcurrentDictionary on Mono cannot be cast to IReadOnlyDictionary this way:
internal static IReadOnlyDictionary<string, TypeHandler> GlobalCompositeMappings
=> (IReadOnlyDictionary<string, TypeHandler>)_globalCompositeMappings;
As workaround I've changed these lines to the following:
internal static IReadOnlyDictionary<string, TypeHandler> GlobalCompositeMappings
=> _globalCompositeMappings.ToDictionary(a => a.Key, a => a.Value);
If I compile Entityframework7.Npgsql from source against the Npgsql code changed according to the above it works on Mono, too. However I wouldn't submit a pull request for this since I'm not familiar with the internals of Npgsql and ToDictionary may introduce performance penalties. Moreover GlobalEnumMappings may be also affected this way.
From @saxx on December 6, 2015 18:42
Seems to be the same problem as discussed in https://github.com/npgsql/npgsql/issues/875 (mono 4.2 using reference source < 4.6, where there the cast to IReadonlyDictionary
is invalid, it works mono >= 4.3).
@roji Would it be a dreadfully bad idea to change the code as shown above by @kpocza? Or maybe change the cast from IReadonlyDictionary
to IDictionary
? Or would that be too much of a perf impact? As far as I understand, this should fix the mono 4.2 problem and still work in mono 4.3? I could make a PR if you want, but I'm not familiar enough with either npgsql or mono to have an idea of any possible side effects?
@saxx and @kpocza, calling ToDictionary on every call to GlobalCompositeMappings does seem like a bad idea performance-wise.
However, there's no reason no to simply switch to IDictionary, instead of using IReadOnlyDictionary. I used the latter mostly as a defensive precautionary measure. I've just pushed a commit to use IDictionary instead, and will probably release alpha6 tomorrow (have some other pending things).
Npgsql 3.1.0-alpha6 pushed to nuget, please test and confirm the problem goes away
From @Praecursor210 on December 8, 2015 3:14
@roji I have this error on Linux (mono) and Windows (coreclr) with Npgsql 3.1.0-alpha6:
System.MissingMethodException: Method 'TypeHandlerRegistry.get_GlobalCompositeMappings' not found.
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) <0xb55ae8f0 + 0x00041> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb53e71d0 + 0x00035> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CreateInstanceCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb1cfb130 + 0x000d3> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+ScopedCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb2334228 + 0x00072> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+SingletonCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb23341f8 + 0x0001b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+<>c__DisplayClass12_0.<RealizeService>b__0 (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb23340d0 + 0x000f2> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) <0xb23329f8 + 0x0004b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService (IServiceProvider provider, System.Type serviceType) <0xb213a740 + 0x00033> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T] (IServiceProvider provider) <0xb213a6a8 + 0x0002f> in <filename unknown>:0
at Microsoft.Data.Entity.Storage.DatabaseProviderServices.GetService[TService] () <0xb1d020b0 + 0x00037> in <filename unknown>:0
at Microsoft.Data.Entity.Storage.Internal.NpgsqlDatabaseProviderServices.get_TypeMapper () <0xb1d024f8 + 0x00018> in <filename unknown>:0
at Microsoft.Data.Entity.Infrastructure.RelationalEntityFrameworkServicesBuilderExtensions+<>c.<AddRelational>b__0_11 (IServiceProvider p) <0xb1d023a0 + 0x00020> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryService.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb213abe0 + 0x00022> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+ScopedCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb2334228 + 0x00072> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb1cfafb8 + 0x00065> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+ScopedCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb2334228 + 0x00072> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+<>c__DisplayClass12_0.<RealizeService>b__0 (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb23340d0 + 0x000f2> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) <0xb23329f8 + 0x0004b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService (IServiceProvider provider, System.Type serviceType) <0xb213a740 + 0x00033> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T] (IServiceProvider provider) <0xb213a6a8 + 0x0002f> in <filename unknown>:0
at Microsoft.Data.Entity.Storage.DatabaseProviderServices.GetService[TService] () <0xb1d020b0 + 0x00037> in <filename unknown>:0
at Microsoft.Data.Entity.Storage.Internal.NpgsqlDatabaseProviderServices.get_ConventionSetBuilder () <0xb1d02370 + 0x00018> in <filename unknown>:0
at Microsoft.Data.Entity.Internal.DbContextServices.CreateModel () <0xb1d01f68 + 0x00064> in <filename unknown>:0
at Microsoft.Data.Entity.Internal.LazyRef`1[T].get_Value () <0xb4e07480 + 0x00025> in <filename unknown>:0
at Microsoft.Data.Entity.Internal.DbContextServices.get_Model () <0xb1d01ef8 + 0x00043> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions+<>c.<AddEntityFramework>b__0_5 (IServiceProvider p) <0xb1d01ed0 + 0x00020> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryService.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb213abe0 + 0x00022> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+ScopedCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb2334228 + 0x00072> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+<>c__DisplayClass12_0.<RealizeService>b__0 (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb23340d0 + 0x000f2> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) <0xb23329f8 + 0x0004b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetService[T] (IServiceProvider provider) <0xb1d01da8 + 0x00033> in <filename unknown>:0
at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder+<>c__DisplayClass7_0.<ConfigureContextServices>b__8 (IServiceProvider _) <0xb1d01ea0 + 0x0001b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryService.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb213abe0 + 0x00022> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+TransientCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb213ab08 + 0x00020> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb1cfafb8 + 0x00065> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+TransientCallSite.Invoke (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb213ab08 + 0x00020> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider+<>c__DisplayClass12_0.<RealizeService>b__0 (Microsoft.Extensions.DependencyInjection.ServiceProvider provider) <0xb23340d0 + 0x000f2> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) <0xb23329f8 + 0x0004b> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService (IServiceProvider provider, System.Type serviceType) <0xb213a740 + 0x00033> in <filename unknown>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T] (IServiceProvider provider) <0xb213a6a8 + 0x0002f> in <filename unknown>:0
at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration (System.String name, System.String outputDir, System.String contextType) <0xb2137670 + 0x000db> in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor+<>c__DisplayClass6_0.<AddMigration>b__0 () <0xb4e073f0 + 0x0003e> in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor.Execute (System.Action action) <0xb4e07370 + 0x0001c> in <filename unknown>:0
Method 'TypeHandlerRegistry.get_GlobalCompositeMappings' not found.
From @saxx on December 8, 2015 11:25
@Praecursor210 Please see the end of https://github.com/npgsql/npgsql/issues/875 - should be the same error, @roji is already working on an updated EntityFramework7 NuGet package :)
Have just published EntityFramework7.Npgsql 3.1.0-rc1-3 which should work well with Npgsql 3.1.0-alpha6, removing the usage of IReadOnlyDictionary. Please test and let me know how it goes.
From @Praecursor210 on December 9, 2015 17:41
It's works fine on Windows (coreclr) and on Linux with Mono. I have one last problem, this exception when I try to add a Migration on Linux with coreclr:
System.TypeInitializationException: The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Npgsql.TypeHandlerRegistry..cctor()
--- End of inner exception stack trace ---
at Microsoft.Data.Entity.Storage.Internal.NpgsqlTypeMapper..ctor()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CreateInstanceCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Data.Entity.Internal.DbContextServices.CreateModel()
at Microsoft.Data.Entity.Internal.LazyRef`1.get_Value()
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.Data.Entity.Commands.Program.Executor.<>c__DisplayClass6_0.<AddMigration>b__0()
at Microsoft.Data.Entity.Commands.Program.Executor.Execute(Action action)
The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception.
From @cgarciae on December 11, 2015 22:59
Same problem
An unhandled exception occurred while processing the request. MissingMethodException: Method 'TypeHandlerRegistry.get_GlobalCompositeMappings' not found.
On Docker running on cgarciae/aspnet:1.0.0-rc1-update1-mono-4.3.0.2050
which is the same as microsoft/aspnet:1.0.0-rc1-update1
just that is based on sunside/mono:4.3.0.2050
instead of mono:4.0.1
From @snissim on December 14, 2015 18:9
Yeah, I'm still having the same issue on alpha6 running coreclr on Linux (not mono). I found this linux port of System.Net.NetworkInformation. Might that help? https://www.nuget.org/packages/runtime.linux.System.Net.NetworkInformation/
Promise to take a look at this as soon as I can...
Have produced a more precise repro and have opened https://github.com/aspnet/dnx/issues/3262. This is definitely weird and seems like a DNX/CoreCLR issue on Linux, let's wait and see.
From @snissim on January 4, 2016 4:14
So obviously running Npgsql on Linux is still uncharted territory, but I was able to get past the TypeHandlerRegistry
issue as demonstrated here: https://github.com/aspnet/dnx/issues/3262.
Now that I'm over that hurdle, I'm getting a timeout exception on any query. This works fine in Windows, and I'm able to psql via the postgres docker container without any issues. I tried upping the Timeout to 30 seconds in the connection string to no avail. The strange thing is, it errors out in well under 30 seconds (or even the default 15 seconds).
Full stack trace:
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---
> System.AggregateException: One or more errors occurred. ---> System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionIntercept
or.<MoveNext>d__5.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or
more errors occurred. ---> System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.TimeoutException: The oper
ation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()<---
<---
<---
01/04/2016 04:08:39 +00:00 [Error] An unhandled exception has occurred: One or more errors occurred.
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---
> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. -
--> System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionIntercept
or.<MoveNext>d__5.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNet.Identity.UserValidator`1.<ValidateUserName>d__6.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 Microsoft.AspNet.Identity.UserValidator`1.<ValidateAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.AspNet.Identity.UserManager`1.<ValidateUserInternal>d__149.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 Microsoft.AspNet.Identity.UserManager`1.<CreateAsync>d__63.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 Microsoft.AspNet.Identity.UserManager`1.<CreateAsync>d__68.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`1.GetResult()
at JamisonWeb.Api.Controllers.AccountController.<Register>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 Microsoft.AspNet.Mvc.Controllers.ControllerActionExecutor.<CastToObject>d__8`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 Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker.<InvokeActionAsync>d__6.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 Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeActionFilterAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Mvc.Controllers.FilterActionInvoker.<InvokeAsync>d__44.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 Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler.<RouteAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.AspNet.Mvc.Routing.InnerAttributeRoute.<RouteAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.AspNet.Routing.RouteCollection.<RouteAsync>d__9.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 Microsoft.AspNet.Builder.RouterMiddleware.<Invoke>d__4.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 Microsoft.AspNet.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.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 Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.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 Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.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 Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.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 Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.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 Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNet.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.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 Microsoft.AspNet.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or
more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.TimeoutException: The op
eration has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionIntercept
or.<MoveNext>d__5.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or
more errors occurred. ---> System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Data.Entity.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.TimeoutException: The oper
ation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.TimeoutException: The operation has timed out.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection)
at Npgsql.NpgsqlConnection.<OpenInternalAsync>d__0.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 Npgsql.NpgsqlConnection.<OpenAsync>d__34.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 Microsoft.Data.Entity.Storage.RelationalConnection.<OpenAsync>d__32.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 Microsoft.Data.Entity.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext()<---
<---
<---
<---
01/04/2016 04:08:39 +00:00 [Information] Request finished in 0.5259ms 500 application/json
From @thmulvany on January 5, 2016 7:54
Yep @snissim, this is exactly where I am. I added everything anyone recommended in : aspnet/dnx#3262 including:
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.NetworkInformation": "4.1.0-beta-23516",
"runtime.linux.System.Net.NetworkInformation": "4.1.0-beta-23516",
"runtime.unix.System.Net.Security": "4.0.0-beta-23516",
"Microsoft.NETCore.Platforms": "1.0.1-beta-23516"
I am running rc1 update 1 on ubuntu linux. My code is a super simple web api that just queries a postgres instance (that works fine on windows) but when that same code is deployed (in a docker container) onto ubuntu and tries to connect to the same DB (which I verified is accessible from inside the running container by apt-getting postgres-client and using psql to run the same query) I get this error logged out directly after it logs "Opening connection 'Host=..." :
fail: Microsoft.Data.Entity.Query.Internal.NpgsqlQueryCompilationContextFactory[1]
An exception occurred in the database while iterating the results of a query.
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurre
d. ---> System.AggregateException: One or more errors occurred. ---> System.TimeoutException: The operation has timed ou
t.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
My project lock contains these NPGSQL entries:
"EntityFramework7.Npgsql/3.1.0-rc1-3": {
"type": "package",
"dependencies": {
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.Relational": "7.0.0-rc1-final",
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc1-final",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final",
"Npgsql": "3.1.0-alpha6"
},
"compile": {
"lib/dnxcore50/EntityFramework7.Npgsql.dll": {}
},
"runtime": {
"lib/dnxcore50/EntityFramework7.Npgsql.dll": {}
}
},
...
"Npgsql/3.1.0-alpha6": {
"type": "package",
"dependencies": {
"System.Collections.Concurrent": "4.0.11-beta-23516",
"System.ComponentModel": "4.0.1-beta-23516",
"System.ComponentModel.TypeConverter": "4.0.1-beta-23516",
"System.Console": "4.0.0-beta-23516",
"System.Data.Common": "4.0.1-beta-23516",
"System.Diagnostics.Contracts": "4.0.1-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.Globalization.Extensions": "4.0.1-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516",
"System.Net.NetworkInformation": "4.1.0-beta-23516",
"System.Net.Primitives": "4.0.11-beta-23516",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.Sockets": "4.1.0-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.TypeExtensions": "4.0.1-beta-23409",
"System.Runtime": "4.0.21-beta-23516",
"System.Runtime.Extensions": "4.0.11-beta-23516",
"System.Runtime.InteropServices": "4.0.21-beta-23516",
"System.Runtime.Numerics": "4.0.1-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.Primitives": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Security.Principal": "4.0.1-beta-23516",
"System.Text.Encoding.Extensions": "4.0.11-beta-23516",
"System.Text.RegularExpressions": "4.0.11-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516"
},
"compile": {
"lib/dnxcore50/Npgsql.dll": {}
},
"runtime": {
"lib/dnxcore50/Npgsql.dll": {}
}
},
From @Banashek on January 24, 2016 19:24
Also currently getting a similar error.
Have 2 docker containers on a coreos host, one aspnet5 app and one postgres server.
Aspnet5 app is using rc1-update1-coreclr with the latest npgsql
When attempting to run the migration from one container to the other, I receive the following stack:
root@bd963176dd4d:/app# dnx ef database update
System.TypeInitializationException: The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Npgsql.TypeHandlerRegistry..cctor()
--- End of inner exception stack trace ---
at Microsoft.Data.Entity.Storage.Internal.NpgsqlTypeMapper..ctor()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CreateInstanceCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Data.Entity.Design.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.Data.Entity.Commands.Program.Executor.Execute(Action action)
The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception.
From @blacky-i on January 24, 2016 19:39
Do not know how but migrations are working fine for me. But I'm running local. Without Docker.
mono v 4.3.3 NIghtly Postgres 9.4
project was created via yeoman
From @Banashek on January 24, 2016 21:58
@blacky-i
What operating system are you on?
I attempted to use mono on my coreos/docker setup but instead get different errors:
System.TypeLoadException: Could not load type 'Microsoft.Data.Entity.Scaffolding.NpgsqlDesignTimeServices, EntityFramework7.Npgsql.Design'.
at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.ConfigureProviderServices (System.String provider, IServiceCollection services, Boolean throwOnError) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Design.Internal.DesignTimeServicesBuilder.Build (Microsoft.Data.Entity.DbContext context) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Design.MigrationsOperations.UpdateDatabase (System.String targetMigration, System.String contextType) [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor+<>c__DisplayClass7_0.<UpdateDatabase>b__0 () [0x00000] in <filename unknown>:0
at Microsoft.Data.Entity.Commands.Program+Executor.Execute (System.Action action) [0x00000] in <filename unknown>:0
Could not load type 'Microsoft.Data.Entity.Scaffolding.NpgsqlDesignTimeServices, EntityFramework7.Npgsql.Design'.
This looks like a different error however.
Is switching the runtime the only way to fix the type initialization error at the moment?
From @blacky-i on January 25, 2016 10:55
@Banashek it seems like you forgot to add dependency
"EntityFramework7.Npgsql.Design" :"3.1.0-rc1-5"
to your project.json file.
OS - kubuntu 15.10 My full project.json:
{
"version": "1.0.0-*",
"userSecretsId": "aspnet5-server-a720a4dd-92fb-4c89-8989-dcf7a8ee248a",
"compilationOptions": {
"emitEntryPoint": true
},
"tooling": {
"defaultNamespace": "server"
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.Relational": "7.0.0-rc1-final",
"EntityFramework7.Npgsql": "3.1.0-rc1-3",
"EntityFramework.Relational.Design" : "7.0.0-rc1-final",
"EntityFramework7.Npgsql.Design" :"3.1.0-rc1-5",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.NetworkInformation": "4.1.0-beta-23516",
"runtime.linux.System.Net.NetworkInformation": "4.1.0-beta-23516",
"runtime.unix.System.Net.Security": "4.0.0-beta-23516",
"Microsoft.NETCore.Platforms": "1.0.1-beta-23516",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Dnx.Runtime":"1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls http://*:5004",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [
"npm install",
"bower install",
"gulp clean",
"gulp min"
]
}
}
From @Banashek on January 25, 2016 18:59
@blacky-i
Derp yeah that worked.
So yeah now on coreos between docker containers that are properly networked, the migrations are working successfully.
On coreclr still experiencing the TypeHandlerRegistry exception.
So it seems to be an issue with the coreclr version of the dnx only then?
From @efdee on February 11, 2016 21:47
Any progress on a fix for coreclr?
Sorry, am going to be extremely busy in the next two months and it'll be unlikely I can get around to fixing this. I'll definitely be back focusing on Npgsql after that though.
From @matthewvalimaki on April 1, 2016 12:59
For those on Linux container using coreclr getting connection timeout see https://github.com/dotnet/corefx/issues/4631#issuecomment-165521190.
After adding extra dependencies mentioned here and applying binary from the comment above things started working for me.
From @NinoFloris on April 21, 2016 0:53
I also have this with dapper, I'm at bleeding edge dotnet cli and netstandard monikers
System.TypeInitializationException: The type initializer for 'Npgsql.TypeHandlerRegistry' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Npgsql.TypeHandlerRegistry..cctor()
--- End of inner exception stack trace ---
at Npgsql.NpgsqlParameter.set_DbType(DbType value)
at ParamInfo4fb977ab-d2b7-45e1-afec-2a38bc58ea3f(DbCommand , Object )
at Dapper.CommandDefinition.SetupCommand(DbConnection cnn, Action`2 paramReader)
at Dapper.SqlMapper.<QueryImpl>d__124`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Dapper.SqlMapper.Query[T](DbConnection cnn, String sql, Object param, DbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType)
Closing old issues - this should be fine on newer .NET Core. Please open a new issue if you're still seeing problems.
From @Praecursor210 on November 19, 2015 20:22
I'm currently trying EntityFramework7 rc1-1. I have no problem on Windows but I have this exception on Linux with coreclr when I try to add a migration.
Copied from original issue: npgsql/npgsql#876