NiceneNerd / BCML

Breath of the Wild Cross-Platform Mod Loader: A mod merger and manager for BOTW
308 stars 57 forks source link

Merge issue #339

Closed WinterAshikage closed 2 years ago

WinterAshikage commented 2 years ago

I keep getting this issue even after reinstalling bcml and python entirely.


Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\pathlib.py", line 1287, in mkdir self._accessor.mkdir(self, mode) PermissionError: [WinError 5] Access is denied: 'H:\Emulator\Roms\Zelda\Breath of the Wild\bcml mods\mods\9999_BCML\logs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 743, in link_master_mod util.create_bcml_graphicpack_if_needed() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\util.py", line 1202, in create_bcml_graphicpack_if_needed (bcml_mod_dir / "logs").mkdir(parents=True, exist_ok=True) File "c:\users\winter\appdata\local\programs\python\python38\lib\pathlib.py", line 1296, in mkdir if not exist_ok or not self.is_dir(): File "c:\users\winter\appdata\local\programs\python\python38\lib\pathlib.py", line 1415, in is_dir return S_ISDIR(self.stat().st_mode) File "c:\users\winter\appdata\local\programs\python\python38\lib\pathlib.py", line 1197, in stat return self._accessor.stat(self) PermissionError: [WinError 5] Access is denied: 'H:\Emulator\Roms\Zelda\Breath of the Wild\bcml mods\mods\9999_BCML\logs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 33, in status_run data = func(*args, *kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 265, in do_and_refresh res = func(args, **kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 558, in remerge raise Exception( Exception: There was an error merging your mods. [WinError 5] Access is denied: 'H:\Emulator\Roms\Zelda\Breath of the Wild\bcml mods\mods\9999_BCML\logs' Note that this could leave your game in an unplayable state.

NiceneNerd commented 2 years ago

Have you tried deleting the folder it mentions?

WinterAshikage commented 2 years ago

Have you tried deleting the folder it mentions?

