-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sqlite]Error on database update command #3573
Comments
This is a problem with https://github.com/aspnet/microsoft.data.sqlite. It appears the library is attempting to load the wrong bitness (x86 vs x64) |
@natemcmaster I definitively see the DNX package loader in the exception above, so this could be an issue @moozzyk's code. |
cc @muratg |
Might be related to the package layout. We create a lookup table where the lib name without the extension is the key and the path is the value. CoreClr calls us when they need to load a native lib and we resolve the path using the lookup above and have them load the lib from the path (this way we don't need to worry about loading native libs on different platforms). |
https://gist.github.com/Codenator81/c6f3634a7d6bc79d0896 my project.lock.json file if it helps |
I find problem.
to
everithing works good. I change this in all lock file where sqlite mentioned))) My dnx: dnx-coreclr-win-x64.1.0.0-rc2-16062 Update:
to
works as well. |
On linux: fail: Microsoft.Data.Entity.Query.Internal.QueryCompiler[1]
An exception occurred in the database while iterating the results of a query.
System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(IntPtr filename, Sqlite3Handle& ppDb, Int32 flags, IntPtr vfs)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(String filename, Sqlite3Handle& ppDb, Int32 flags, String vfs)
at Microsoft.Data.Sqlite.SqliteConnection.Open()
at Microsoft.Data.Entity.Storage.RelationalConnection.Open()
at Microsoft.Data.Entity.Storage.Internal.SqliteRelationalConnection.Open()
at Microsoft.Data.Entity.Query.Internal.QueryingEnumerable.Enumerator.MoveNext()
at Microsoft.Data.Entity.Query.QueryMethodProvider.GetResult[TResult](IEnumerable`1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.Data.Entity.Query.Internal.QueryCompiler.<>c__DisplayClass18_1`1.<CompileQuery>b__1(QueryContext qc)
Application startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(IntPtr filename, Sqlite3Handle& ppDb, Int32 flags, IntPtr vfs)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(String filename, Sqlite3Handle& ppDb, Int32 flags, String vfs)
at Microsoft.Data.Sqlite.SqliteConnection.Open()
at Microsoft.Data.Entity.Storage.RelationalConnection.Open()
at Microsoft.Data.Entity.Storage.Internal.SqliteRelationalConnection.Open()
at Microsoft.Data.Entity.Query.Internal.QueryingEnumerable.Enumerator.MoveNext()
at Microsoft.Data.Entity.Query.QueryMethodProvider.GetResult[TResult](IEnumerable`1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.Data.Entity.Query.Internal.QueryCompiler.<>c__DisplayClass18_1`1.<CompileQuery>b__1(QueryContext qc)
at System.Linq.Queryable.Any[TSource](IQueryable`1 source)
at WeebDoCMF.WDCore.Models.SeedData.<InitializeWeebDoCMFDatabaseAsync>d__0.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at WeebDoCMF.Startup.Configure(IApplicationBuilder app)
at WeebDoCMF.Startup.ConfigureDevelopment(IApplicationBuilder app, ILoggerFactory loggerFactory)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNet.Hosting.Startup.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNet.Hosting.Startup.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
fail: Microsoft.AspNet.Hosting.Internal.HostingEngine[7]
Application startup exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(IntPtr filename, Sqlite3Handle& ppDb, Int32 flags, IntPtr vfs)
at Microsoft.Data.Sqlite.Interop.NativeMethods.sqlite3_open_v2(String filename, Sqlite3Handle& ppDb, Int32 flags, String vfs)
at Microsoft.Data.Sqlite.SqliteConnection.Open()
at Microsoft.Data.Entity.Storage.RelationalConnection.Open()
at Microsoft.Data.Entity.Storage.Internal.SqliteRelationalConnection.Open()
at Microsoft.Data.Entity.Query.Internal.QueryingEnumerable.Enumerator.MoveNext()
at Microsoft.Data.Entity.Query.QueryMethodProvider.GetResult[TResult](IEnumerable`1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.Data.Entity.Query.Internal.QueryCompiler.<>c__DisplayClass18_1`1.<CompileQuery>b__1(QueryContext qc)
at System.Linq.Queryable.Any[TSource](IQueryable`1 source)
at WeebDoCMF.WDCore.Models.SeedData.<InitializeWeebDoCMFDatabaseAsync>d__0.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at WeebDoCMF.Startup.Configure(IApplicationBuilder app)
at WeebDoCMF.Startup.ConfigureDevelopment(IApplicationBuilder app, ILoggerFactory loggerFactory)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNet.Hosting.Startup.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNet.Hosting.Startup.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication() Looks like sqlite totally broken on coreclr? It works great before... |
Possible duplicate of aspnet/Microsoft.Data.Sqlite#128. Sqlite stopped working recently on coreclr due to recent changes in DNX. |
@Codenator81 swapping DLLs from the dotnet5.4 to netcore50 TFM works because this version does not have the native library loading code. See https://github.com/aspnet/Microsoft.Data.Sqlite/blob/1bd890502aa86b553caa91f32825394c97e956e6/src/Microsoft.Data.Sqlite/Utilities/NativeLibraryLoader.cs#L4 |
Looks like everything has been addressed (or tracked elsewhere). Feel free to open a new issue if you have other issues. |
Check on dnx 1.0.0-rc2-16128 coreclr x64. It fixed and Sqlite works without hacking in project.lock.json. |
In project.json I point only dnxcore50
Dnx:
Version: 1.0.0-rc1-16031
Type: CoreClr
Architecture: x64
OS Name: Windows
OS Version: 10.0
Runtime Id: win10-x64
EF provider Sqlite
The text was updated successfully, but these errors were encountered: