{"record":{"id":"066233644b4f1ddb","repo":"m1k1o/neko","slug":"pipeline-error-s","errorCode":null,"errorMessage":"(pipeline error) %s","messagePattern":"\\(pipeline error\\) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"server/pkg/gst/gst.go","lineNumber":75,"sourceCode":"\tctx    *C.GstPipelineCtx\n\tsample chan types.Sample\n}\n\nfunc CreatePipeline(pipelineStr string) (Pipeline, error) {\n\tid := atomic.AddInt32(&pSerial, 1)\n\n\tpipelineStrUnsafe := C.CString(pipelineStr)\n\tdefer C.free(unsafe.Pointer(pipelineStrUnsafe))\n\n\tpipelinesLock.Lock()\n\tdefer pipelinesLock.Unlock()\n\n\tvar gstError *C.GError\n\tctx := C.gstreamer_pipeline_create(pipelineStrUnsafe, C.int(id), &gstError)\n\n\tif gstError != nil {\n\t\tdefer C.g_error_free(gstError)\n\t\treturn nil, fmt.Errorf(\"(pipeline error) %s\", C.GoString(gstError.message))\n\t}\n\n\tp := &pipeline{\n\t\tid: int(id),\n\t\tlogger: log.With().\n\t\t\tStr(\"module\", \"capture\").\n\t\t\tStr(\"submodule\", \"gstreamer\").\n\t\t\tInt(\"pipeline_id\", int(id)).Logger(),\n\t\tsrc:    pipelineStr,\n\t\tctx:    ctx,\n\t\tsample: make(chan types.Sample, 4),\n\t}\n\n\tpipelines[p.id] = p\n\treturn p, nil\n}\n\nfunc (p *pipeline) Src() string {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/pkg/gst/gst.go#L57-L93","documentation":"CreatePipeline builds a GStreamer pipeline via cgo (gstreamer_pipeline_create). If GStreamer's C layer reports a GError during parsing/linking, the Go wrapper wraps the raw GStreamer message as \"(pipeline error) %s\". The %s is the native GStreamer diagnostic (parse error, link failure, missing element, etc.).","triggerScenarios":"Any CreatePipeline call where the underlying C.gstreamer_pipeline_create returns a non-nil *C.GError — typically a malformed pipeline description string (gst-launch syntax), referencing elements/plugins that don't exist, or caps/link incompatibilities.","commonSituations":"Typos in pipeline descriptions passed to NewVideoPipeline/NewAudioPipeline; GStreamer runtime missing or an incomplete install (e.g., gst-plugins-base not installed); version differences where an element was renamed or removed; incompatible caps between elements causing link failure at runtime.","solutions":["Read the message after '(pipeline error) ' — it is the native GStreamer diagnostic and names the failing element or parse problem.","Test the identical pipeline string with `gst-launch-1.0 -v <pipeline>` to reproduce and validate the description.","Check that all required GStreamer elements exist: run the library's CheckPlugins/CheckElement or `gst-inspect-1.0 <element>`.","Install missing GStreamer runtime packages (gstreamer1.0-plugins-base/good/bad/ugly, gstreamer1.0-libav) for your platform.","Fix caps/link incompatibilities (e.g., mismatched framerates, formats, or negotiated caps) in the pipeline description."],"exampleFix":"// before\np, err := gst.CreatePipeline(\"appsrc ! decodebin ! fakesink\") // underspecified caps -> link error\n// after\np, err := gst.CreatePipeline(\"appsrc caps=video/x-raw,format=I420 ! videoconvert ! fakesink\")","handlingStrategy":"try-catch","validationCode":"if err := gst.CheckElement(\"x264enc\"); err != nil {\n    return fmt.Errorf(\"pipeline prerequisites missing: %w\", err)\n}\n// also validate the description with gst-launch-1.0 during CI","typeGuard":null,"tryCatchPattern":"p, err := gst.CreatePipeline(desc)\nif err != nil {\n    if strings.HasPrefix(err.Error(), \"(pipeline error)\") {\n        return fmt.Errorf(\"gstreamer rejected pipeline %q: %w\", desc, err)\n    }\n    return err\n}","preventionTips":["Test every pipeline description string with `gst-launch-1.0 -v` in CI before shipping.","Run CheckPlugins/CheckElement for all elements a pipeline depends on at startup.","Pin and verify GStreamer plugin package versions in deployment images.","Log the full pipeline description alongside the native GStreamer error for faster diagnosis."],"tags":["gstreamer","cgo","pipeline"],"backgroundTag":"gstreamer-pipeline-error","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}