{"id":"d7a1dda29efee73d","repo":"docker/cli","slug":"invalid-platform-w","errorCode":null,"errorMessage":"invalid platform: %w","messagePattern":"invalid platform: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/image/history.go","lineNumber":64,"sourceCode":"\tflags := cmd.Flags()\n\n\tflags.BoolVarP(&opts.human, \"human\", \"H\", true, \"Print sizes and dates in human readable format\")\n\tflags.BoolVarP(&opts.quiet, \"quiet\", \"q\", false, \"Only show image IDs\")\n\tflags.BoolVar(&opts.noTrunc, \"no-trunc\", false, \"Don't truncate output\")\n\tflags.StringVar(&opts.format, \"format\", \"\", flagsHelper.FormatHelp)\n\tflags.StringVar(&opts.platform, \"platform\", \"\", `Show history for the given platform. Formatted as \"os[/arch[/variant]]\" (e.g., \"linux/amd64\")`)\n\t_ = flags.SetAnnotation(\"platform\", \"version\", []string{\"1.48\"})\n\n\t_ = cmd.RegisterFlagCompletionFunc(\"platform\", completion.Platforms())\n\treturn cmd\n}\n\nfunc runHistory(ctx context.Context, dockerCli command.Cli, opts historyOptions) error {\n\tvar options []client.ImageHistoryOption\n\tif opts.platform != \"\" {\n\t\tp, err := platforms.Parse(opts.platform)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid platform: %w\", err)\n\t\t}\n\t\toptions = append(options, client.ImageHistoryWithPlatform(p))\n\t}\n\n\thistory, err := dockerCli.Client().ImageHistory(ctx, opts.image, options...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tformat := opts.format\n\tif len(format) == 0 {\n\t\tformat = formatter.TableFormatKey\n\t}\n\n\thistoryCtx := formatter.Context{\n\t\tOutput: dockerCli.Out(),\n\t\tFormat: newHistoryFormat(format, opts.quiet, opts.human),\n\t\tTrunc:  !opts.noTrunc,","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/image/history.go#L46-L82","documentation":"Error \"invalid platform: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/image/history.go:64 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}