Skip to content

Conversation

@adamsitnik
Copy link
Member

Fixes #11155

@adamsitnik adamsitnik requested a review from a team as a code owner May 9, 2025 09:11
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel memory labels May 9, 2025
@adamsitnik adamsitnik requested a review from roji May 9, 2025 09:19
- remove the ability to specify extension name (now it's always vec0)
- use LoadVector after opening connection rather than LoadExtension($userDefinedName)
- use 9.0.4 of Microsoft.Data.Sqlite

namespace SqliteVecIntegrationTests.Support;

internal static class SqliteTestEnvironment
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not removed this class because I was not able to test it on Full Framework because I can't even load the sqlite itself on Full Framework (not the extension):

System.TypeInitializationException : The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
-------- System.Exception : Library e_sqlite3 not found
plat: win
suffix: DLL
possibilities (3):
    1) C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\runtimes\win-x64\native\e_sqlite3.dll
    2) C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\e_sqlite3.dll
    3) D:/projects/forks/semantic-kernel/dotnet/src/VectorDataIntegrationTests/SqliteVecIntegrationTests/bin/Debug/net472/e_sqlite3.dll
win TryLoad: C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\runtimes\win-x64\native\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
win TryLoad: C:\Users\adsitnik\AppData\Local\Temp\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\2f6a5f17-a57d-462f-b7e5-ce89e5b9d363\assembly\dl3\909e6049\001ea6ec_8604db01\e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
win TryLoad: D:/projects/forks/semantic-kernel/dotnet/src/VectorDataIntegrationTests/SqliteVecIntegrationTests/bin/Debug/net472/e_sqlite3.dll
thrown: System.ComponentModel.Win32Exception (0x80004005): The specified module could not be found
   at SQLitePCL.NativeLibrary.TryLoad(String name, Loader plat, Action`1 log, IntPtr& h)
NOT FOUND


  Stack Trace: 
SqliteConnection.ctor(String connectionString)
<GetNonExistingCollectionAsync>d__9`1.MoveNext() line 152
<GetConnectionAsync>d__27.MoveNext() line 540
--- End of stack trace from previous location where exception was thrown ---
ExceptionDispatchInfo.Throw()
TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
ValueTask`1.get_Result()
<DeleteCollectionAsync>d__15.MoveNext() line 138
--- End of stack trace from previous location where exception was thrown ---
ExceptionDispatchInfo.Throw()
<17 more frames...>
----- Inner Stack Trace -----
RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
MethodBase.Invoke(Object obj, Object[] parameters)
SqliteConnection.cctor()
----- Inner Stack Trace -----
NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
Batteries_V2.MakeDynamic(String name, Int32 flags)
Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh... OK...

I'm hoping this is somehow related to the test environment/xunit... Can I ask you to do a quick test from a full framework console program, with Microsoft.Data.Sqlite and the new nuget package, to make sure it actually works for users? Otherwise we might have an actual issue here (we specifically worked on making the nuget on full framework, but I no longer remember the exact details...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reported the bug: dotnet/efcore#36069


namespace SqliteVecIntegrationTests.Support;

internal static class SqliteTestEnvironment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh... OK...

I'm hoping this is somehow related to the test environment/xunit... Can I ask you to do a quick test from a full framework console program, with Microsoft.Data.Sqlite and the new nuget package, to make sure it actually works for users? Otherwise we might have an actual issue here (we specifically worked on making the nuget on full framework, but I no longer remember the exact details...)

@adamsitnik adamsitnik merged commit bf91465 into microsoft:feature-vector-data-preb3 May 12, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel memory .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants