chickensoft-games / GodotEnv

Manage Godot versions and addons from the command line on Windows, macOS, and Linux.

Home Page:https://www.nuget.org/packages/Chickensoft.GodotEnv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System.NullReferenceException When Running `godotenv godot list`

gustaflindqvist opened this issue · comments

I encountered an error while attempting to list the Godot installations using the godotenv command. Could it be Dropbox?

Here are the specifics:

Command:

godotenv godot list

Error Message:

ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__35_0(GodotInstallation i) in /Users/joanna/Dropbox/GameDev/Chickensoft/chicken/GodotEnv/src/features/godot/domain/GodotRepository.cs:415
  ...
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

Environment:

  • OS: macOS Sonoma 14.0
  • godotenv Version: 1.0.0
  • .NET Runtime Version: .NET 7

Thanks for letting me know! I wasn't able to reproduce.

  • Did you have any existing godot installs made with godotenv to list?
  • Can you try reproducing on the latest version?

I was unable to reproduce this on macOS Sonoma 14.0 using the latest version of godotenv (1.2.0).

It would be interesting to see if eliminating Dropbox from the equation resolves the issue.

Thanks for letting me know! I wasn't able to reproduce.

* Did you have any existing godot installs made with godotenv to list?

* Can you try reproducing on the latest version?

Existing godot install was godot_dotnet_4_2_0_dev4

After upgrade to 1.2.0 I got this version:

$ godotenv --version
1.2.0+df2305e551dc696828a086b91c52cf131e642c5d

and now I got this error:

ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.<>c.<GetInstallationsList>b__38_0(GodotInstallation i) in /Users/joanna/Dropbox/GameDev/Chickensoft/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:448
  at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
  at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
  at System.Linq.OrderedEnumerable`1.ToList()
  at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
  at Chickensoft.GodotEnv.Features.Godot.Domain.GodotRepository.GetInstallationsList() in /Users/joanna/Dropbox/GameDev/Chickensoft/GodotEnv/GodotEnv/src/features/godot/domain/GodotRepository.cs:420
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ListLocalVersions(ILog log, IGodotRepository godotRepo) in /Users/joanna/Dropbox/GameDev/Chickensoft/GodotEnv/GodotEnv/src/features/godot/commands/GodotListCommand.cs:25
  at Chickensoft.GodotEnv.Features.Addons.Commands.GodotListCommand.ExecuteAsync(IConsole console) in /Users/joanna/Dropbox/GameDev/Chickensoft/GodotEnv/GodotEnv/src/features/godot/commands/GodotListCommand.cs:53
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

Could this be connected to godotenv godot env setup maybe, where it's says source /.zshrc? I'm using bash, since I'm old school, and I guess it won't add needed env to my shell?

I was unable to reproduce this on macOS Sonoma 14.0 using the latest version of godotenv (1.2.0).

It would be interesting to see if eliminating Dropbox from the equation resolves the issue.

It would be interesting to see if eliminating Dropbox from the equation resolves the issue.

@justinhhorner I believe the dropbox paths from my computer were baked into the debug symbols somehow — there isn't any reference like that in the actual codebase. So I don't think that's a factor here.

@gustaflindqvist maybe try running godotenv godot env path and manually deleting everything in the godotenv/godot/versions directory where it saves Godot and try re-installing?

Could this be connected to godotenv godot env setup maybe, where it's says source /.zshrc?

No, I don't think so. Running godotenv godot env setup will just set an environment variable so you can run $GODOT from anywhere for cli usage. GodotEnv doesn't actually use the environment variable, it just maintains it.

The new error message is more helpful, but I'm still not sure how anything on that line is coming back null without actually being able to debug on your computer. If you want, you can actually clone the repo and run the tool locally to debug it — that would be tremendously helpful to me if you're able to make the effort.

It would be interesting to see if eliminating Dropbox from the equation resolves the issue.

@justinhhorner I believe the dropbox paths from my computer were baked into the debug symbols somehow — there isn't any reference like that in the actual codebase. So I don't think that's a factor here.

@gustaflindqvist maybe try running godotenv godot env path and manually deleting everything in the godotenv/godot/versions directory where it saves Godot and try re-installing?

Yeah, by manually deleting everything inside godotenv/godot/versions directory solved the problem. 👍🏻 🙈

Okay, maybe something went wrong during the install. Will close this until it pops up again (if it does at all).