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.16k stars 160 forks source link

Plugin error #1794

Open hercules6969 opened 1 year ago

hercules6969 commented 1 year ago

The problem:

After the latest Windows update, the ddspreview.py plugin stop functionning with the error "Failed to initialize plugin E:/Modding/Mod Organizer 2/plugins/DDsPreview.py: UnicondeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 0: invalid continuation byte" Nothing else was done to the script, it was working perfectly before the update, I restarted the computer as asked by the update and it stopped functionning straight after the reboot (f#@!! Microsoft!) I tried reinstalling the python script but same error I tried to look inside but... did not know what to look for, seems to be an encoding error but where to start, I ain't familiar with Python.

Environment:

Latest MO2 version that has not been modified 2.4.4

AnyOldName3 commented 1 year ago

Can you please attach your whole log like the issue template said to? The plugin itself doesn't load any text files during initialisation, and without other information in the log, we can only guess at what might be failing.

hercules6969 commented 1 year ago

Hi Well I tried various loglevel in MODorganizer but the "logs" directory in MO doesn't log new messages. The mo_interface.log dates back to 8/22 and so does the latest usvfs-2022-08-07_09-12-51.log There is nothig else generated recently. Should I do something differently?

[2022-08-07 09:12:51.529 I] starting Mod Organizer version 2.4.4 revision 1df1ea5e in E:/Games/Common tools/Mod Organizer 2.4.4, usvfs: 0.5.6.0 [2022-08-07 09:12:51.529 I] data path: E:/Games/Common tools/Mod Organizer 2.4.4 [2022-08-07 09:12:51.529 I] working directory: E:/Games/Common tools/Mod Organizer 2.4.4 [2022-08-07 09:12:51.945 I] using game plugin 'Skyrim Special Edition' ('SkyrimSE', variant (none), steam id '489830') at G:/Games/Steam/steamapps/common/Skyrim Special Edition

AnyOldName3 commented 1 year ago

Are you definitely looking at the right logs directory for the instance? How are you finding it? The reliable way is to click the folder icon at the top of MO2's left pane and choose the logs directory option.

hercules6969 commented 1 year ago

Oups you were right, I was looking at the wrong place https://gist.github.com/hercules6969/f3cb2519377e2c6793579f502bc0cd22

AnyOldName3 commented 1 year ago

It's pretty weird that it's just that plugin causing the error. Could you please upload E:/Games/Common tools/Mod Organizer 2.4.4/plugins/DDSPreview.py so we can see if it's got corrupted or something?

hercules6969 commented 1 year ago

I could not upload the .py file so I pasted it in https://gist.github.com/hercules6969/f3cb2519377e2c6793579f502bc0cd22

I tried to re-install the python file from a save I had when it was working but to no avail... hope you see something. Only this plugin fails, the others do work, really weird. Did I tell you I hated Microsoft and its updates ;-) ?

AnyOldName3 commented 1 year ago

It would have been easier if you'd uploaded it as a new gist, but the renamed-to-jpeg version got through GitHub okay. It looks fine, so now I'm even more confused about what could cause the error.

I guess there's always basic Windows troubleshooting stuff. Can you please right click on your Start button (or press the Windows key and X) and choose Windows PowerShell (Admin), then once the console's appeared, type sfc /scannow and press the enter key? If it says it found corrupt files and fixed them, keep running that command until it says everything was fine.

hercules6969 commented 1 year ago

The scan did not find any problem, I guess I have to hope that the next Windows update fixes whatever it broke. I tried reinstalling MO2 2.4.4. with the .exe but it still doesn't load the plugin.

hercules6969 commented 1 year ago

Well I had hope yesterday after uninstalling MS studio (which I used to edit python scripts), rebboting, installing Python 3.11.2 (because the script is written in python, i said, "why not try this") and re-installing MO, everything was back to normal, I was so happy! BUT after turning off the computer last night and turning it on now, the issue is back and i can no longer make it to work, even after applying the method I successfully used yesterday! I could think i imagined it but i did manage to view a .dds file in MO and it worked, it is not an hallucination. It has to do with some parameter somewhere that resets, but the only thing I did was install and uninstall.. I did not set anything. I did not mention something important, it's on a french computer, since it's related to encoding and the French language has accents, it may be of a great importance... don't know anymore

AnyOldName3 commented 1 year ago

I'm guessing when you say MS studio, you either mean Visual Studio or Visual Studio Code (which, despite the names, are effectively unrelated). That shouldn't have made any difference to anything. Neither should (re)installing Python as MO2 uses its own embedded interpreter rather than the system one. Also, French Windows still uses the same cp1252 encoding as English Windows, so that shouldn't make any difference to anything, either. It's still looking like you need an exorcist.

hercules6969 commented 1 year ago

Yes that was visual studio sorry , i'm getting my voodoo dolls right now and start the incantations ;-)

Holt59 commented 1 year ago

Can you try opening E:/Games/Common tools/Mod Organizer 2.4.4/plugins/DDSPreview.py with a proper editor and then making a stupid change (like adding a space to the end of a line) and then saving it?

hercules6969 commented 1 year ago

Hello I added a space at the end of the first line "import struct ", saved it (checked the date was modified) but I still have the same error

hercules6969 commented 1 year ago

But, after doing the change you mentioned, i've just re-installed MO2 2.4.4 with the .exe to make sure the file was back to normal and.... when I open MO2 .... no error and it works (maybe until I restart my PC like the other day)! I've just opened a .dds file in MO again. I swear nothing happen in between I really think exorcism is the key

hercules6969 commented 1 year ago

Well I "fixed it". Not by doing anything but I noticed everytime i double clicked on the MO.exe, I got the error.... BUT... if I go to the nexus web portal in firefox and launch any download while MO is not started... NO ERROR!!! So i do that all the time now Magic is in the air tonight

Holt59 commented 1 year ago

Well I "fixed it". Not by doing anything but I noticed everytime i double clicked on the MO.exe, I got the error.... BUT... if I go to the nexus web portal in firefox and launch any download while MO is not started... NO ERROR!!! So i do that all the time now Magic is in the air tonight

You might have multiple MO2 installations, one of which is broken, but when you go through Nexus, it opens another one that works fine.