{"record":{"id":"854d98bedbc543b8","repo":"AlexxIT/go2rtc","slug":"exec-rtsp-s","errorCode":null,"errorMessage":"exec/rtsp\n%s","messagePattern":"exec/rtsp\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/exec/exec.go","lineNumber":206,"sourceCode":"\n\tts := time.Now()\n\n\tif err := cmd.Start(); err != nil {\n\t\tlog.Error().Err(err).Str(\"source\", source).Msg(\"[exec]\")\n\t\treturn nil, err\n\t}\n\n\ttimer := time.NewTimer(timeout)\n\tdefer timer.Stop()\n\n\tselect {\n\tcase <-timer.C:\n\t\t// haven't received data from app in timeout\n\t\tlog.Error().Str(\"source\", source).Msg(\"[exec] timeout\")\n\t\treturn nil, errors.New(\"exec: timeout\")\n\tcase <-cmd.Done():\n\t\t// app fail before we receive any data\n\t\treturn nil, fmt.Errorf(\"exec/rtsp\\n%s\", cmd.Stderr)\n\tcase prod := <-waiter:\n\t\t// app started successfully\n\t\tlog.Debug().Stringer(\"launch\", time.Since(ts)).Msg(\"[exec] run rtsp\")\n\t\tsetRemoteInfo(prod, source, cmd.Args)\n\t\tprod.OnClose = cmd.Close\n\t\treturn prod, nil\n\t}\n}\n\n// internal\n\nvar (\n\tlog       zerolog.Logger\n\twaiters   = make(map[string]chan *pkg.Conn)\n\twaitersMu sync.Mutex\n)\n\ntype logWriter struct {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/exec/exec.go#L188-L224","documentation":"handleRTSP failure branch: the spawned helper exited (cmd.Done fired) before producing any recognizable RTSP output within the timeout, and its captured stderr becomes the error body. The external tool crashed at startup — its stderr explains why (missing dependency, bad URL, auth failure).","triggerScenarios":"Thrown at internal/exec/exec.go:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect cmd.Stderr in the message for the helper's crash reason","Verify the helper's arguments (source URL, credentials) are valid","Re-run after fixing the environment; transient network failures also cause early exit"],"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"}