anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
46 stars 16 forks source link

Database error on server join #1158

Closed exsibilation closed 3 years ago

exsibilation commented 3 years ago

client-debug.txt client-main.txt Game Version: 1.14.10 Platform: Windows 10 Modded: No

Description

Client crashes when trying to connect to server. The server and other clients remain unaffected. We tried reinstalling vintage story for the client, same crash. We tried restarting the server, same crash. We started the server from an old save, same crash.

Logs

Running on 64 bit Windows with 16 GB RAM 
Version: v1.14.10 (Stable)7/13/2021 7:14:09 PM: Critical error occurred
System.Data.SQLite.SQLiteException (0x80004005): The database disk image is malformed
database disk image is malformed
   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at Vintagestory.GameContent.MapDB.SetMapPieces(Dictionary`2 pieces)
   at Vintagestory.GameContent.ChunkMapLayer.OnOffThreadTick(Single dt)
   at Vintagestory.GameContent.WorldMapManager.<OnLoaded>b__23_0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
-------------------------------

Event Log entries containing Vintagestory.exe, the latest 3
==================================
{ TimeGenerated = 7/13/2021 7:14:11 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 2188843256504110993, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: Vintagestory.exe
P2: 1.14.10.0
P3: 6079b344
P4: System.Data.SQLite
P5: 1.0.81.0
P6: 4fe8a177
P7: 9b
P8: 84
P9: System.Data.SQLite.SQLite
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER56D3.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5A5E.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5A7E.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5A7C.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5A9C.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Vintagestory.exe_20473117bf67482f641a9bbbed420656ec0e_5674d60d_3c933849-765e-401d-909a-e2bfbb4a9636

Analysis symbol: 
Rechecking for solution: 0
Report Id: a32498cd-54a0-4f6b-88e3-5ad300354d26
Report Status: 268435456
Hashed bucket: b0e204c58fd7d727fe60555844efcf91
Cab Guid: 0 }
--------------
{ TimeGenerated = 7/13/2021 7:14:10 PM, Site = , Source = Application Error, Message = Faulting application name: Vintagestory.exe, version: 1.14.10.0, time stamp: 0x6079b344
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1081, time stamp: 0xde3fc775
Exception code: 0xe0434352
Fault offset: 0x0000000000034ed9
Faulting process id: 0x11dc
Faulting application start time: 0x01d77855d705e7a9
Faulting application path: C:\Users\Adi\AppData\Roaming\Vintagestory\Vintagestory.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: a32498cd-54a0-4f6b-88e3-5ad300354d26
Faulting package full name: 
Faulting package-relative application ID:  }
--------------
{ TimeGenerated = 7/13/2021 7:14:09 PM, Site = , Source = .NET Runtime, Message = Application: Vintagestory.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.SQLite.SQLiteException
   at System.Data.SQLite.SQLite3.Reset(System.Data.SQLite.SQLiteStatement)
   at System.Data.SQLite.SQLite3.Step(System.Data.SQLite.SQLiteStatement)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(System.Data.SQLite.SQLiteCommand, System.Data.CommandBehavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(System.Data.CommandBehavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at Vintagestory.GameContent.MapDB.SetMapPieces(System.Collections.Generic.Dictionary`2<Vintagestory.API.MathTools.Vec2i,Vintagestory.GameContent.MapPieceDB>)
   at Vintagestory.GameContent.ChunkMapLayer.OnOffThreadTick(Single)
   at Vintagestory.GameContent.WorldMapManager.<OnLoaded>b__23_0()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()

 }

client-debug.txt client-main.txt

copygirl commented 3 years ago

Related to #868. From what I understand, your worldmap data for this server is corrupted. Good news: It's stored client-side so you can at the very least delete it. (%AppData%/VintagestoryData/Maps/) Bad news: Your map data will be gone, and I don't know exactly which file corresponds to the server. Maybe @tyronx can weigh in.

tyronx commented 3 years ago

Your assessment is correct. If the map data is very valuable to you, then you can try to repair it with the sqlite repair instructions explained here: https://wiki.vintagestory.at/index.php?title=Repairing_a_corrupt_savegame

tyronx commented 3 years ago

I would assume this was caused by a power out or operating system crash. Unless it happens more commonly I would close this case.

copygirl commented 3 years ago

Shouldn't saving be done in two steps: Save to a temporary file, then rename it to override the existing one?

tyronx commented 3 years ago

We can increase corruption robustness yea, true. No need to copy stuff though, would only need to enable sqlite WAL journal mode 🤔

copygirl commented 3 years ago

Closing in favor of #1163.

exsibilation commented 3 years ago

Thanks for the response, deleting the map file worked perfectly.

tyronx commented 3 years ago

and I don't know exactly which file corresponds to the server. Maybe @tyronx can weigh in.

Oh, I overlooked this part. For posterity - the file name is the save game identifier, a (hopefully) globally unique id for every savegame. You can read it via command: /info ident

exsibilation commented 3 years ago

Thanks for your prompt response and help. Looks like everything is working now.

On Thu, Jul 15, 2021, 00:32 Tyron Madlener @.***> wrote:

and I don't know exactly which file corresponds to the server. Maybe @tyronx https://github.com/tyronx can weigh in.

Oh, I overlooked this part. For posterity - the file name is the save game identifier, a (hopefully) globally unique id for every savegame. You can read it via command /info ident

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anegostudios/VintageStory-Issues/issues/1158#issuecomment-880466395, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU22V6YEAE4ZF3ERN4XAFUTTX2FJZANCNFSM5AKQDWHA .