{"id":"f24f147b920d6e72","repo":"docker/cli","slug":"server-did-not-provide-an-image-id-cannot-write","errorCode":null,"errorMessage":"server did not provide an image ID. Cannot write %s","messagePattern":"server did not provide an image ID\\. Cannot write (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/image/build.go","lineNumber":390,"sourceCode":"\t\t\t}\n\t\t\tif options.quiet {\n\t\t\t\t_, _ = fmt.Fprintf(dockerCli.Err(), \"%s%s\", progBuff, buildBuff)\n\t\t\t}\n\t\t\treturn cli.StatusError{Status: jerr.Message, StatusCode: jerr.Code}\n\t\t}\n\t\treturn err\n\t}\n\n\t// Everything worked so if -q was provided the output from the daemon\n\t// should be just the image ID and we'll print that to stdout.\n\tif options.quiet {\n\t\timageID = fmt.Sprintf(\"%s\", buildBuff)\n\t\t_, _ = fmt.Fprint(dockerCli.Out(), imageID)\n\t}\n\n\tif options.imageIDFile != \"\" {\n\t\tif imageID == \"\" {\n\t\t\treturn fmt.Errorf(\"server did not provide an image ID. Cannot write %s\", options.imageIDFile)\n\t\t}\n\t\tif err := os.WriteFile(options.imageIDFile, []byte(imageID), 0o666); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// validateTag checks if the given image name can be resolved.\nfunc validateTag(rawRepo string) (string, error) {\n\t_, err := reference.ParseNormalizedNamed(rawRepo)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn rawRepo, nil\n}","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/image/build.go#L372-L408","documentation":"Error \"server did not provide an image ID. Cannot write %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/image/build.go:390 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}