-
Notifications
You must be signed in to change notification settings - Fork 377
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
Permission denied with glb saving with api_server only #56
Comments
I also tried to just directly create something in temp from the current terminal. It turns out to be possible to do this, that is, in theory there should be enough rights |
On Windows devices, an opened file cannot be opened again for writing, but this is what is attempted on line 189 and 190, where NamedTemporaryFile opens the file and then mesh.export called from the next line tries to open it again for writing. Change delete=True to delete=False on line 189 and add appropriate temp_file.Close() and os.unlink(temp_file.name) after the mesh is reloaded within that block. Hope this helps. |
Yes! Thank you! It works! Here is the block code, maybe it will help someone else!
|
Hello! I encountered a permission denied error while trying to work with the blender addon. Everything is fine with gradio_app itself, I can save and download meshes. But when working with api_server there is such a problem. I tried changing the temp location for the current session, I even tried running everything from the administrator from the general vs code debugging. Unfortunately nothing helped. I even tried to assign a temp folder inside the current conda environment directory. Always the same result.
2025-01-28 19:38:15 | INFO | stdout | Caught Unknown Error [Errno 13] Permission denied: 'e:\temp\tmpxpov9qha.glb'
2025-01-28 19:38:15 | ERROR | stderr | Traceback (most recent call last):
2025-01-28 19:38:15 | ERROR | stderr | File "E:\Hunyuan3D-2\api_server.py", line 208, in generate
2025-01-28 19:38:15 | ERROR | stderr | file_path, uid = worker.generate(uid, params)
2025-01-28 19:38:15 | ERROR | stderr | File "E:\Hunyuan3D-2\condaenv\lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
2025-01-28 19:38:15 | ERROR | stderr | return func(*args, **kwargs)
2025-01-28 19:38:15 | ERROR | stderr | File "E:\Hunyuan3D-2\api_server.py", line 190, in generate
2025-01-28 19:38:15 | ERROR | stderr | mesh.export(temp_file.name)
2025-01-28 19:38:15 | ERROR | stderr | File "E:\Hunyuan3D-2\condaenv\lib\site-packages\trimesh\base.py", line 2827, in export
2025-01-28 19:38:15 | ERROR | stderr | return export_mesh(mesh=self, file_obj=file_obj, file_type=file_type, **kwargs)
2025-01-28 19:38:15 | ERROR | stderr | File "E:\Hunyuan3D-2\condaenv\lib\site-packages\trimesh\exchange\export.py", line 55, in export_mesh
2025-01-28 19:38:15 | ERROR | stderr | file_obj = open(file_path, "wb")
2025-01-28 19:38:15 | ERROR | stderr | PermissionError: [Errno 13] Permission denied: 'e:\temp\tmpxpov9qha.glb'
The text was updated successfully, but these errors were encountered: