{"record":{"id":"61d491ac3d718c1d","repo":"docker/compose","slug":"compacting-json-for-seccomp-profile-s-failed","errorCode":null,"errorMessage":"compacting json for seccomp profile (%s) failed: %w","messagePattern":"compacting json for seccomp profile \\((.+?)\\) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/create.go","lineNumber":581,"sourceCode":"\t\t\tunconfined = true\n\t\t\tcontinue\n\t\t}\n\t\tcon := strings.SplitN(opt, \"=\", 2)\n\t\tif len(con) == 1 && con[0] != \"no-new-privileges\" {\n\t\t\tif strings.Contains(opt, \":\") {\n\t\t\t\tcon = strings.SplitN(opt, \":\", 2)\n\t\t\t} else {\n\t\t\t\treturn securityOpts, false, fmt.Errorf(\"invalid security-opt: %q\", opt)\n\t\t\t}\n\t\t}\n\t\tif con[0] == \"seccomp\" && con[1] != \"unconfined\" && con[1] != \"builtin\" {\n\t\t\tf, err := os.ReadFile(p.RelativePath(con[1]))\n\t\t\tif err != nil {\n\t\t\t\treturn securityOpts, false, fmt.Errorf(\"opening seccomp profile (%s) failed: %w\", con[1], err)\n\t\t\t}\n\t\t\tb := bytes.NewBuffer(nil)\n\t\t\tif err := json.Compact(b, f); err != nil {\n\t\t\t\treturn securityOpts, false, fmt.Errorf(\"compacting json for seccomp profile (%s) failed: %w\", con[1], err)\n\t\t\t}\n\t\t\tparsed = append(parsed, fmt.Sprintf(\"seccomp=%s\", b.Bytes()))\n\t\t} else {\n\t\t\tparsed = append(parsed, opt)\n\t\t}\n\t}\n\n\treturn parsed, unconfined, nil\n}\n\n// defaultNetworkSettings determines the container.NetworkMode and corresponding network.NetworkingConfig (nil if not applicable).\nfunc defaultNetworkSettings(project *types.Project,\n\tservice types.ServiceConfig, serviceIndex int,\n\tlinks []string, useNetworkAliases bool,\n\tversion string,\n) (container.NetworkMode, *network.NetworkingConfig, error) {\n\tif service.NetworkMode != \"\" {\n\t\treturn container.NetworkMode(service.NetworkMode), nil, nil","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/create.go#L563-L599","documentation":"Error \"compacting json for seccomp profile (%s) failed: %w\" thrown in docker/compose.","triggerScenarios":"The seccomp profile file was read but its content is not valid JSON, so it cannot be compacted and passed to the engine.","commonSituations":"The seccomp profile contains syntax errors, trailing commas, or is not a JSON document at all.","solutions":["Validate the seccomp profile file is well-formed JSON (e.g. with jq) and fix any syntax errors."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}