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

Persistent error when deleting (Windows Defender backups) #1021

Closed
hendrst opened this issue Sep 25, 2020 · 18 comments
Closed

Persistent error when deleting (Windows Defender backups) #1021

hendrst opened this issue Sep 25, 2020 · 18 comments
Assignees
Labels
bug priority:high Fix sooner than later
Milestone

Comments

@hendrst
Copy link

hendrst commented Sep 25, 2020

Bleachbit 4.0.0 on Windows 10.

Receive the following error during execution of clean, no errors show up during preview.

[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpasbase.vdm
[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpasdlta.vdm
[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpavbase.vdm
[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpavdlta.vdm
[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpengine.dll
[WinError 5] Access is denied.: Command to delete C:\ProgramData\Microsoft\Windows Defender\Definition Updates\Backup\mpengine.lkg

@az0
Copy link
Member

az0 commented Sep 26, 2020

The access is denied error looks like an issue fixed in BleachBit 4.1.0 beta. Please update, test again, and write a comment here to let me know how it went.

@az0 az0 self-assigned this Sep 26, 2020
@az0 az0 added the bug label Sep 26, 2020
@az0 az0 added this to the 4.2 milestone Sep 26, 2020
@az0 az0 closed this as completed Sep 26, 2020
@hendrst
Copy link
Author

hendrst commented Sep 28, 2020

Downloaded and installed 4.1.0 beta. Still receiving 'Access is denied' error on those same folders/files.

@az0 az0 modified the milestones: 4.2, 4.4 Dec 16, 2020
@az0 az0 reopened this Dec 16, 2020
@az0
Copy link
Member

az0 commented Dec 16, 2020

@hendrst
Would you kindly also test BleachBit 4.1.1 beta?

@hendrst
Copy link
Author

hendrst commented Dec 17, 2020

Still getting that error. FWIW, I tried to delete them manually as Admin, but they wouldn't budge.

BleachBitError20201217

@az0 az0 added the priority:high Fix sooner than later label Jan 30, 2021
@az0 az0 removed their assignment Apr 25, 2021
@rados
Copy link
Contributor

rados commented May 10, 2021

@az0
I can handle this one.

@abitrolly
Copy link
Contributor

@rados if they can not be even removed by admin, what are you going to do?

@rados
Copy link
Contributor

rados commented May 10, 2021

@rados if they can not be even removed by admin, what are you going to do?

Will investigate why those files are special and if there really is no way to delete them will propose a way to inform the user that we are aware...

@az0
Copy link
Member

az0 commented May 10, 2021

@rados
@abitrolly
When a file cannot be deleted at the moment (e.g., some Internet Explorer files), BleachBit normally schedules it to be deleted on Windows reboot, and this requires admin permissions. It may be a fault in the fallback mechanism, like a different kind of special file generating a different kind of error.

@abitrolly
Copy link
Contributor

Is it possible to trace who holds the file on Windows?

@az0
Copy link
Member

az0 commented May 10, 2021 via email

@hendrst
Copy link
Author

hendrst commented May 10, 2021

Is it possible to trace who holds the file on Windows?

Here are the files in question:

Capture2

With the exception of mpengine.dll all are owned by SYSTEM.

Capture

@abitrolly
Copy link
Contributor

For general purpose, do you mean to kill the process? This can cause issues.

Not automatically, but at least tell the user.

@az0
Copy link
Member

az0 commented May 11, 2021

For general purpose, do you mean to kill the process? This can cause issues.

Not automatically, but at least tell the user.

Sometimes that would be helpful, but many users wouldn't want to or wouldn't know how to kill Internet Explorer or Windows Defender.

In the case of Windows Defender, we look into pausing the services like is done for cleaning Windows Updates.

@az0
Copy link
Member

az0 commented May 18, 2021

#1021 looks like #1004

The issue relates to a rule in windows_defender.xml added by Tobias in 2019 in revision 6ef3f67

<action command="delete" search="walk.files" path="%CommonAppData%\Microsoft\Windows Defender\Definition Updates\Backup\"/>

@az0 az0 changed the title Persistent error when deleting Persistent error when deleting (Windows Defender backups) May 18, 2021
@rados
Copy link
Contributor

rados commented May 26, 2021

@az0
I've tried both your suggestions - to pause the service like we do with Windows Update and to mark the files for removal on reboot. Both don't work with the same reason - Access Denied. Also stopping Windows Defender Antivirus through the interface or through renaming its exe file (MsMpEng.exe) couldn't allow me to manipulate its Backup folder. It seems like the lock is on some kind of a folder level not the on the files themselves. This suggestion comes from a test that I've performed. I've manually added some experimental empty subfolders in Backup folder and couldn't delete them as well (unless in Safe Mode). The parent folder has similar behavior - you can add an empty folder but cannot delete it.

Also I've checked Windows 7 and those problems doesn't exists there, i.e. the Backup files could be manipulated. This makes me think that probably Tobias have based the addition of the Backup folder on Windows 7 behavior or perhaps on some early version of Windows 10. @Tobias-B-Besemer could you remember? So for now my suggestion is to exclude the Defender Backup lines from the respective cleaner xml file.

@az0
Copy link
Member

az0 commented May 29, 2021

So for now my suggestion is to exclude the Defender Backup lines from the respective cleaner xml file.

I agree. It seems there is an anti-tampering system.

@az0 az0 modified the milestones: 4.4, 4.6 Jun 13, 2021
@hendrst hendrst closed this as completed Sep 3, 2021
@hendrst
Copy link
Author

hendrst commented Sep 3, 2021

Closed

@hendrst hendrst reopened this Sep 3, 2021
@hendrst hendrst closed this as completed Sep 3, 2021
@m86mitch
Copy link

Running the system in safe mode fixes this issue and allows the specified files to be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority:high Fix sooner than later
Projects
None yet
Development

No branches or pull requests

5 participants