Page 1 of 1

[1.1.32] Unable to update mods with VSCode open in mods directory

Posted: Fri Apr 23, 2021 8:14 pm
by carbonash
I have attached a log from a run of factorio where I simply try to enable/disable any mod and it fails to take effect on the next run.

The money line is

Code: Select all

87.548 Error ModManager.cpp:163: writeModlist threw an exception: Access is denied.^M
I have confirmed that I do NOT have the mods-list.json file open. VSCode may be locking the mods directory itself, or some of its contents.

I'm not sure if this is a bug in factorio or simply a bad interaction. Regardless it would be nice to be told that the mods were not going to be updated and if possible the reason why. Even an improved error message in the log about which file access was denied to would be a helpful improvement.

Re: [1.1.32] Unable to update mods with VSCode open in mods directory

Posted: Fri Apr 23, 2021 8:17 pm
by carbonash
I have noticed that the update time for the mods directory is changed on a successful mods update- it's likely VSCode is prevent this. I imagine this might be done for some caching/cache invalidation reasons. But at least that appears to 100% be the issue.

Re: [1.1.32] Unable to update mods with VSCode open in mods directory

Posted: Sun Apr 25, 2021 5:53 pm
by Rseding91
Thanks for the report however there's nothing going wrong here. The error specifically says what failed: it couldn't write the mods list because access was denied. Something external prevented writing - in your case VSCode most likely - and the game reported the error in the log file as best it could.

In this case the game is in the process of exiting and everything else has been unloaded by the time this runs so the log entry is all it can do.