{"record":{"id":"2d19d6aa45c33798","repo":"router-for-me/CLIProxyAPI","slug":"codex-live-media-relay-requires-an-sdp-or-json-cal","errorCode":null,"errorMessage":"Codex live media relay requires an SDP or JSON call request","messagePattern":"Codex live media relay requires an SDP or JSON call request","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"internal/client/codex/live/live.go","lineNumber":696,"sourceCode":"\t\tSession: session,\n\t}\n\tencoded, errMarshal := json.Marshal(payload)\n\tif errMarshal != nil {\n\t\treturn nil, fmt.Errorf(\"failed to encode Codex live request: %w\", errMarshal)\n\t}\n\treturn encoded, nil\n}\n\nfunc callRequestSDP(body []byte, contentType string) (string, error) {\n\tmediaType, _, errMediaType := mime.ParseMediaType(contentType)\n\tif errMediaType == nil && (strings.EqualFold(mediaType, \"application/sdp\") || strings.EqualFold(mediaType, \"text/plain\")) {\n\t\tif strings.TrimSpace(string(body)) == \"\" {\n\t\t\treturn \"\", errors.New(\"Codex live call request requires an SDP offer\")\n\t\t}\n\t\treturn string(body), nil\n\t}\n\tif errMediaType != nil || !strings.EqualFold(mediaType, \"application/json\") {\n\t\treturn \"\", errors.New(\"Codex live media relay requires an SDP or JSON call request\")\n\t}\n\tvar payload struct {\n\t\tSDP string `json:\"sdp\"`\n\t}\n\tif errUnmarshal := json.Unmarshal(body, &payload); errUnmarshal != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to decode Codex live call request: %w\", errUnmarshal)\n\t}\n\tif strings.TrimSpace(payload.SDP) == \"\" {\n\t\treturn \"\", errors.New(\"Codex live call request requires an SDP offer\")\n\t}\n\treturn payload.SDP, nil\n}\n\nfunc replaceCallRequestSDP(body []byte, contentType, sdp string) ([]byte, string, error) {\n\tmediaType, _, errMediaType := mime.ParseMediaType(contentType)\n\tif errMediaType == nil && (strings.EqualFold(mediaType, \"application/sdp\") || strings.EqualFold(mediaType, \"text/plain\")) {\n\t\tencoded, errEncode := encodeCallRequest(sdp, nil)\n\t\tif errEncode != nil {","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/client/codex/live/live.go#L678-L714","documentation":"dlopen failed to load the plugin shared library; the message embeds the plugin path and the platform dlerror string. This is the Unix dynamic loader rejecting the file before any plugin code runs — missing shared-object dependencies, wrong architecture, not a shared library at all, or loader permission/ELF issues.","triggerScenarios":"Plugin .so built for a different OS/arch than the host (e.g. darwin/arm64 dylib on linux/amd64); plugin linked against shared libraries absent from LD_LIBRARY_PATH; file corrupted or not an ELF shared object; noexec mount.","commonSituations":"Building plugins on a dev machine and deploying to a different distro/arch; CGO toolchain differences producing versioned symbol dependencies (glibc mismatches); plugins downloaded for the wrong platform; directory mounted noexec in containers.","solutions":["Run ldd <plugin.so> on the target machine to list unresolved shared library dependencies and install/point LD_LIBRARY_PATH at them.","Rebuild the plugin on/for the same OS+arch as the host (GOOS/GOOS targets, or -buildmode=c-shared with the matching toolchain).","Verify the file is a valid shared object (file <plugin.so>) and not corrupted or a Windows DLL.","Ensure the plugin directory is not mounted noexec."],"exampleFix":"# before: plugin built on mac, deployed to linux\nfile plugin.so   # => Mach-O ... (wrong platform)\n\n# after: rebuild for the host platform\nGOOS=linux GOARCH=amd64 go build -buildmode=c-shared -o plugin.so ./plugin","handlingStrategy":"validation","validationCode":"# preflight before enabling the plugin in config\nfile plugin.so        # expect: ELF ... shared object (matching arch)\nldd plugin.so         # expect: no 'not found' entries","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build plugins on the same OS/arch/toolchain as the host.","Run ldd during CI artifact validation.","Ship plugin dependencies or link statically where possible.","Keep plugin directories free of unrelated .so files."],"tags":["pluginhost","native","dlopen","deployment"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}