Skip to content

Cannot be run as a service due to assumption of output terminal #128

@Andyson007

Description

@Andyson007

When trying to run the project as a service (or with dotnet run > /dev/null) it crashes with the error

System.ArgumentOutOfRangeException: maxWidth cannot be less than 1                                        
Parameter name: maxWidth                                                                                  
Actual value was -37.                                                                                     
  at RT.Util.ExtensionMethods.StringExtensions.WordWrap (System.String text, System.Int32 maxWidth, System
.Int32 hangingIndent) [0x00027] in <0d640a61bb06483e8efb82d395a5652f>:0                                   
  at RT.Util.ConsoleLogger.Log (System.UInt32 verbosity, RT.Util.LogType type, System.String message) [0x0
00f9] in <0d640a61bb06483e8efb82d395a5652f>:0                                                             
  at RT.Util.LoggerBase.Info (System.String message) [0x00000] in <0d640a61bb06483e8efb82d395a5652f>:0    
  at RT.PropellerApi.PropellerUtil.LoadSettings (System.String settingsPath, RT.Util.LoggerBase log, Syste
m.Boolean firstRunEver) [0x00016] in <4f07b967536749f38061903d4045edaf>:0                                 
  at RT.PropellerApi.PropellerUtil.RunStandalone (System.String settingsPath, RT.PropellerApi.IPropellerMo
dule module, System.Boolean propagateExceptions) [0x00019] in <4f07b967536749f38061903d4045edaf>:0        
  at KtaneWeb.Run.Execute () [0x0001a] in <66c21e9ccf9a4ab9bbc861481a4813a9>:0                            
  at Program.<Main>$ (System.String[] args) [0x00035] in <66c21e9ccf9a4ab9bbc861481a4813a9>:0             
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: maxWidth cannot be less than 1     
Parameter name: maxWidth                                                                                  
Actual value was -37.                                                                                     
  at RT.Util.ExtensionMethods.StringExtensions.WordWrap (System.String text, System.Int32 maxWidth, System
.Int32 hangingIndent) [0x00027] in <0d640a61bb06483e8efb82d395a5652f>:0                                   
  at RT.Util.ConsoleLogger.Log (System.UInt32 verbosity, RT.Util.LogType type, System.String message) [0x0
00f9] in <0d640a61bb06483e8efb82d395a5652f>:0                                                             
  at RT.Util.LoggerBase.Info (System.String message) [0x00000] in <0d640a61bb06483e8efb82d395a5652f>:0    
  at RT.PropellerApi.PropellerUtil.LoadSettings (System.String settingsPath, RT.Util.LoggerBase log, Syste
m.Boolean firstRunEver) [0x00016] in <4f07b967536749f38061903d4045edaf>:0                                 
  at RT.PropellerApi.PropellerUtil.RunStandalone (System.String settingsPath, RT.PropellerApi.IPropellerMo
dule module, System.Boolean propagateExceptions) [0x00019] in <4f07b967536749f38061903d4045edaf>:0        
  at KtaneWeb.Run.Execute () [0x0001a] in <66c21e9ccf9a4ab9bbc861481a4813a9>:0                            
  at Program.<Main>$ (System.String[] args) [0x00035] in <66c21e9ccf9a4ab9bbc861481a4813a9>:0

Following the stack trace this is presumeably caused by the line

var log = GetLogger(true, settings.LogFile, settings.LogVerbosity);

in RT.PropellerApi.PropellerUtil.RunStandalone. (API/ProperrelUtil.cs in the Propeller repository).
As this assumes that the output is a console. (the first parameter to GetLogger is isConsole).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions