theotherp / nzbhydra2

Usenet meta search
Other
1.23k stars 75 forks source link

_MEI* folder #813

Closed reloxx13 closed 5 months ago

reloxx13 commented 1 year ago

Heya,

I have my system %TEMP% mapped on a Z: RAMDISK.

Now I get _MEI* folders, which are compiled python modules AFAIK on my S: Drive, where NZBHydra is installed on.

My guess is, they should be in %TEMP%, and it is not working, and they are populating and don't get deleted. I would have around hundreds now when I don't delete them manual, it gets annoying, and they wear out the SSD unnecessary.

Latest NZBHydra version on win10x64

grafik

grafik

theotherp commented 1 year ago

Seems to be related to this https://github.com/pyinstaller/pyinstaller/issues/2379

I'll try to have it fixed in the next release.

On Mon, 26 Dec 2022, 12:03 reloxx13, @.***> wrote:

Heya,

i have my system %TEMP% mapped on a Z: RAMDISK.

Now i get _MEI* folders, which are compiled python modules afaik on my S: Drive, where nzbhydra is installed on.

My guess it they should be in %TEMP% and it is not working and they are populating and dont get deleted. I woould have around hundret now when i dont delete them manual and it gets annoying.

latest hydra version on win10x64

[image: grafik] https://user-images.githubusercontent.com/14855001/209541471-2cecfd48-1883-4a85-bb0a-74c1bc1ad6f9.png

[image: grafik] https://user-images.githubusercontent.com/14855001/209541506-07655df0-7b69-40ab-8e92-632bb7510c7e.png

— Reply to this email directly, view it on GitHub https://github.com/theotherp/nzbhydra2/issues/813, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNUA6JD6GUW3UTHCQSSHKDWPF3PHANCNFSM6AAAAAATJSG7VM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

reloxx13 commented 1 year ago

Can you check if u have the _MEI folders in your temp directory or do u have it on hard disk root like me? And only one folder?

To separate if it's two issues, not deleting old _MEI folders and not using the Z Temp folder.

theotherp commented 1 year ago

Does this still happen?

reloxx13 commented 1 year ago

I'll observe and reopen if I get it again.

reloxx13 commented 1 year ago

grafik

still appering, Current version: 5.1.2

theotherp commented 1 year ago

Ah fuck.

theotherp commented 1 year ago

I've updated to a new version of the program I use for the executables. As I can't reproduce this problem I can't say if it helped.

reloxx13 commented 1 year ago

I've updated to a new version of the program I use for the executables. As I can't reproduce this problem I can't say if it helped.

im unsure if its releated to my TEMP in ramdisk, thats why i wanted to know if you have MEI folders in ur %TEMP% dir.

my %TEMP% is on Z:\temp

theotherp commented 1 year ago

I only have one even after multiple starts

reloxx13 commented 1 year ago

so the delete function on app close/start only works with origin c:\temp

as a workaround ill just create a powershell script as scheduled task to delete those folders

theotherp commented 1 year ago

No, my temp folder is c:\users\username\appdata\local\temp

theotherp commented 1 year ago

You can see the linked thread how they prevented the currently used folder from being deleted.

tastyratz commented 6 months ago

so the delete function on app close/start only works with origin c:\temp

as a workaround ill just create a powershell script as scheduled task to delete those folders

Did you end up writing a script? and did it work for you?

These files appear to be protected. I see the folder owner is administrator instead of the user logged in/user running the hydra service. If I take ownership by double clicking the folder I can get in and delete the contents. This does not however scale well as I have just under 3000 _MEI* folders

I tried running a takeown and icacls before deleting/removing but I keep getting permission denied. I'm not sure what is protecting these from me quite yet.

theotherp commented 6 months ago

No idea about the imei files, the temp zip files are removed after usage. It's up to you to delete the older ones.

theotherp commented 6 months ago

Sorry, wrong issue...

theotherp commented 6 months ago

"The _MEIxxxxxx folder is not removed if the program crashes or is killed (kill -9 on Unix, killed by the Task Manager on Windows, “Force Quit” on macOS). Thus if your app crashes frequently, your users will lose disk space to multiple _MEIxxxxxx temporary folders. "

I could change the folder to somewhere I have more control over and periodically clean up.

tastyratz commented 6 months ago

They pyinstaller thread linked was last edited in 2022 and it seems they believe it was resolved. I tried a bunch of different scripts this morning to automate it. I managed to clean up the thousands of folders that exist manually just now by replacing all child object permissions in the folder with the GUI in windows then manually deleting all the MEI / tomcat folders that existed. I have not found a script or automated way to do this.

A cleanup routine afterwards would be easy but it seems to actually be tied to a permissions issue. The folders are created and owned by an account that isn't being used to run the process. In this instance, the folders are owned and access set for the "Administrator" user but NOT the builtin\administrators users group which includes the user account leveraged to run the nzbhydra windows service. THAT user doesn't seem to have access to the MEI folders so it makes sense it couldn't clean it up. It's not getting permissions with folder inheritance either.

So it's a 2 pronged issue. The files need to be created with the right ACL/owner set and a cleanup routine also needs to exist.

theotherp commented 6 months ago

I have hydra running as a windows process and I found four _MEI entries in my temp folder, the oldest one from last year. So it looks like for some reason your service isn't shut down properly.

Unfortunately the newer pyinstaller versions all produce output that don't run on one machine or the other so I have to stick to an older version which may contain bugs such as this one :-/

theotherp commented 6 months ago

I have hydra running as a windows process and I found four _MEI entries in my temp folder, the oldest one from last year. So it looks like for some reason your service isn't shut down properly.

Unfortunately the newer pyinstaller versions all produce output that don't run on one machine or the other so I have to stick to an older version which may contain bugs such as this one :-/

But I'm looking into writing a new wrapper that can be actually compiled for the target OS and architecture which should hopefully fix it.

theotherp commented 5 months ago

@tastyratz @reloxx13 Would you want to test my new wrapper? If so extract nzbhydra2_golang_wrapper.zip to your NZBHydra2 folder, overwriting the existing files. They should behave as before. You will get warnings that your wrapper files are outdated which you can ignore. Restore the wrappers from the latest release whenever you want. Let me know if they work for you.

theotherp commented 5 months ago

This issue is obsolete / fixed with the new windows wrapper which doesn't use python anymore.