Open rythos42 opened 4 years ago
Didn't see anything suspicious in the logs. So you have a bat that spawns 7 tabs via CLI? I honestly never tried this, I will try to reproduce it
Damn. My workflow is that I open a PowerShell 7 tab and we have a node.js CLI program we've written that spawns other tabs. Each tab runs either a C# or node.js console that I want to keep running.
(It simulates running our microservices and React apps on my development machine)
I don't know if it will help, but here's a piece of the CLI we use to run flute. It isn't a runnable piece of code, requires some frameworks and maybe boilerplate, but maybe it will help. I took out a bunch of the configuration values to make it smaller.
const { Command } = require('@oclif/command');
const { spawn, exec } = require('child_process');
const dotenv = require('dotenv');
dotenv.config({ path: __dirname + '/../../.env' });
const { GIT_ROOT } = process.env;
if (!GIT_ROOT) {
console.error(
'Please create .env file in the root folder of CLI repo and set GIT_ROOT to the path of Lending git repo',
);
process.exit();
}
const projectsConfiguration = {
WebAPI: {
type: 'Framework',
exec:
GIT_ROOT +
'\\Server.WebAPI\\bin\\Debug\\Server.WebAPI.exe',
args:
GIT_ROOT +
'\\WebAPI\\web.config',
},
Tenant: {
type: 'Core',
project: GIT_ROOT + '\\Server.Tenant\\Server.Tenant.API',
},
Admin: {
type: 'Npm',
project:
GIT_ROOT + '\\Admin.React',
},
};
const Terminals = {
Default: 0,
FluentTerminal: 1,
};
class RunCommand extends Command {
startProject(project, terminal) {
this[`run${project.type}`](project, terminal);
}
runCore(project, terminal) {
// You will need .NET Core SDK installed to run this. (https://dotnet.microsoft.com/download)
if (terminal === Terminals.FluentTerminal) {
spawn('flute.exe', ['run', `dotnet run --project ${project.project}`]);
} else {
exec(`start cmd.exe /c dotnet run --project ${project.project}`);
}
}
runFramework(project, terminal) {
if (terminal === Terminals.FluentTerminal) {
spawn('flute.exe', ['run', `${project.exec} ${project.args}`]);
} else {
exec(`start cmd.exe /c ${project.exec} ${project.args}`);
}
}
runNpm(project, terminal) {
if (terminal === Terminals.FluentTerminal) {
spawn('flute.exe', [
'run',
'npm.cmd start',
'--directory',
project.project,
]);
} else {
exec(`start cmd.exe /c npm.cmd start`, { cwd: project.project });
}
}
async run() {
const { argv: projects } = this.parse(RunCommand);
const terminal =
process.env.TERM_PROGRAM === 'FluentTerminal'
? Terminals.FluentTerminal
: Terminals.Default;
const runProjects =
projects.indexOf('All') !== -1
? Object.keys(projectsConfiguration)
: projects;
console.log(`Running ${runProjects.join(', ')}.`);
runProjects.forEach((projectName) =>
this.startProject(projectsConfiguration[projectName], terminal),
);
}
}
RunCommand.description = `Run services as console apps.
You can start multiple projects at once by supplying multiple project arguments.
`;
RunCommand.args = [
{
name: 'project',
required: true,
description: 'project to run',
options: ['All'].concat(Object.keys(projectsConfiguration)),
},
];
RunCommand.strict = false;
module.exports = RunCommand;
Didn't have time to look at it yet, but did you already try adding some delay between the flute run
calls?
Yes. :( The CLI is built to be able to run it all at once, or run individually. I started running them individually because I felt like I had better success doing that. Sometimes Fluent will crash on the first one, sometimes on the 2nd or 5th. I run one command, wait for it to finish starting the server or web startup, then run the next one.
same problem here, I use flute run
to fire up 6 console programs (1 window, 6 tabs) at the same time, we need these 6 console programs working concurrently.
sometimes it works fine, but sometimes it just crash:
The code is just like this:
flute run "cmd /k chcp 65001 && <console program1> some params"
flute run "cmd /k chcp 65001 && <console program2> some params"
flute run "cmd /k chcp 65001 && <console program3> some params"
flute run "cmd /k chcp 65001 && <console program4> some params"
flute run "cmd /k chcp 65001 && <console program5> some params"
flute run "cmd /k chcp 65001 && <console program6> some params"
I'm on Windows, the code is written in a .bat file, I double click the bat file to run it.
I've been using
flute run
to start a bunch of console programs at once for a long time. It started "randomly" crashing a few months ago, but I could usually manage to get it all started eventually. This morning I've tried 3 times and each time 1 of my 7 console programs does something and crashes the entire Fluent app and closes all tabs so I need to start all over again.Here are a variety of logs I've seen you ask for in other situations:
Windows Event Viewer Error
Faulting application name: FluentTerminal.App.exe, version: 1.0.0.0, time stamp: 0x5ec843cf Faulting module name: KERNELBASE.dll, version: 10.0.19041.488, time stamp: 0x5b4a3325 Exception code: 0xc000027b Fault offset: 0x000000000010b3cc Faulting process id: 0x38e4 Faulting application start time: 0x01d6904284d08dbb Faulting application path: C:\Program Files\WindowsApps\53621FSApps.FluentTerminal_0.7.1.0_x64__zzw7cgfsy6dd6\FluentTerminal.App.exe Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll Report Id: 336928ee-b901-4fc1-bfbf-182d23f93db6 Faulting package full name: 53621FSApps.FluentTerminal_0.7.1.0_x64__zzw7cgfsy6dd6 Faulting package-relative application ID: AppWindows Event Viewer Information
Fault bucket 1888874007594572918, type 5 Event Name: MoAppCrash Response: Not available Cab Id: 0 Problem signature: P1: 53621FSApps.FluentTerminal_0.7.1.0_x64__zzw7cgfsy6dd6 P2: praid:App P3: 1.0.0.0 P4: 5ec843cf P5: combase.dll P6: 10.0.19041.508 P7: ce0f364c P8: 800706be P9: 0000000000026156 P10: Attached files: \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8FDA.tmp.mdmp \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER93E3.tmp.WERInternalMetadata.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER9403.tmp.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER9424.tmp.csv \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER94D1.tmp.txt These files may be available here: \\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_53621FSApps.Flue_9a42c5adbf707dc297614913721ddccf34eeba56_97094591_0660f65d-1576-4a6a-acd0-aa690cf55bca Analysis symbol: Rechecking for solution: 0 Report Id: 336928ee-b901-4fc1-bfbf-182d23f93db6 Report Status: 268435456 Hashed bucket: a2ea5d4fc73fcb71ba36a0e6f8249c76 Cab Guid: 0fluentterminal.app20200921.log
2020-09-21 11:02:44.677 -07:00 [FTL] Initialized 2020-09-21 11:02:44.684 -07:00 [DBG] Created ApplicationViewAdapter for ApplicationView with Id: [-199493] 2020-09-21 11:02:46.912 -07:00 [DBG] WebView navigation completed. Target: ["ms-appx-web://53621fsapps.fluentterminal/Client/index.html"] 2020-09-21 11:02:47.022 -07:00 [DBG] Sending CreateTerminalRequest: [{"Identifier":1,"Id":0,"Size":{"Columns":189,"Rows":53,"$type":"TerminalSize"},"Profile":{"Id":"e39856d5-c706-4200-84d1-8066bdabf5f3","PreInstalled":false,"Name":"Powershell 7","Arguments":null,"Location":"C:\\Users\\CraigFleming\\.dotnet\\tools\\pwsh.exe","WorkingDirectory":null,"TabThemeId":0,"EnvironmentVariables":{},"UseConPty":true,"UseBuffer":true,"MigrationVersion":1,"Tag":{"$type":"DelayedHistorySaver"},"TerminalThemeId":"00000000-0000-0000-0000-000000000000","KeyBindings":[{"Command":"e39856d5-c706-4200-84d1-8066bdabf5f3","Key":49,"Ctrl":true,"Alt":true,"Shift":false,"Meta":false,"$type":"KeyBinding"}],"$type":"ShellProfile"},"SessionType":"ConPty","$type":"CreateTerminalRequest"}] 2020-09-21 11:02:47.197 -07:00 [DBG] MainViewModel with ApplicationView Id: [-199493] activated. 2020-09-21 11:02:47.971 -07:00 [DBG] Received CreateTerminalResponse: [{"Identifier":8,"Name":"Powershell 7","Success":true,"Error":null,"$type":"CreateTerminalResponse"}] 2020-09-21 11:03:05.426 -07:00 [DBG] MainViewModel with ApplicationView Id: [-199493] activated. 2020-09-21 11:03:05.551 -07:00 [DBG] WebView navigation completed. Target: ["ms-appx-web://53621fsapps.fluentterminal/Client/index.html"] 2020-09-21 11:03:05.694 -07:00 [DBG] Sending CreateTerminalRequest: [{"Identifier":1,"Id":1,"Size":{"Columns":189,"Rows":51,"$type":"TerminalSize"},"Profile":{"Id":"00000000-0000-0000-0000-000000000000","PreInstalled":false,"Name":null,"Arguments":"dotnet run --project C:\\work\\JUDI.Server.Tenant\\JUDI.Server.Tenant.API","Location":null,"WorkingDirectory":"C:\\Users\\CraigFleming","TabThemeId":0,"EnvironmentVariables":{},"UseConPty":false,"UseBuffer":true,"MigrationVersion":1,"Tag":{"$type":"DelayedHistorySaver"},"TerminalThemeId":"00000000-0000-0000-0000-000000000000","KeyBindings":[],"$type":"ShellProfile"},"SessionType":"WinPty","$type":"CreateTerminalRequest"}] 2020-09-21 11:03:05.922 -07:00 [DBG] Received CreateTerminalResponse: [{"Identifier":8,"Name":"dotnet","Success":true,"Error":null,"$type":"CreateTerminalResponse"}] 2020-09-21 11:03:18.830 -07:00 [DBG] WebView navigation completed. Target: ["ms-appx-web://53621fsapps.fluentterminal/Client/index.html"] 2020-09-21 11:03:18.919 -07:00 [DBG] Sending CreateTerminalRequest: [{"Identifier":1,"Id":2,"Size":{"Columns":189,"Rows":51,"$type":"TerminalSize"},"Profile":{"Id":"00000000-0000-0000-0000-000000000000","PreInstalled":false,"Name":null,"Arguments":"C:\\work\\JUDI.Server.Categorization\\JUDI.Server.Categorization\\bin\\Debug\\JUDI.Server.Categorization.exe C:\\work\\JUDI.Server.Categorization\\LTI.API.Categorization\\web.config","Location":null,"WorkingDirectory":"C:\\Users\\CraigFleming","TabThemeId":0,"EnvironmentVariables":{},"UseConPty":false,"UseBuffer":true,"MigrationVersion":1,"Tag":{"$type":"DelayedHistorySaver"},"TerminalThemeId":"00000000-0000-0000-0000-000000000000","KeyBindings":[],"$type":"ShellProfile"},"SessionType":"WinPty","$type":"CreateTerminalRequest"}] 2020-09-21 11:03:19.295 -07:00 [DBG] Received CreateTerminalResponse: [{"Identifier":8,"Name":"C:\\work\\JUDI.Server.Categorization\\JUDI.Server.Categorization\\bin\\Debug\\JUDI.Server.Categorization.exe","Success":true,"Error":null,"$type":"CreateTerminalResponse"}] 2020-09-21 11:03:26.763 -07:00 [DBG] WebView navigation completed. Target: ["ms-appx-web://53621fsapps.fluentterminal/Client/index.html"] 2020-09-21 11:03:26.839 -07:00 [DBG] Sending CreateTerminalRequest: [{"Identifier":1,"Id":3,"Size":{"Columns":189,"Rows":51,"$type":"TerminalSize"},"Profile":{"Id":"00000000-0000-0000-0000-000000000000","PreInstalled":false,"Name":null,"Arguments":"dotnet run --project C:\\work\\lending\\src\\JUDI.Server.Pricing\\JUDI.API.Pricing","Location":null,"WorkingDirectory":"C:\\Users\\CraigFleming","TabThemeId":0,"EnvironmentVariables":{},"UseConPty":false,"UseBuffer":true,"MigrationVersion":1,"Tag":{"$type":"DelayedHistorySaver"},"TerminalThemeId":"00000000-0000-0000-0000-000000000000","KeyBindings":[],"$type":"ShellProfile"},"SessionType":"WinPty","$type":"CreateTerminalRequest"}] 2020-09-21 11:03:27.010 -07:00 [DBG] Received CreateTerminalResponse: [{"Identifier":8,"Name":"dotnet","Success":true,"Error":null,"$type":"CreateTerminalResponse"}] 2020-09-21 11:03:37.996 -07:00 [DBG] MainViewModel with ApplicationView Id: [-199493] activated. 2020-09-21 11:03:38.137 -07:00 [DBG] WebView navigation completed. Target: ["ms-appx-web://53621fsapps.fluentterminal/Client/index.html"] 2020-09-21 11:03:38.306 -07:00 [DBG] Sending CreateTerminalRequest: [{"Identifier":1,"Id":4,"Size":{"Columns":189,"Rows":51,"$type":"TerminalSize"},"Profile":{"Id":"00000000-0000-0000-0000-000000000000","PreInstalled":false,"Name":null,"Arguments":"dotnet run --project C:\\work\\lending\\src\\Lending.Mock\\JUDI.Server.Mock","Location":null,"WorkingDirectory":"C:\\Users\\CraigFleming","TabThemeId":0,"EnvironmentVariables":{},"UseConPty":false,"UseBuffer":true,"MigrationVersion":1,"Tag":{"$type":"DelayedHistorySaver"},"TerminalThemeId":"00000000-0000-0000-0000-000000000000","KeyBindings":[],"$type":"ShellProfile"},"SessionType":"WinPty","$type":"CreateTerminalRequest"}] 2020-09-21 11:03:38.771 -07:00 [DBG] Received CreateTerminalResponse: [{"Identifier":8,"Name":"dotnet","Success":true,"Error":null,"$type":"CreateTerminalResponse"}] 2020-09-21 11:03:59.684 -07:00 [ERR] Unhandled Exception System.Exception: The remote procedure call failed. (Exception from HRESULT: 0x800706BE) at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21 at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32) + 0xc5 at __Interop.ForwardComStubs.Stub_11[TThis](__ComObject, Int32) + 0x24 at System.IDisposable__Impl.Dispatcher.Dispose() + 0x18 at FluentTerminal.App.App.fluentterminal.systemtray20200921.log
2020-09-21 11:02:46.548 -07:00 [FTL] Initialized 2020-09-21 11:02:46.603 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 6788 2020-09-21 11:02:46.645 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 10544 2020-09-21 11:02:46.674 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 6788 2020-09-21 11:02:46.707 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 10544 2020-09-21 11:02:46.745 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 6788 2020-09-21 11:02:46.771 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 10544 2020-09-21 11:02:46.804 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 6788 2020-09-21 11:02:46.856 -07:00 [DBG] Spawned conhost process id=16112. Starting muting of generated bell sound. 2020-09-21 11:02:51.483 -07:00 [DBG] Set conhost process mute state to True. 2020-09-21 11:02:51.500 -07:00 [DBG] SpawnConhostProcess finishes mute=True 2020-09-21 11:09:09.883 -07:00 [FTL] Initialized 2020-09-21 11:09:10.004 -07:00 [DBG] SpawnConhostProcess starts mute=True 2020-09-21 11:09:10.168 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 6788 2020-09-21 11:09:10.272 -07:00 [DBG] Exception with message "Access is denied" on getting process parent id for conhost process 10544 2020-09-21 11:09:10.501 -07:00 [DBG] Spawned conhost process id=6560. Starting muting of generated bell sound. 2020-09-21 11:09:13.317 -07:00 [DBG] Set conhost process mute state to True. 2020-09-21 11:09:13.401 -07:00 [DBG] SpawnConhostProcess finishes mute=True 2020-09-21 11:10:30.102 -07:00 [ERR] Unobserved Task Exception System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.NullReferenceException: Object reference not set to an instance of an object. at FluentTerminal.SystemTray.Services.AppCommunicationService._terminalsManager_DisplayOutputRequested(Object sender, TerminalOutput e) at FluentTerminal.SystemTray.BufferedReader.SendBuffer() at FluentTerminal.SystemTray.BufferedReader.Thank you!