{"record":{"id":"7b3c7e5f4115d606","repo":"AlexxIT/go2rtc","slug":"exec-pipe-w-s","errorCode":null,"errorMessage":"exec/pipe: %w\n%s","messagePattern":"exec/pipe: %w\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/exec/exec.go","lineNumber":157,"sourceCode":"\t\tio.Closer\n\t}{\n\t\t// add buffer for pipe reader to reduce syscall\n\t\tbufio.NewReaderSize(stdout, core.BufferSize),\n\t\t// stop cmd on close pipe call\n\t\tcmd,\n\t}\n\n\tlog.Debug().Strs(\"args\", cmd.Args).Msg(\"[exec] run pipe\")\n\n\tts := time.Now()\n\n\tif err = cmd.Start(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tprod, err := magic.Open(rd)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"exec/pipe: %w\\n%s\", err, cmd.Stderr)\n\t}\n\n\tif info, ok := prod.(core.Info); ok {\n\t\tinfo.SetProtocol(\"pipe\")\n\t\tsetRemoteInfo(info, source, cmd.Args)\n\t}\n\n\tlog.Debug().Stringer(\"launch\", time.Since(ts)).Msg(\"[exec] run pipe\")\n\n\treturn prod, nil\n}\n\nfunc handleRTSP(source string, cmd *shell.Command, path string, timeout time.Duration) (core.Producer, error) {\n\tif log.Trace().Enabled() {\n\t\tcmd.Stdout = os.Stdout\n\t}\n\n\twaiter := make(chan *pkg.Conn, 1)","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/exec/exec.go#L139-L175","documentation":"handlePipe wraps magic.Open failure: the spawned command started, but its stdout could not be recognized as any known stream format (magic detection failed). The error wraps the detection error and appends cmd.Stderr, so the helper program's own error output shows why it produced unusable data.","triggerScenarios":"Thrown at internal/exec/exec.go:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the appended stderr — usually the helper's own error (bad args, missing lib)","Fix the source/args so the command emits a recognized format on stdout","Check the command's PATH and environment in the exec context"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}