{"id":"0630dc18ac0a976b","repo":"docker/cli","slug":"invalid-context-in-log-message-v","errorCode":null,"errorMessage":"invalid context in log message: %v","messagePattern":"invalid context in log message: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/logs.go","lineNumber":273,"sourceCode":"\t// if this ends up horribly broken or panics, check to see if stdcopy has\n\t// reneged on that assumption. (@god forgive me)\n\t// also this only works because the logs format is, like, barely parsable.\n\t// if something changes in the logs format, this is gonna break\n\n\t// there should always be at least 2 parts: details and message. if there\n\t// is no timestamp, details will be first (index 0) when we split on\n\t// spaces. if there is a timestamp, details will be 2nd (`index 1)\n\tdetailsIndex := 0\n\tnumParts := 2\n\tif lw.opts.timestamps {\n\t\tdetailsIndex++\n\t\tnumParts++\n\t}\n\n\t// break up the log line into parts.\n\tparts := bytes.SplitN(buf, []byte(\" \"), numParts)\n\tif len(parts) != numParts {\n\t\treturn 0, fmt.Errorf(\"invalid context in log message: %v\", string(buf))\n\t}\n\t// parse the details out\n\tdetails, err := logdetails.Parse(string(parts[detailsIndex]))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// and then create a context from the details\n\t// this removes the context-specific details from the details map, so we\n\t// can more easily print the details later\n\tlogCtx, err := parseContext(details)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\toutput := []byte{}\n\t// if we included timestamps, add them to the front\n\tif lw.opts.timestamps {\n\t\toutput = append(output, parts[0]...)","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/logs.go#L255-L291","documentation":"Error \"invalid context in log message: %v\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/logs.go:273 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}