Exiled-Team / EXILED

A high-level plugin framework for SCP: Secret Laboratory servers. It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.
https://www.exiled.to/
Other
274 stars 180 forks source link

Path can't be null or whitespace even though it's declared with Linux Installer #213

Closed ErikDombi closed 4 years ago

ErikDombi commented 4 years ago

Installer CLI complains that the path is null despite it being declared.


Exiled.Installer@3.0.1.0
System.ArgumentException: Path cannot be the empty string or all whitespace. (Parameter 'path')
   at System.IO.Directory.CreateDirectory(String path)
   at Exiled.Installer.Program.MainSafe(CommandSettings args)
Read the exception message, read the readme, and if you still don't understand what to do, then contact #support in our discord server with the attached screenshot of the full exception```

Server is running Ubuntu 18.04, and SCP:SL is already installed. 
nash-an commented 4 years ago

Same issue happened with me. Ended up having to install EXILED manually. For reference it was on Debian 10 Buster.

ErikDombi commented 4 years ago

./Exiled.Installer-Linux --path /home/scp/SCP_Server --appdata /home/scp/SCP_Data initial command for reference

joker-119 commented 4 years ago

Unless you have some special $PATH variables set, --appdata should remain the default of ~/.config since that's what the SCP server and Exiled will use to load configs/plugins/etc. --appdata command is only supposed to be used if you're using another user to install exiled than is used to run the server, but it should always end in .config

As for the error itself, that really shouldn't happen. I'm also not sure if the 3.0.1 installer supported the --appdata argument, i believe that was added in 3.1, if that's the case, that may be the cause of your issue.

ErikDombi commented 4 years ago

Command doesn't work without --appdata parameter either

ErikDombi commented 4 years ago

More detailed stacktrace with the latest release


Unhandled exception. System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at System.IO.DirectoryInfo..ctor(String path)
   at Exiled.Installer.CommandSettings.<>c.<.cctor>b__31_1()
   at System.CommandLine.Argument`1.<>c__DisplayClass3_0.<.ctor>b__0()
   at System.CommandLine.Argument.<>c__DisplayClass29_0.<SetDefaultValueFactory>b__0(ArgumentResult _)
   at System.CommandLine.Argument.GetDefaultValue(ArgumentResult argumentResult)
   at System.CommandLine.Parsing.ArgumentResult.Convert(IArgument argument)
   at System.CommandLine.Parsing.ArgumentResult.GetArgumentConversionResult()
   at System.CommandLine.Parsing.ParseResultVisitor.ValidateArgumentResult(ArgumentResult argumentResult)
   at System.CommandLine.Parsing.ParseResultVisitor.ValidateOptionResult(OptionResult optionResult)
   at System.CommandLine.Parsing.ParseResultVisitor.Stop(SyntaxNode node)
   at System.CommandLine.Parsing.SyntaxVisitor.Visit(SyntaxNode node)
   at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList`1 arguments, String rawInput)
   at System.CommandLine.CommandExtensions.GetInvocationPipeline(Command command, String[] args)
   at System.CommandLine.CommandExtensions.InvokeAsync(Command command, String[] args, IConsole console)
   at Exiled.Installer.CommandSettings.Parse(String[] args)
   at Exiled.Installer.Program.Main(String[] args)
   at Exiled.Installer.Program.<Main>(String[] args)
Aborted (core dumped)```
iRebbok commented 4 years ago

@wickedlizerd Could you write the full path of your directory and test Exiled.Installer-Linux --help, it should show the current folder as the default in the path argument.

This issue seems strange to me, because I shouldn't pass an null path. And if this were indeed the case, then I'd get an ArgumentNullReference exception on the path validation for Assembly-CSharp.dll, but as I see from the exception, this didn't happen, and the path validation was successful. It falls at this point if I got correctly.

ErikDombi commented 4 years ago

--help output


Usage:
  Exiled.Installer-Linux [options] [[--] <additional arguments>...]]

Unhandled exception. System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at System.IO.DirectoryInfo..ctor(String path)
   at Exiled.Installer.CommandSettings.<>c.<.cctor>b__31_1()
   at System.CommandLine.Argument`1.<>c__DisplayClass3_0.<.ctor>b__0()
   at System.CommandLine.Argument.<>c__DisplayClass29_0.<SetDefaultValueFactory>b__0(ArgumentResult _)
   at System.CommandLine.Argument.GetDefaultValue(ArgumentResult argumentResult)
   at System.CommandLine.Argument.GetDefaultValue()
   at System.CommandLine.Help.HelpBuilder.DefaultValueHint(IArgument argument, Boolean isSingleArgument)
   at System.CommandLine.Help.HelpBuilder.<>c__DisplayClass40_0.<GetOptionHelpItems>b__7(IArgument argument)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.String.Join(String separator, IEnumerable`1 values)
   at System.CommandLine.Help.HelpBuilder.<GetOptionHelpItems>g__BuildDefaultValueHint|40_6(IEnumerable`1 arguments)
   at System.CommandLine.Help.HelpBuilder.GetOptionHelpItems(ISymbol symbol)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Set`1.UnionWith(IEnumerable`1 other)
   at System.Linq.Enumerable.DistinctIterator`1.FillSet()
   at System.Linq.Enumerable.DistinctIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.CommandLine.Help.HelpBuilder.AddOptions(ICommand command)
   at System.CommandLine.Help.HelpBuilder.Write(ICommand command)
   at System.CommandLine.Invocation.HelpResult.Apply(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.GetResultCode(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(IConsole console)
   at System.CommandLine.CommandExtensions.InvokeAsync(Command command, String[] args, IConsole console)
   at Exiled.Installer.CommandSettings.Parse(String[] args)
   at Exiled.Installer.Program.Main(String[] args)
   at Exiled.Installer.Program.<Main>(String[] args)
Aborted (core dumped)```
iRebbok commented 4 years ago

And then send your current path from where you run Exiled.Installer.

ErikDombi commented 4 years ago

Current path is /home/scp/server Full tree of the directory https://pastebin.com/raw/TyzNmesQ

ErikDombi commented 4 years ago

Issue seems to be caused by Environment.SpecialFolder.ApplicationData being null.

iRebbok commented 4 years ago

^^^

Because it wasn't created, I'll do a PR that will check it.

joker-119 commented 4 years ago

Fix staged for next update.