eumario / godot-manager

A Project, Version and Addons/Plugins manager for Godot Game Engine.
MIT License
332 stars 19 forks source link

Project fails when "uninstalling" addon #23

Closed GammaGames closed 2 years ago

GammaGames commented 2 years ago

Describe the bug I tried to install some addons, and it went horribly wrong. I reverted all the changes in git and, when I tried to unselect them in the manager, the editor crashes:

WARNING: XOpenIM failed
     at: initialize (platform/x11/os_x11.cpp:197)
WARNING: XCreateIC couldn't create xic
     at: initialize (platform/x11/os_x11.cpp:494)
OpenGL ES 3.0 Renderer: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
OpenGL ES Batching: ON

Mono: Log file is: '/home/jlieberg/.local/share/Godot-Manager/mono/mono_logs/2022-05-11_20.49.22_19739.log'
ERROR: Error opening file '/home/jlieberg/Documents/the-king-hungers/icon.png'.
   at: load_image (core/io/image_loader.cpp:55)

Unhandled Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/jlieberg/Documents/the-king-hungers/addons/godot-yaml/x11'.
  at System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String path, System.Boolean ignoreNotFound) [0x00032] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) [0x00048] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) [0x00042] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles (System.String directory, System.String expression, System.IO.EnumerationOptions options) [0x00014] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.InternalEnumeratePaths (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) [0x0003c] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.EnumerateFiles (System.String path, System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.EnumerateFiles (System.String path) [0x0000b] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at PluginInstaller.DeleteImports (System.String path) [0x00000] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at PluginInstaller.Uninstall (System.String instLocation, System.Boolean showDialogs) [0x00215] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at EditProject.UpdatePlugins () [0x00158] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at EditProject.OnSaveBtnPressed () [0x0004f] in <a1cad710b5c64c1685d84a0bb134b18b>:0 

Unhandled Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/jlieberg/Documents/the-king-hungers/addons/godot-yaml/x11'.
  at System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String path, System.Boolean ignoreNotFound) [0x00032] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) [0x00048] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) [0x00042] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles (System.String directory, System.String expression, System.IO.EnumerationOptions options) [0x00014] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.InternalEnumeratePaths (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) [0x0003c] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.EnumerateFiles (System.String path, System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at System.IO.Directory.EnumerateFiles (System.String path) [0x0000b] in <6a7c203f6f7a4f07b7fa766077730d49>:0 
  at PluginInstaller.DeleteImports (System.String path) [0x00000] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at PluginInstaller.Uninstall (System.String instLocation, System.Boolean showDialogs) [0x00215] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at EditProject.UpdatePlugins () [0x00158] in <a1cad710b5c64c1685d84a0bb134b18b>:0 
  at EditProject.OnSaveBtnPressed () [0x0004f] in <a1cad710b5c64c1685d84a0bb134b18b>:0

The mono log file doesn't say anything, but I'm guessing it's that the files can't be removed so they die.

To Reproduce Steps to reproduce the behavior:

  1. Add addons to project
  2. Remove addons by deleting folder
  3. Try to remove addons
  4. Crash

Expected behavior A warning or something? It doesn't seem that crucial tbh, just don't die

Complete the Following:

eumario commented 2 years ago

This is an Error with detecting the folder. When you reverted the changes with Git, it removed the folders and files that were installed with the Addons, but Godot Manager is expecting the Folders / Files to be there, so when it doesn't find them, it errors out trying to load the directory listing for deleting files in the specified folder. Fixing this now.

GammaGames commented 2 years ago

You work FAST, thank you for the project!

eumario commented 2 years ago

I was working on the project when you made the bug report, It was a simple fix, and fairly easy to implement. ;-)