Skip to content
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

DirectoryNotFoundException when saving patch #105

Closed
qualityassuance opened this issue Aug 31, 2021 · 7 comments
Closed

DirectoryNotFoundException when saving patch #105

qualityassuance opened this issue Aug 31, 2021 · 7 comments
Labels
bug Something isn't working easynpc Issues/requests relating the EasyNPC app

Comments

@qualityassuance
Copy link

qualityassuance commented Aug 31, 2021

Managed to get the program working, but now it crashes at the end of the build while trying to save the patch. I'm so close!

https://pastebin.com/hmrFQiRx

This part of the log stuck out to me.

"System.AggregateException: One or more errors occurred. (Could not find a part of the path 'D:\Modslists\Serenity\mods\NPC Merge 2021-08-30\NPC Appearances Merged.esp'.)
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Modslists\Serenity\mods\NPC Merge 2021-08-30\NPC Appearances Merged.esp'."

@focustense
Copy link
Owner

Here is the relevant snippet:

2021-08-30 21:17:18.430 -04:00 [INF] Created task 'De-wiggify Records'
2021-08-30 21:17:18.430 -04:00 [INF] Attempting to start task 'De-wiggify Records'
2021-08-30 21:17:18.431 -04:00 [INF] Task 'De-wiggify Records' successfully started
2021-08-30 21:17:18.448 -04:00 [INF] Task 'De-wiggify Records' ended with status "RanToCompletion"
2021-08-30 21:17:18.448 -04:00 [INF] Created task 'Save Patch'
2021-08-30 21:17:18.588 -04:00 [INF] Created task 'De-wiggify FaceGens'
2021-08-30 21:17:18.588 -04:00 [INF] Attempting to start task 'Save Patch'
2021-08-30 21:17:18.588 -04:00 [INF] Attempting to start task 'De-wiggify FaceGens'
2021-08-30 21:17:18.588 -04:00 [INF] Task 'Save Patch' successfully started
2021-08-30 21:17:18.590 -04:00 [INF] Task 'De-wiggify FaceGens' successfully started
2021-08-30 21:17:18.605 -04:00 [INF] Task 'Save Patch' ended with status "Faulted"
2021-08-30 21:17:18.606 -04:00 [ERR] Task 'Save Patch' failed due to an unhandled exception
System.AggregateException: One or more errors occurred. (Could not find a part of the path 'D:\Modslists\Serenity\mods\NPC Merge 2021-08-30\NPC Appearances Merged.esp'.)
 ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Modslists\Serenity\mods\NPC Merge 2021-08-30\NPC Appearances Merged.esp'.

I guess that the PatchSaveTask should force-create the output directory if it doesn't already exist, which it currently doesn't do. However, the directory should always exist at this point in time, it's not normal that it doesn't.

What I find suspicious about this log is that it's already started on the "de-wiggify facegens" task by the time it gets to saving the patch, which means it already finished the "copy facegens" task, which for any normal mod list is effectively impossible to complete that early in the process.

Most likely, the reason the directory doesn't exist at this point in time is because the preceding tasks (e.g. copy facegens), which should have created it, did not create it, because there were no files to copy. And if there were no files to copy, it is most likely because the app is not pointing to the correct mod directory. Even if you got past this error, you'd still end up with an unusable mod.

Is D:\Modslists\Serenity\mods your actual mod directory?

@focustense focustense added bug Something isn't working easynpc Issues/requests relating the EasyNPC app labels Aug 31, 2021
focustense added a commit that referenced this issue Aug 31, 2021
Although it is almost definitely the result of a misconfiguration if this task activates before the directory is created by some other task, it should still work as a standalone step, and that means ensuring the output directory exists before writing to it.

Fixes #105
@focustense focustense changed the title Crash When Saving Patch DirectoryNotFoundException when saving patch Aug 31, 2021
@qualityassuance
Copy link
Author

Yes, I am 100% sure that is my mod directory. I reached out to you a while ago because I couldn't get the application to properly scan my mod directory, but thanks to your help and a recent update I was able to fix that.

The only thing else I can think of is that before I start building and do the check for errors thing, it gives me quite a few and highlights some relevant plugins in red (e.g. Pan_NPC.esp). Perhaps I could try running it on a new profile with only the npc overhauls activated? I'm not sure what else to try, but I really want to get it working.

@focustense
Copy link
Owner

A very simple and straightforward workaround you could use for the patch-creation issue is just to create that directory manually (leave it empty) before starting the build. That way it will exist.

However, it's obvious that there are some other problems in your case.

  • You shouldn't have plugins like PAN_NPCs as masters. That means you have records pointing to them, or patches for them, as defaults. You can double-click on them to find out what they are. They need to be eliminated or else you won't be able to deactivate them afterward and you'll end up with conflicts.
  • It's obviously not finding any FaceGen files to copy, which to me implies something off about the mod directory. Perhaps it is a valid in the sense of containing a few plugins, but does not actually have the full mods. I suppose another possibility is that the mod directory is correct and its contents are valid, but every single one of the NPCs in the profile is pointing to a mod that doesn't have a facegen - possible, but unlikely. A third possibility is that the actual game data directory is incorrect, which normally would be obvious on startup (all plugins in the loading screen would show up as unreadable), but perhaps if someone tried to work around that by copying plugins directly to the game's data directory, that could lead to this situation as well.

There's too many variables here to guess, and this problem seems unique to your particular setup. I'm pretty confident it's not a bug in the app, though, so I suggest using the Discord chat for more localized support where it's easier to do back-and-forth. I think we'll just have to go through this step-by-step, and once I figure out how you've got things set up then I can pinpoint where the issue is.

@qualityassuance
Copy link
Author

I'll check to make sure those mods aren't masters, I know I disabled all the specific patches but I might have missed something bigger like Synthesis or Requiem for the Indifferent. My modlist is based off a Wabbajack list, so I'm confident that the initial installation and setup of the directories are done as best as one could. I haven't changed anything in that sense and I know my mod directory is where all mods are installed to through MO. It contains all mod data and all my other modding programs work and the game runs fine , so there's nothing missing or wrong about the directory itself. Not to say I didn't screw something up along the way though.

Even so, all this leads me to believe something in my Load order is causing this. Now I am trying to merge Modpocalypse NPC's as well, which is quite new and doesn't even have mugshots available as far as I'm aware. Perhaps the facegen data from the resource version is causing a problem?

@focustense
Copy link
Owner

I think you should hold off on facegen-only mods like Modpocalypse until you've done a successful merge with "normal" mods. While early feedback suggests that it works fine, it is a newer feature, and in a situation like yours, it's best to be eliminating variables rather than introducing new ones.

As the reported bug has been fixed, I'm going to close the issue, but I'll be happy to try to help out with your particular setup in the Discord chat. Most of the time, it turns out to be a relatively simple misunderstanding that is easily corrected, but as I said, there are too many variables to pin it down without a more in-depth look, and that type of support is best addressed in the chat.

Thanks for reporting!

@qualityassuance
Copy link
Author

Thank you so much for the help, would you be able to link the discord server?

@focustense
Copy link
Owner

There is a link at the top of the project readme. Just scroll down past the file list to the documentation.

Also a link near the top of the Nexus page.

@focustense focustense mentioned this issue Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easynpc Issues/requests relating the EasyNPC app
Projects
None yet
Development

No branches or pull requests

2 participants