ModOrganizer2 / modorganizer

Mod manager for various PC games. Discord Server: https://discord.gg/ewUVAqyrQX if you would like to be more involved
http://www.nexusmods.com/skyrimspecialedition/mods/6194
GNU General Public License v3.0
2.19k stars 163 forks source link

Failed to download mod - could not write to output file (MO 2.2.2) #962

Closed bartmoss closed 4 years ago

bartmoss commented 4 years ago

The problem:

After updating to MO2 2.2.2, I am having some download issues. At first I thought this was related to the Nexus mods servers being borked (they have been behaving badly lately); however, this does not seem to be the case. As far as I can tell, it's either semi-random, or .rar files. Right now I am downloading an updated Legacy of the Dragonborn, but Hammet's dungeon pack repeatedly failed. The exact error is:

mo222

This does read like a local error to me.

MO2 does not appear to log this error in its logfiles.

I ensured there are no files existing (deleted hammet* in DL folder). C: has ~490 GB free.

Workaround: Manual download + drag and drop of archive into MO2 works.

Note: Have not yet tried whether other .rar files exhibit same issue.

To Reproduce:

Steps to reproduce the behavior:

  1. Download Hammet's Dungeon Pack via mod manager link. https://www.nexusmods.com/skyrimspecialedition/mods/12186?tab=files&file_id=119208&nmm=1

(I am a former supporter, but not a subscriber; so I am using the "slow download" button.)

  1. Download fails with above message.

Environment:

Details:

None.

Link to Mod Organizer logs:

No relevant entries in logfiles. As they are tiny, I'll include them inline. Hope that's OK.

USVFS:

No relevant entries... Issue not related to actually launching Skyrim SE.

00:02:09.309 [I] usvfs dll 0.4.4.6 initialized in process 20376 00:02:09.309 [D] remove from process 20376 00:02:09.309 [I] create config in 20376 00:02:09.309 [I] 0 processes 00:02:09.309 [I] mod_organizer_instance_1 created in process 20376 00:02:09.309 [I] attached to mod_organizer_instance_1 with 1 nodes, size 65536 00:02:09.309 [I] inv_mod_organizer_instance_1 created in process 20376 00:02:09.309 [I] attached to inv_mod_organizer_instance_1 with 1 nodes, size 65536 00:02:09.309 [D] context current shm: mod_organizer_instance (now 2 connections) 00:02:09.309 [D] clearing blacklist 00:02:09.309 [D] blacklisting 'Chrome.exe' 00:02:09.309 [D] blacklisting 'Firefox.exe' 00:02:09.309 [D] blacklisting 'TSVNCache.exe' 00:02:09.309 [D] blacklisting 'TGitCache.exe' 00:02:09.309 [D] blacklisting 'Steam.exe' 00:02:09.309 [D] blacklisting 'GameOverlayUI.exe' 00:02:09.309 [D] blacklisting 'Discord.exe' 00:02:09.309 [D] blacklisting 'GalaxyClient.exe' 00:02:09.309 [D] blacklisting 'Spotify.exe' 00:02:09.309 [D] clearing forced libraries

MO Interface:

No relevant entries... Yes this is the entire log:

[2020-01-09 23:02:08.912 I] starting Mod Organizer version 2.2.2 revision dfa60099 in D:/MODDING/MO2, usvfs: 0.4.4.6 [2020-01-09 23:02:08.913 I] data path: C:/Users/nils/AppData/Local/ModOrganizer/SKyrim SE [2020-01-09 23:02:09.007 I] working directory: D:/MODDING/MO2 [2020-01-09 23:02:09.600 I] using game plugin 'Skyrim Special Edition' ('SkyrimSE', steam id '489830') at C:/GAMES/STEAM/steamapps/common/Skyrim Special Edition

bartmoss commented 4 years ago

I wonder if the single quote in the archive file name is an issue for MO2's downloader. Maybe an escaping issue?

isanae commented 4 years ago

I get the same behaviour on 2.2.1, that ? is an illegal character in filenames.

bartmoss commented 4 years ago

If that's the actual file name MO2 is trying to write then yeah that may be an issue :-) So URL isn't getting parsed correctly to come up with local file name.

I could have sworn I used 2.2.1 to DL Hammet's, but to be fair I am not entirely sure. Could have been an older version. But I did have two old versions of Hammet's that I successfully downloaded through MO2.

bartmoss commented 4 years ago

Same issue with Obscure's College of Winterhold. Maybe this'll help identify the root cause. https://www.nexusmods.com/skyrimspecialedition/mods/20514?tab=files&file_id=119410&nmm=1

LostDragonist commented 4 years ago

So far I've been able to trace this to

bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, const QString &fileName,
                                  QString gameName, int modID, int fileID, const ModRepositoryFileInfo *fileInfo)
{
  // download invoked from an already open network reply (i.e. download link in the browser)
  DownloadInfo *newDownload = DownloadInfo::createNew(fileInfo, URLs);

  QString baseName = fileName;
  if (!fileInfo->fileName.isEmpty()) {
    baseName = fileInfo->fileName;
  } else {
    QString dispoName = getFileNameFromNetworkReply(reply);

    if (!dispoName.isEmpty()) {
      baseName = dispoName;
    }
  }

Files that work have a non-empty fileInfo->fileName. Files that don't work do not so end up being the "filename" which is really just the entire URL.

LostDragonist commented 4 years ago

Which is due to /v1/games/{game_domain_name}/mods/{mod_id}/files/{file_id}.json return an empty file name. How does a file on the Nexus not have a filename? /shrug.

I guess we'll just have to add stuff to the codepath above that strips out all the extra URL stuff.

bartmoss commented 4 years ago

Bug in their code maybe? Could be worthwhile to report to the nexus guys.

LostDragonist commented 4 years ago

IDK. I pinged them on it. It might be related to how new the file is since it was just uploaded 4 hours ago.

LostDragonist commented 4 years ago

Alright, there's a fix in place for it. It'll be in the 2.2.2.1 release going out... shortly (hopefully 1-2 days). For now, mods like that can be downloaded manually and imported into MO.