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

"Failed to clean the project build folder" error #135

Open
bigjeff5 opened this issue Dec 13, 2024 · 2 comments
Open

"Failed to clean the project build folder" error #135

bigjeff5 opened this issue Dec 13, 2024 · 2 comments

Comments

@bigjeff5
Copy link

When recompiling, if I don't manually delete the build folder and all of its contents I get the following error:

Failed to clean the project build folder: C:\Users\username\OneDrive\Documents\PLC Programing\Workspace\FBD Project\build\extra_files
Access is denied (Error Code: 13)
Try to manually remove the build folder inside your project path if you have issues during compilation

When this happens, nothing can be compiled until you restart OpenPLC. I'm assuming one of the underlying python programs crashes and doesn't recover.

This is on a Windows 10 machine without Admin rights. Admin rights should not be needed, because everything is installed in my user share, but I suspect with admin rights this might not happen. I cannot test this at the moment, however.

I've included one of the bug reports for more info. It looks like the rmtree function in shutils.sys is the one having the issue.
bug_report_2024_12_13__07-45-48.txt

@bigjeff5
Copy link
Author

It looks like adding:

if not os.access(path, os.W_OK):
  os.chmod(path, stat.S_IWUSR)

before the rmtree_unsafe os.rmdir(path) execution in shutil.py (line 630) fixes the problem.

@thiagoralves
Copy link
Owner

Your bug report is not from the latest version. Make sure you update your editor to the last version and check if the error persists

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

2 participants