Nexus-Mods / NexusMods.App

Home of the development of the Nexus Mods App
https://nexus-mods.github.io/NexusMods.App/
GNU General Public License v3.0
1.1k stars 52 forks source link

Crash when adding Stardew Valley mod with empty file #1782

Closed BucketListMod closed 4 months ago

BucketListMod commented 4 months ago

Bug Report

Summary

Upon installing mods through Nexus one-by-one, 171st mod crashes app

Steps to reproduce

  1. Start clean, no mods, no SMAPI
  2. Log into Nexus via app
  3. Download and apply mods one-by-one via Vortex (.nxm) links
  4. 171st mod crashes app
  5. Attempts to re-open and re-use the app cause it to crash shortly after clicking "View" on Stardew Valley

What is the expected behaviour?

App to continue functioning as normal

Other information

nexusmods.app.main.current.log nexusmods.app.slim.current.log

Sewer56 commented 4 months ago

This might be problematic to debug.

Would you be able to upload the other logs from the logs folder (while they're still there!!). There's no errors in the existing logs it seems.

A dump of the database from ~/.local/share/NexusMods.App/DataModel/MnemonicDB.rocksdb might also potentially be useful here. From what I gather, there was an error in a previous run, and now the App's in a difficult state internally.

BucketListMod commented 4 months ago

Zip archives for you! I also realized my cloud server may not have synced properly so that log may not have even been accurate, but everything in these zips will be!

Logs.zip

MnemonicDB is too big for upload, instead is on a cloud Link: https://use10.thegood.cloud/s/Hka7KA2onRff8Dg Password: A1^~>]R\Ea;Mso$LbjG?@**^@

Pickysaurus commented 4 months ago

Do you happen to know what the 171st mod you added was?

erri120 commented 4 months ago

Duplicate of #1783. We'll get this fixed for the next release. The mod you added contained an empty file.

01:14:57.118 [ERROR] (NexusMods.App.Program) Encountered an exception published to an object with an unobserved ThrownExceptions property|System.AggregateException: One or more errors occurred. (A positive capacity must be specified for a Memory Mapped File backed by an empty file.) (A positive capacity must be specified for a Memory Mapped File backed by an empty file.)
 ---> System.ArgumentException: A positive capacity must be specified for a Memory Mapped File backed by an empty file.
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity, MemoryMappedFileAccess access)
   at NexusMods.Archives.Nx.FileProviders.OutputFileProvider..ctor(String outputFolder, String relativePath, FileEntry entry)
   at NexusMods.DataModel.NxFileStore.<>c__DisplayClass7_1.<ExtractFiles>b__2(Int32 x) in /_/src/NexusMods.DataModel/NxFileStore.cs:line 182
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
 ---> (Inner Exception #1) System.ArgumentException: A positive capacity must be specified for a Memory Mapped File backed by an empty file.
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateFromFile(String path, FileMode mode, String mapName, Int64 capacity, MemoryMappedFileAccess access)
   at NexusMods.Archives.Nx.FileProviders.OutputFileProvider..ctor(String outputFolder, String relativePath, FileEntry entry)
   at NexusMods.DataModel.NxFileStore.<>c__DisplayClass7_1.<ExtractFiles>b__2(Int32 x) in /_/src/NexusMods.DataModel/NxFileStore.cs:line 182
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()<---
BucketListMod commented 4 months ago

Ah, I see! Do you still need to know which mod it was, or does that not matter now that it's been identified? (My apologies for late response as well, fell asleep)

Pickysaurus commented 4 months ago

Ah, I see! Do you still need to know which mod it was, or does that not matter now that it's been identified? (My apologies for late response as well, fell asleep)

Unfortunately, the log file doesn't do a great job of telling us which mod it relates to specifically. If you sort by install time and remove the newer ones until the "Apply" option works without crashing that would be the best way to work it out.