{"id":"e8b9818eff90c25b","repo":"docker/cli","slug":"unable-to-create-docker-endpoint-config-w","errorCode":null,"errorMessage":"unable to create docker endpoint config: %w","messagePattern":"unable to create docker endpoint config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/context/create.go","lineNumber":92,"sourceCode":"\tcase opts.from != \"\":\n\t\terr = createFromExistingContext(s, name, opts.from, opts)\n\tdefault:\n\t\terr = createNewContext(s, name, opts)\n\t}\n\tif err == nil {\n\t\t_, _ = fmt.Fprintln(dockerCLI.Out(), name)\n\t\t_, _ = fmt.Fprintf(dockerCLI.Err(), \"Successfully created context %q\\n\", name)\n\t}\n\treturn err\n}\n\nfunc createNewContext(contextStore store.ReaderWriter, name string, opts createOptions) error {\n\tif opts.endpoint == nil {\n\t\treturn errors.New(\"docker endpoint configuration is required\")\n\t}\n\tdockerEP, dockerTLS, err := getDockerEndpointMetadataAndTLS(contextStore, opts.endpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create docker endpoint config: %w\", err)\n\t}\n\tcontextMetadata := store.Metadata{\n\t\tEndpoints: map[string]any{\n\t\t\tdocker.DockerEndpoint: dockerEP,\n\t\t},\n\t\tMetadata: command.DockerContext{\n\t\t\tDescription:      opts.description,\n\t\t\tAdditionalFields: opts.metaData,\n\t\t},\n\t\tName: name,\n\t}\n\tcontextTLSData := store.ContextTLSData{}\n\tif dockerTLS != nil {\n\t\tcontextTLSData.Endpoints = map[string]store.EndpointTLSData{\n\t\t\tdocker.DockerEndpoint: *dockerTLS,\n\t\t}\n\t}\n\tif err := validateEndpoints(contextMetadata); err != nil {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/context/create.go#L74-L110","documentation":"Error \"unable to create docker endpoint config: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/context/create.go:92 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}