{"id":"e8067426e3f04362","repo":"docker/cli","slug":"failed-to-unmarshal-hook-response-q-w","errorCode":null,"errorMessage":"failed to unmarshal hook response (%q): %w","messagePattern":"failed to unmarshal hook response \\(%q\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli-plugins/manager/hooks.go","lineNumber":91,"sourceCode":"\t\t}\n\n\t\tp, err := getPlugin(pluginName, pluginDirs, rootCmd)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\n\t\tresp, err := p.RunHook(ctx, hooks.Request{\n\t\t\tRootCmd:      match,\n\t\t\tFlags:        flags,\n\t\t\tCommandError: cmdErrorMessage,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\n\t\tvar message hooks.Response\n\t\tif err := json.Unmarshal(resp, &message); err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"failed to unmarshal hook response (%q): %w\", string(resp), err)\n\t\t}\n\n\t\t// currently the only hook type\n\t\tif message.Type != hooks.NextSteps {\n\t\t\treturn nil, false, errors.New(\"unexpected hook response type: \" + strconv.Itoa(int(message.Type)))\n\t\t}\n\n\t\tmessages, err = hooks.ParseTemplate(message.Template, subCmd)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\n\t\treturn messages, true, nil\n\t}\n\n\tfor pluginName, pluginCfg := range pluginsCfg {\n\t\tmessages, ok, err := tryInvokeHook(pluginName, pluginCfg)\n\t\tif err != nil {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli-plugins/manager/hooks.go#L73-L109","documentation":"Error \"failed to unmarshal hook response (%q): %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli-plugins/manager/hooks.go:91 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}