No. But I've changed the directory to a different drive and folder to get the same issue.


Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 547, in remerge install.link_master_mod() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 744, in link_master_mod rsext.manager.link_master_mod(str(output.resolve()) if output else None) OSError: Incorrect function. (os error 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 33, in status_run data = func(*args, *kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 265, in do_and_refresh res = func(args, **kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 558, in remerge raise Exception( Exception: There was an error merging your mods. Incorrect function. (os error 1) Note that this could leave your game in an unplayable state.

WinterAshikage commented 2 years ago

If this is unfixable can I at least know how to uninstall bcml completely so I can try again from scratch? Uninstalling from pip doesn't completely uninstall it as it still has all my settings and paths when I reinstall it. (Mostly just done with it at this point.)

NiceneNerd commented 2 years ago

Have you tried the newest update (3.9.3)? You can delete BCML's data at %LOCALAPPDATA%\bcml/

WinterAshikage commented 2 years ago

Have you tried the newest update (3.9.3)? You can delete BCML's data at %LOCALAPPDATA%\bcml/

Yeah I personally feel like it was the update that broke it.

WinterAshikage commented 2 years ago

So now that I've reinstalled bcml completely, it merges properly. But it does absolutely nothing with the master mod in graphics packs. I've checked the 4 most common problems with it not loading and that didn't help. Merging just simply does nothing with the master mod. This is ridiculous. lmao.

edit: After trying after deleting the bcml graphics pack and reinstalling everything again, it gives the same error.


Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 33, in status_run data = func(*args, *kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 266, in do_and_refresh refresh_master_export() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\util.py", line 462, in timed_function res = func(args, **kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 275, in refresh_master_export link_master_mod() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 744, in link_master_mod rsext.manager.link_master_mod(str(output) if output else None) OSError: Incorrect function. (os error 1)

GingerAvalanche commented 2 years ago

What operating system are you on? Windows 10? 11?

WinterAshikage commented 2 years ago

What operating system are you on? Windows 10? 11?

Windows 10

GingerAvalanche commented 2 years ago

Go to c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\ and replace the file called install.py with the one attached to this comment.

Then run bcml with bcml-debug and try installing mods again. When it fails, copy the last several lines that show on the console (the most important line for this issue will be something like VERBOSEOutput path: and then the path it's attempting to output to) and post them here for us.

install.zip

WinterAshikage commented 2 years ago

Go to c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\ and replace the file called install.py with the one attached to this comment.

Then run bcml with bcml-debug and try installing mods again. When it fails, copy the last several lines that show on the console (the most important line for this issue will be something like VERBOSEOutput path: and then the path it's attempting to output to) and post them here for us.

install.zip


Exporting merged mod pack... VERBOSEOutput path: None VERBOSErefresh_master_export took 0.0020179 seconds VERBOSE[ { "name": "Mirror Shield Standalone", "date": "06/04/2022 7:05 PM", "priority": 100, "path": "C:\Users\Winter\AppData\Local\bcml\mods\0100_MirrorShieldStandalone", "disabled": false, "id": "TWlycm9yIFNoaWVsZCBTdGFuZGFsb25lPT0xLjAuMA==" } ] VERBOSEBcmlMod(name="Mirror Shield Standalone", path="C:/Users/Winter/AppData/Local/bcml/mods/0100_MirrorShieldStandalone", priority=100)

GingerAvalanche commented 2 years ago

It appears to me that it works fine now. Incorrect function on Windows generally means either: 1- code intended for use on Unix systems was run on Windows 2- a path could not be properly resolved

Given that you’re on the same version of Windows that I am, using the same compiled code that doesn’t use the Unix commands, and your output path is None, so the code doesn’t even try to resolve it… I’m gonna chalk it up to being a ghost in the machine

WinterAshikage commented 2 years ago

It appears to me that it works fine now. Incorrect function on Windows generally means either: 1- code intended for use on Unix systems was run on Windows 2- a path could not be properly resolved

Given that you’re on the same version of Windows that I am, using the same compiled code that doesn’t use the Unix commands, and your output path is None, so the code doesn’t even try to resolve it… I’m gonna chalk it up to being a ghost in the machine

But its not fine. The master mod pack is not generated at all. I guess that means I give up?

NiceneNerd commented 2 years ago

Upload your BCML settings file

WinterAshikage commented 2 years ago

Upload your BCML settings file install.zip

GingerAvalanche commented 2 years ago

Your BCML settings file is located at %LOCALAPPDATA%\bcml\ (i forget if its still settings.json or something else)

I mistakenly closed, because the output Path being None is an acceptable case- when the user doesn’t set one in their settings.

WinterAshikage commented 2 years ago

Your BCML settings file is located at %LOCALAPPDATA%\bcml\ (i forget if its still settings.json or something else)

I mistakenly closed, because the output Path being None is an acceptable case- when the user doesn’t set one in their settings.

So do I need to change that settings file?

GingerAvalanche commented 2 years ago

Upload it like Nicene asked

WinterAshikage commented 2 years ago

Upload it like Nicene asked

I have. That install.zip

GingerAvalanche commented 2 years ago

I downloaded that and opened it, and it’s not a settings file. It’s the same source code file I attached several posts back. That’s why I came in and explained where to find the file, so that you could find the correct file and upload it.

WinterAshikage commented 2 years ago

I downloaded that and opened it, and it’s not a settings file. It’s the same source code file I attached several posts back. That’s why I came in and explained where to find the file, so that you could find the correct file and upload it.

Weird. Sorry about that. settings.zip

GingerAvalanche commented 2 years ago

Your settings has no export_dir so the code isn’t exporting the merged files to anywhere. Try setting it to C:/Users/Winter/AppData/Local/bcml/merged then closing and reopening bcml and trying again

WinterAshikage commented 2 years ago

It infinitely remerges. It creates a merged folder that windows says "The name of the file cannot be resolved by the system." Even if I create the folder first.

GingerAvalanche commented 2 years ago

That's what I get for trying to troubleshoot on my phone. I always miss important lines of code just out of sight. Try setting export_dir to H:/Emulator/Cemu/graphicPacks/BreathOfTheWild_BCML instead.

WinterAshikage commented 2 years ago

Traceback (most recent call last): File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml_api.py", line 33, in status_run data = func(*args, *kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 266, in do_and_refresh refresh_master_export() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\util.py", line 462, in timed_function res = func(args, **kwargs) File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 275, in refresh_master_export link_master_mod() File "c:\users\winter\appdata\local\programs\python\python38\lib\site-packages\bcml\install.py", line 745, in link_master_mod rsext.manager.link_master_mod(str(output) if output else None) OSError: Incorrect function. (os error 1)

GingerAvalanche commented 2 years ago

Same drill as last time. Run with bcml-debug and cause the error, then paste what the console says with VERBOSEOutput path:

WinterAshikage commented 2 years ago

Same drill as last time. Run with bcml-debug and cause the error, then paste what the console says with VERBOSEOutput path:


Exporting merged mod pack... VERBOSEOutput path: None VERBOSE[ { "name": "Mirror Shield Standalone", "date": "06/04/2022 9:13 PM", "priority": 100, "path": "C:\Users\Winter\AppData\Local\bcml\mods\0100_MirrorShieldStandalone", "disabled": false, "id": "TWlycm9yIFNoaWVsZCBTdGFuZGFsb25lPT0xLjAuMA==" } ]


If thats not enough info I can copy/paste more of the console.

GingerAvalanche commented 2 years ago

At this point, I think that might be a red herring I've spent too long on.

Tell me about drive H: - local drive? Network drive?

WinterAshikage commented 2 years ago

At this point, I think that might be a red herring I've spent too long on.

Tell me about drive H: - local drive? Network drive?

Thumb drive. But it worked when I first installed bcml. This is where I keep all my emulator stuff including cemu and roms.

GingerAvalanche commented 2 years ago

Which bcml version was it that worked?

WinterAshikage commented 2 years ago

Which version was that?

The version just before 3.9 This most recent update is when it started.

GingerAvalanche commented 2 years ago

BCML used to take forever for people who kept their bcmldata folder and cemu folder on separate drives because it merged all the files and then copied them across to the other drive. It was much faster for same drive installations because it could just link them.

To solve this, bcml now links all the necessary files to another spot on the same drive, and then just links the folder itself across the drive, which is essentially instantaneous once the merging itself is done.

I've found some evidence that Incorrect function refers to using the wrong type of link to link across drives to a network drive (just a minor hitch that there is no correct function for that purpose, thanks for the misleading error code Windows...) but I haven't found any evidence one way or the other about whether local external drives also count as "network" drives in this case.

I'm not sure if the settings option for no hard links still works, as I don't see a reference to it in the code anymore, but you can give it a try. If it doesn't work, then we'll add that back in at some point, and in the meantime you can roll back to 3.8.6.

The commands for doing so are: pip uninstall bcml pip cache clear pip install bcml==3.8.6

WinterAshikage commented 2 years ago

BCML used to take forever for people who kept their bcmldata folder and cemu folder on separate drives because it merged all the files and then copied them across to the other drive. It was much faster for same drive installations because it could just link them.

To solve this, bcml now links all the necessary files to another spot on the same drive, and then just links the folder itself across the drive, which is essentially instantaneous once the merging itself is done.

I've found some evidence that Incorrect function refers to using the wrong type of link to link across drives to a network drive (just a minor hitch that there is no correct function for that purpose, thanks for the misleading error code Windows...) but I haven't found any evidence one way or the other about whether local external drives also count as "network" drives in this case.

I'm not sure if the settings option for no hard links still works, as I don't see a reference to it in the code anymore, but you can give it a try. If it doesn't work, then we'll add that back in at some point, and in the meantime you can roll back to 3.8.6.

The commands for doing so are: pip uninstall bcml pip cache clear pip install bcml==3.8.6


Disabling the hard links didn't work. Rolling back did fix the issue. Just out of curiosity, If I had everything on my D drive which is an internal drive would I run into the same issue? Or would It have to be in the C drive like %LOCALAPPDATA%?

(Also side note that doesn't matter much and has nothing to do with the issue, "pip cache clear" came up with the error "ERROR: Need an action (dir, info, list, purge, remove) to perform." But it didn't seem to matter anyway.)

I appreciate both of your help and patience in this matter. Thank you.

GingerAvalanche commented 2 years ago

Ah, every single time I try to clear cache, I remember "clear" and it's always wrong. One day I'll remember it's "purge". But yeah, that was just a precaution because sometimes pip likes to confuse wheels and install the most recent cached version even if you specify an older one.

Any internal drive should work fine. I, personally, have the program on D:, the data dir on C:, and Cemu on E:, which is about as complicated as you can get without bringing externals into the mix.

WinterAshikage commented 2 years ago

I see. I'll remember this in case a new version comes out with features that I want. "Just don't use an external drive." Lmao