CodeCrafter
Hi,
 
The following error appears every time I try to generate a program for the OpenPLC Runtime. This function works fine with the same project file on a different computer, and it was working on my computer previously. I tried reinstalling the OpenPLC editor, but it didn’t help.
 
app-title:
beremiz
app-version:
3.0
Release: 2024-10-16
cwd:
C:\Users\x.x\OpenPLC_Editor
date:
Thu Nov 7 11:04:18 2024
e-type:
<class 'PermissionError'>
e-value:
[WinError 5] Käyttö estetty: 'C:\\Temp\\xx\\xx\\Source\\build\\extra_files'
locals:
path: 'C:\\Temp\\xx\\xx\\Source\\build\\extra_files'
onerror: <function rmtree.<locals>.onerror at 0x000001944892AF70>
scandir_it: <nt.ScandirIterator object at 0x00000194441EAEF0>
entries: []
platform:
Windows-10-10.0.19045-SP0
python-version:
3.9.10
traceback:
File "C:\Users\x.x\OpenPLC_Editor\.\editor\BeremizIDE.py", line 836, in OnMenu
getattr(self.CTR, method)()
File "C:\Users\x.x\OpenPLC_Editor\.\editor\ProjectController.py", line 2244, in _generateOpenPLC
if (self._Build() is True):
File "C:\Users\x.x\OpenPLC_Editor\.\editor\ProjectController.py", line 1307, in _Build
if not self._Generate_runtime():
File "C:\Users\x.x\OpenPLC_Editor\.\editor\ProjectController.py", line 1381, in _Generate_runtime
shutil.rmtree(extrafilespath)
File "C:\Users\x.x\OpenPLC_Editor\python\lib\shutil.py", line 749, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\x.x\OpenPLC_Editor\python\lib\shutil.py", line 631, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\x.x\OpenPLC_Editor\python\lib\shutil.py", line 629, in _rmtree_unsafe
os.rmdir(path)
<class 'PermissionError'>: [WinError 5] Käyttö estetty: 'C:\\Temp\\xx\\xx\\Source\\build\\extra_files'
wx-platform:
__WXMSW__
wx-version:
4.2.0
Reply 0 0
CodeCrafter
Reply 0 0
CodeCrafter
However, I need to delete the "build" folder every time before generating a program; otherwise, the same error will occur. What could be causing this?
Reply 0 0
thiagoralves
Update your editor and you won't see that anymore. It is always good to run on the latest version of the software, especially before reporting bugs as that could've been fixed on newer releases. What is happening on your case is that Windows (or some protection software on your computer) is not happy when OpenPLC tries to clean the build folder as it thinks OpenPLC is deleting your files. The build folder is a cache generated every time you compile something. Ideally it is a good practice to clean that cache before compiling again, so OpenPLC deletes that folder automatically for you every time you compile a project. On your older version of the editor, when the clean action is blocked, you see the error above. The new version doesn't prevent the block, but instead just go around that ignoring the block and trying to continue the compilation process. This will work on most cases. It also warns you on the console if it wasn't able to delete the build folder properly, so if you run into any compilation issues, you can then manually delete the build folder to see if that fixes the compilation issue.
Reply 0 0
CodeCrafter
Hi,
 
Thank you for the prompt feedback. I didn’t realize that the download does not directly include the latest software version.
 
After updating, the editor does indeed warn that the clean function is blocked, but compiling still stops every time with the same error if the folder is not removed manually. I will forward this issue to our IT support, as I don’t have access to the protection software.
 
I have a fairly complex project that was originally developed with version 1.33, and I am now using the latest editor version to make minor changes. The only issue with compiling is the one already reported; otherwise, the project compiles successfully, and the editor generates an ST file. Given the large version gap, do you think that the entire project’s functionality needs to be retested, or has the compiler remained unchanged?
Reply 0 0
CodeCrafter
Here is the latest bug report:
 
app-title:
beremiz
app-version:
3.0
Release: 2024-11-05
cwd:
C:\Users\x\OpenPLC_Editor
date:
Fri Nov 8 07:37:21 2024
e-type:
<class 'PermissionError'>
e-value:
[WinError 5] Käyttö estetty: 'C:\\Users\\xx\\xx\\Source\\build\\extra_files'
locals:
path: 'C:\\Users\\xx\\xx\\Source\\build\\extra_files'
onerror: <function rmtree.<locals>.onerror at 0x000001C609C26820>
scandir_it: <nt.ScandirIterator object at 0x000001C60F656C30>
entries: []
platform:
Windows-10-10.0.19045-SP0
python-version:
3.9.10
traceback:
File "C:\Users\xx\OpenPLC_Editor\.\editor\BeremizIDE.py", line 836, in OnMenu
getattr(self.CTR, method)()
File "C:\Users\xx\OpenPLC_Editor\.\editor\ProjectController.py", line 2244, in _generateOpenPLC
if (self._Build() is True):
File "C:\Users\xx\OpenPLC_Editor\.\editor\ProjectController.py", line 1307, in _Build
if not self._Generate_runtime():
File "C:\Users\xx\OpenPLC_Editor\.\editor\ProjectController.py", line 1381, in _Generate_runtime
shutil.rmtree(extrafilespath)
File "C:\Users\xx\OpenPLC_Editor\python\lib\shutil.py", line 749, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\xx\OpenPLC_Editor\python\lib\shutil.py", line 631, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\xx\OpenPLC_Editor\python\lib\shutil.py", line 629, in _rmtree_unsafe
os.rmdir(path)
<class 'PermissionError'>: [WinError 5] Käyttö estetty: 'C:\\Users\\xx\\xx\\Source\\build\\extra_files'
wx-platform:
__WXMSW__
wx-version:
4.2.0
Reply 0 0
thiagoralves
Thanks for the bug report! It seems that I missed another entry where files are being deleted. I circumvented that part as well, so now you should not be getting exception errors anymore. Update your editor and let me know if that worked.
Reply 0 0
Write a reply...
Reply