godot: modules/mono/mono_gd/gd_mono_utils.cpp:371 - System.ArgumentException: Illegal characters in path.
Godot version: v3.2.2.beta4.mono.official
OS/device including version:
Windows 10 Pro 1909
Issue description:
When opening a project, in the editor output, I get flooded with about 20 of the following errors:
modules/mono/mono_gd/gd_mono_utils.cpp:371 - System.ArgumentException: Illegal characters in path
These then change to:
modules/mono/mono_gd/gd_mono_utils.cpp:371 - System.NullReferenceException: Object reference not set to an instance of an object
which continue as long as the editor is open.
These are expanded in the console as:
Unhandled Exception:
System.ArgumentException: Illegal characters in path.
at System.IO.Path.Combine (System.String path1, System.String path2) [0x0003e] in <34e7ab706f1141f9b981d74fbe2f5560>:0
at GodotTools.Utils.OS+<>c__DisplayClass39_0.<PathWhichWindows>b__1 (System.String dir) [0x00000] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () [0x00048] in <fdc50bfd761741c0a0c2f052bf074a1c>:0
at System.Linq.Enumerable+<SelectManyIterator>d__167`3[TSource,TCollection,TResult].MoveNext () [0x000d1] in <fdc50bfd761741c0a0c2f052bf074a1c>:0
at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) [0x0004f] in <fdc50bfd761741c0a0c2f052bf074a1c>:0
at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00000] in <fdc50bfd761741c0a0c2f052bf074a1c>:0
at GodotTools.Utils.OS.PathWhichWindows (System.String name) [0x00111] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at GodotTools.Utils.OS.PathWhich (System.String name) [0x0000e] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at GodotTools.BuildManager.Initialize () [0x00023] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at GodotTools.GodotSharpEditor.EnablePlugin () [0x00453] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
ERROR: debug_send_unhandled_exception_error: System.ArgumentException: Illegal characters in path.
At: modules/mono/mono_gd/gd_mono_utils.cpp:371
and
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at GodotTools.HotReloadAssemblyWatcher.RestartTimer () [0x00000] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at GodotTools.HotReloadAssemblyWatcher._Notification (System.Int32 what) [0x00008] in <bf243baa94fe41ccbd98c8bbc3a78900>:0
at (wrapper managed-to-native) System.Threading.Monitor.Exit(object)
at Godot.GodotTaskScheduler.ExecuteQueuedTasks () [0x00050] in <e870abd78d2142af92585d192bb3eb0a>:0
at Godot.GodotTaskScheduler.Activate () [0x00001] in <e870abd78d2142af92585d192bb3eb0a>:0
at (wrapper native-to-managed) Godot.GodotTaskScheduler.Activate(Godot.GodotTaskScheduler,System.Exception&)
ERROR: debug_send_unhandled_exception_error: System.NullReferenceException: Object reference not set to an instance of an object
At: modules/mono/mono_gd/gd_mono_utils.cpp:371
respectively.
Steps to reproduce:
- Run Godot 3.2.2 beta4 mono win64.
- Create a new project. I used a new folder:
C:\Users\Marcel\Downloads\Godot\Test Mono Beta 4
Minimal reproduction project: None required.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 27 (14 by maintainers)
Ok, managed to reproduce it by visiting here…
https://www.soscisurvey.de/tools/view-chars.php
…I copied the space between ‘string…’ and ‘or’ which contains a few odd characters and pasted onto the end of one my path directories in the windows ‘edit text’ section of its environment var’s editors.
Tried to fire up Godot and I’m back to seeing the issue, remove the characters and all’s well again.
If the problem was with illegal characters in PATH, we can make
PathWhich
check for that. Still weird to have such bad entries in PATH. I hope that’s indeed the case and not some encoding problem on our code.@xahon I’ve opened #64085 that should fix your issue, or at least it should prevent the exception, it’d be interesting to know how invalid characters ended up in the
mono/editor/editor_path_optional
setting. Could you check what you have that value set to?I had this issue but solved it with a hint from @neikeq in the comment above regarding the environment PATH variable. I first went through and checked all the directories / folders actually existed in my PATH var and was still getting the error.
I echoed out PATH into a terminal session and all looked ok there… So I went into the Windows system properties environment variables GUI and in there you we get a list of the elements making up the path in a list, all looked ok still…
So I hit the ‘edit text’ button you get there and scanning through and sure enough there was a load of whitespace or maybe non-printable chars, anyway, removed those characters out and everything started working again.
😃
cmd
in the Run dialog to open a command prompt.cd <path>
command to reach the directory where your Godot executable is located. You can drag-and-drop a folder to the command prompt to get its path.<name of Godot executable>.exe C:\Path\to\project.godot
to open the project directly in the editor. (The project must be opened directly, as the project manager won’t pass environment variables to the editor.)