bhartsfield
06/09/2022, 4:19 PMbhartsfield
06/09/2022, 4:20 PMbhartsfield
06/09/2022, 4:24 PMbhartsfield
06/09/2022, 5:27 PMserver start --console --debug
to server stop && server start --console --debug
seems to be working so far.
After that update, I've done the following multiple times and the server has been coming back up consistently the first time
• manually stopped and started the service using the Windows service manager UI
• manually restarted the service using the service manager UI
• used stop-service and start-service PowerShell commands
• used restart-service PowerShell commands
• rebooted the server without stopping the service first (because the service is set to auto start delayed)
• rebooted after stopping the service first
I'm going to repeat those tests a few more times each before calling it a successful workaround (provided you can't think of any negative impact I'm not seeing yet, @bdw429s).bdw429s
06/09/2022, 5:31 PMserver stop
command checks the status (which will inherently remove any invalid PID files), but you may as well just run a server status
command in that case. I'm not actually aware of the stop command checking the status anywhere.bdw429s
06/09/2022, 5:32 PMbdw429s
06/09/2022, 5:32 PMbdw429s
06/09/2022, 5:32 PMbhartsfield
06/09/2022, 5:32 PMbdw429s
06/09/2022, 5:33 PMbdw429s
06/09/2022, 5:33 PMbhartsfield
06/09/2022, 5:33 PMbdw429s
06/09/2022, 5:33 PMbhartsfield
06/09/2022, 5:33 PMbdw429s
06/09/2022, 5:33 PMbdw429s
06/09/2022, 5:35 PMpreServerStart
fires right before the "is running?" check and I think that's when dotenv loads, so in theory it should be therebhartsfield
06/09/2022, 5:35 PMdotenv set box_config_nonInteractiveShell true
but that didn't seem to make a differencebdw429s
06/09/2022, 5:35 PM.env
file in the web root?bdw429s
06/09/2022, 5:35 PMbhartsfield
06/09/2022, 5:36 PMbdw429s
06/09/2022, 5:36 PM.env
file, that wold also apply when you do a normal server start
which I wouldn't consider desirable.bdw429s
06/09/2022, 5:36 PMbhartsfield
06/09/2022, 5:37 PMbdw429s
06/09/2022, 5:38 PMbdw429s
06/09/2022, 5:38 PMSorry, are you saying it should go in the start command that NSSM is using?That's where it makes the most sense, since you really only want that flag set when specifically starting the server as a service
bhartsfield
06/09/2022, 5:39 PMbdw429s
06/09/2022, 5:39 PMnssm.exe set "my-service" AppEnvironmentExtra box_config_nonInteractiveShell=true
bdw429s
06/09/2022, 5:39 PMbhartsfield
06/09/2022, 5:39 PMbdw429s
06/09/2022, 5:39 PMbdw429s
06/09/2022, 5:40 PMbdw429s
06/09/2022, 5:40 PMbhartsfield
06/09/2022, 5:43 PMbhartsfield
06/09/2022, 5:44 PMbdw429s
06/09/2022, 5:56 PMbhartsfield
06/09/2022, 5:56 PMbdw429s
06/09/2022, 5:56 PMbdw429s
06/09/2022, 5:56 PMbdw429s
06/09/2022, 5:57 PMbdw429s
06/09/2022, 5:57 PMtask service create
bhartsfield
06/09/2022, 6:00 PMbdw429s
06/09/2022, 6:04 PMbdw429s
06/09/2022, 6:05 PMbdw429s
06/09/2022, 6:05 PMbdw429s
06/09/2022, 6:07 PMwhile( true ) sleep( 1000 )
after it
channel = rabbitClient
.startRPCServer(
queue='RPC_requests',
consumer=(method,args)=>{
return "hello world";
}
);
And then our app sends it a requests via message queues
result = rabbitClient.RPCClient( 'RPC_requests' ).sayHello();
bdw429s
06/09/2022, 6:07 PMbhartsfield
06/09/2022, 6:07 PMbhartsfield
06/09/2022, 6:07 PMbdw429s
06/09/2022, 6:08 PMbdw429s
06/09/2022, 6:09 PMbhartsfield
06/09/2022, 6:09 PMbdw429s
06/09/2022, 6:09 PMbhartsfield
06/09/2022, 6:10 PMbdw429s
06/09/2022, 6:10 PMbdw429s
06/09/2022, 6:10 PMbdw429s
06/09/2022, 6:11 PMbhartsfield
06/09/2022, 6:11 PMbdw429s
06/09/2022, 6:12 PMRMQ events*
meant, like if that was some special feature of rabbit I hadn't heard ofbdw429s
06/09/2022, 6:12 PMbhartsfield
06/09/2022, 6:12 PMbdw429s
06/09/2022, 6:13 PMbdw429s
06/09/2022, 6:13 PMbhartsfield
06/09/2022, 6:13 PMbhartsfield
06/09/2022, 6:13 PMbdw429s
06/09/2022, 6:13 PMbdw429s
06/09/2022, 6:14 PMbdw429s
06/09/2022, 6:14 PMuser_notifications.bobby
and it pops up in only your browser (if you're online)bhartsfield
06/09/2022, 6:15 PMbdw429s
06/09/2022, 6:15 PMadmin_notification_dashboard
and all admin users with that dashboard open get the messagebdw429s
06/09/2022, 6:15 PMbhartsfield
06/09/2022, 6:15 PMbdw429s
06/09/2022, 6:16 PMbdw429s
06/09/2022, 6:16 PMbdw429s
06/09/2022, 6:16 PMbhartsfield
06/09/2022, 6:16 PMbdw429s
06/09/2022, 6:16 PMbdw429s
06/09/2022, 6:17 PMbhartsfield
06/09/2022, 6:18 PMbdw429s
06/09/2022, 6:18 PMbdw429s
06/09/2022, 6:19 PMbhartsfield
06/09/2022, 6:19 PMbdw429s
06/09/2022, 6:19 PMbhartsfield
06/09/2022, 6:20 PMbdw429s
06/09/2022, 6:20 PMbhartsfield
06/09/2022, 6:20 PMbhartsfield
06/09/2022, 6:22 PMbhartsfield
06/09/2022, 8:54 PMconfig set nonInteractiveShell=true
(and confirmed it stuck with config show
)
no matter where I put it, it didn't stop the problem of the start hanging while waiting on input.
server status && server start ....
also didn't work as a replacement for server stop && server start ...
it just got the whole thing caught in a loop as it filled up %commandbox_home%\.logs\server.out.log with these
[ERROR] runwar.context: java.net.ConnectException: Connection refused: connect
[ERROR] runwar.context: at java.base/java.net.PlainSocketImpl.connect0(Native Method)
[ERROR] runwar.context: at java.base/java.net.PlainSocketImpl.socketConnect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.<init>(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.<init>(Unknown Source)
[ERROR] runwar.context: at runwar.Stop.stopServer(Stop.java:26)
[ERROR] runwar.context: at runwar.Server.startServer(Server.java:206)
[ERROR] runwar.context: at runwar.Start.main(Start.java:50)
[INFO ] runwar.context: Could not stop server. Are you sure it is running, and listing for stop requests on port 49909?
[ERROR] runwar.context: java.net.ConnectException: Connection refused: connect
[ERROR] runwar.context: at java.base/java.net.PlainSocketImpl.connect0(Native Method)
[ERROR] runwar.context: at java.base/java.net.PlainSocketImpl.socketConnect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.connect(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.<init>(Unknown Source)
[ERROR] runwar.context: at java.base/java.net.Socket.<init>(Unknown Source)
[ERROR] runwar.context: at runwar.Stop.stopServer(Stop.java:26)
[ERROR] runwar.context: at runwar.Server.startServer(Server.java:206)
[ERROR] runwar.context: at runwar.Start.main(Start.java:50)
[INFO ] runwar.context: Could not stop server. Are you sure it is running, and listing for stop requests on port 50025?
bhartsfield
06/09/2022, 8:55 PMserver stop && server start...
workaround is holding strong thoughbdw429s
06/09/2022, 10:14 PMserver stop
so I'm not sure how it would possibly be running when you ran server status
bdw429s
06/09/2022, 10:16 PMit didn't stop the problem of the start hanging while waiting on input.And you • confirmed the thread was specifically running the mulitSelect code? • Are on CommandBox 5.5.2? It should really be impossible to hit that code path when non interactive shell is turned on.
bdw429s
06/09/2022, 10:17 PM/**
* Is the current terminal interactive?
* @returns boolean
**/
function isTerminalInteractive() {
// Check for config setting called "nonInteractiveShell"
if( configService.settingExists( 'nonInteractiveShell' ) && isBoolean( configService.getSetting( "nonInteractiveShell" ) ) ) {
return !configService.getSetting( "nonInteractiveShell" );
// Next check for an Environment Variable called "CI" that is set
} else if( systemSettings.getSystemSetting( 'CI', '__NOT_SET__' ) != '__NOT_SET__' ) {
return false;
// System.console() will return null is the stndin or stndout is not a TTY
} else if( isNull( createObject( 'java', 'java.lang.System' ).console() ) ) {
return false;
// Default to true
} else {
return true;
}
}
bdw429s
06/09/2022, 10:17 PMbdw429s
06/09/2022, 10:18 PMbhartsfield
06/09/2022, 10:44 PMbdw429s
06/09/2022, 10:48 PMbhartsfield
06/09/2022, 11:38 PMbhartsfield
06/09/2022, 11:41 PMbhartsfield
06/10/2022, 12:22 AMbhartsfield
06/10/2022, 12:23 AMbhartsfield
06/10/2022, 12:23 AM