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

[Python Pipe Server] FileNotFoundError when using MO2 Virtual Filesystem #19

Open
JeffreyBytes opened this issue May 18, 2024 · 5 comments

Comments

@JeffreyBytes
Copy link

When using Mod Organizer 2 to manage the mods, I get the FileNotFoundError:

Rejecting module due to error during extension id permission check:
 path: E:\Games\X4 Foundations\extensions\sn_mod_support_apis\python_time_api.txt
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\Games\\X4 Foundations\\extensions\\sn_mod_support_apis\\content.xml'

I understand if you don't want to add support for MO2 instances, but I wanted to report in case there is an obvious fix. Thanks!

@Vectorial1024
Copy link

content.xml is a requirement for a folder to become a mod folder, so this seem like a valid problem, and not something specific to MO2.

@JeffreyBytes
Copy link
Author

The mods show up just fine in game when managed by MO2, and as you can see from the included screenshot, the content.xml is there in the virtual filesystem. Could it potentially be something with the double backslashes in the file path? I only wonder because the file path listed before it uses single backslashes.

Very odd that it works fine if I manually install the mod, and is only an issue when managed by MO2. I have to assume it is something with MO2's virtual filesystem.

image

@Vectorial1024
Copy link

Ah yes, slashes and the OS... that can be annoying. Different OS have different directory slashes. This really depends on how the Python code is written (I am not a dev here), but ideally we should be using something like https://docs.python.org/3/library/pathlib.html

@bvbohnen
Copy link
Owner

Pathlib is used; the slash differences appear to just be inconsistencies in pathlib behavior (single slashes for printed path, but double slashes when pathlib generates the file not found error).

As for the error itself, I don't use MO2 but it sounds like their vfs implementation means the actual extension files aren't present in the x4 extensions folders in the normal file system. The pipe server is looking for files in the normal location and not finding them. I don't know if there is an easy fix, unless MO2 has a way to apply its vfs to both the game and the pipe server at the same time.

@Forleyor
Copy link

Just a quick note in regards to mod organizer 2, you can use Mod Support APIs + Python Pipe Server in MO2, I just tested this with Mycu's External App which makes use of the pipe server and it does work, to do this you will need to use Kezyma's Root Builder Plugin https://kezyma.github.io/?p=rootbuilder

Mod Organizer 2 by default only manages the standard mod directory in supported games hence the requirement for Root Builder to manage the pipe server being in the root directory.

Saying this though, this isn't an issue with SirNukes mods specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants