You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When database is encrypted with password, database.Rebuild() call reset password to empty, than fails
This behavior have been changed from version 5.0.17, until version 5.0.18 it was just rebuilding the database and keeping password if no parameter have been provided to Rebuild method.
Error: Unhandled exception. LiteDB.LiteException: File is not encrypted.
Code to Reproduce var connectionString = new LiteDB.ConnectionString() { Filename = "test.db", Password = "password", }; LiteDB.ILiteDatabase db = new LiteDB.LiteDatabase(connectionString); db.Rebuild();
Expected behavior
db.Rebuild() should just rebuild the database, as ILiteDatabase already contains the password
Screenshots/Stacktrace
Unhandled exception. LiteDB.LiteException: File is not encrypted.
at LiteDB.Engine.AesStream..ctor(String password, Stream stream)
at LiteDB.Engine.FileStreamFactory.GetStream(Boolean canWrite, Boolean sequencial)
at LiteDB.Engine.StreamPool.<>c__DisplayClass3_0.<.ctor>b__0()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at System.Lazy1.get_Value()
at LiteDB.Engine.StreamPool.get_Writer()
at LiteDB.Engine.DiskService..ctor(EngineSettings settings, EngineState state, Int32[] memorySegmentSizes)
at LiteDB.Engine.LiteEngine.Open()
at LiteDB.Engine.LiteEngine..ctor(EngineSettings settings)
at LiteDB.ConnectionString.CreateEngine()
at LiteDB.LiteDatabase..ctor(ConnectionString connectionString, BsonMapper mapper)
at Program.
$(String[] args) in D:\tools\My\ConsoleApp2\ConsoleApp2\Program.cs:line 7
Additional context
As a workaround password can be provided one more time
Version
5.0.18, 5.0.19
Describe the bug
When database is encrypted with password, database.Rebuild() call reset password to empty, than fails
This behavior have been changed from version 5.0.17, until version 5.0.18 it was just rebuilding the database and keeping password if no parameter have been provided to Rebuild method.
Error:
Unhandled exception. LiteDB.LiteException: File is not encrypted.
Code to Reproduce
var connectionString = new LiteDB.ConnectionString() { Filename = "test.db", Password = "password", }; LiteDB.ILiteDatabase db = new LiteDB.LiteDatabase(connectionString); db.Rebuild();
Expected behavior
db.Rebuild() should just rebuild the database, as ILiteDatabase already contains the password
Screenshots/Stacktrace
Additional context
As a workaround password can be provided one more time
db.Rebuild(new LiteDB.Engine.RebuildOptions { Password = "password" });
The text was updated successfully, but these errors were encountered: