{"record":{"id":"30fe0274f177740d","repo":"hashicorp/nomad","slug":"failed-to-setup-stdout-log-tailing-v","errorCode":null,"errorMessage":"failed to setup stdout log tailing: %v","messagePattern":"failed to setup stdout log tailing: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/alloc_logs.go","lineNumber":372,"sourceCode":"// stderr until the user cancels it.\nfunc (l *AllocLogsCommand) tailMultipleFiles(client *api.Client, alloc *api.Allocation) error {\n\n\t// Use a single cancel channel for both log streams, so we only have to\n\t// close one.\n\tcancel := make(chan struct{})\n\n\t// Ensure the channel is closed in order to notify listeners whenever we\n\t// exit.\n\tdefer close(cancel)\n\n\tstdoutFrames, stdoutErrCh := client.AllocFS().Logs(\n\t\talloc, true, l.task, api.FSLogNameStdout, api.OriginEnd, 0, cancel, nil)\n\n\t// Setting up the logs stream can fail, therefore we need to check the\n\t// error channel before continuing further.\n\tselect {\n\tcase err := <-stdoutErrCh:\n\t\treturn fmt.Errorf(\"failed to setup stdout log tailing: %v\", err)\n\tdefault:\n\t}\n\n\tstderrFrames, stderrErrCh := client.AllocFS().Logs(\n\t\talloc, true, l.task, api.FSLogNameStderr, api.OriginEnd, 0, cancel, nil)\n\n\t// Setting up the logs stream can fail, therefore we need to check the\n\t// error channel before continuing further.\n\tselect {\n\tcase err := <-stderrErrCh:\n\t\treturn fmt.Errorf(\"failed to setup stderr log tailing: %v\", err)\n\tdefault:\n\t}\n\n\t// Trap user signals, so we know when to exit and cancel the log streams\n\t// running in the background.\n\tsignalCh := make(chan os.Signal, 1)\n\tsignal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/alloc_logs.go#L354-L390","documentation":"tailMultipleFiles reports this when the initial error channel from client.AllocFS().Logs for stdout yields an error right away, i.e. the streaming log endpoint could not be set up (bad task, no logs, client unreachable).","triggerScenarios":"Thrown at command/alloc_logs.go:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the task name and allocation are correct and running","Check the Nomad client is reachable and healthy","Retry if the client was temporarily restarting"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}