{"id":"cdc31fd858a6538d","repo":"docker/cli","slug":"error-pinging-v2-registry-w","errorCode":null,"errorMessage":"error pinging v2 registry: %w","messagePattern":"error pinging v2 registry: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/registryclient/endpoint.go","lineNumber":85,"sourceCode":"// getHTTPTransport builds a transport for use in communicating with a registry\nfunc getHTTPTransport(authConfig registrytypes.AuthConfig, endpoint registry.APIEndpoint, repoName, userAgent string, actions []string) (http.RoundTripper, error) {\n\t// get the http transport, this will be used in a client to upload manifest\n\tbase := &http.Transport{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tDial: (&net.Dialer{\n\t\t\tTimeout:   30 * time.Second,\n\t\t\tKeepAlive: 30 * time.Second,\n\t\t}).Dial,\n\t\tTLSHandshakeTimeout: 10 * time.Second,\n\t\tTLSClientConfig:     endpoint.TLSConfig,\n\t\tDisableKeepAlives:   true,\n\t}\n\n\tmodifiers := registry.Headers(userAgent, http.Header{})\n\tauthTransport := transport.NewTransport(base, modifiers...)\n\tchallengeManager, err := registry.PingV2Registry(endpoint.URL, authTransport)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error pinging v2 registry: %w\", err)\n\t}\n\tif authConfig.RegistryToken != \"\" {\n\t\tpassThruTokenHandler := &existingTokenHandler{token: authConfig.RegistryToken}\n\t\tmodifiers = append(modifiers, auth.NewAuthorizer(challengeManager, passThruTokenHandler))\n\t} else {\n\t\tif len(actions) == 0 {\n\t\t\tactions = []string{\"pull\"}\n\t\t}\n\t\tcreds := &staticCredentialStore{authConfig: &authConfig}\n\t\ttokenHandler := auth.NewTokenHandler(authTransport, creds, repoName, actions...)\n\t\tbasicHandler := auth.NewBasicHandler(creds)\n\t\tmodifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler))\n\t}\n\treturn transport.NewTransport(base, modifiers...), nil\n}\n\ntype existingTokenHandler struct {\n\ttoken string","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/internal/registryclient/endpoint.go#L67-L103","documentation":"Error \"error pinging v2 registry: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at internal/registryclient/endpoint.go:85 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}