{"id":"71bd2d370067dbb6","repo":"docker/cli","slug":"error-saving-credentials-v","errorCode":null,"errorMessage":"error saving credentials: %v","messagePattern":"error saving credentials: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/registry/login.go","lineNumber":334,"sourceCode":"\t\treturn \"\", err\n\t}\n\n\treturn response.Auth.Status, nil\n}\n\nfunc storeCredentials(cfg *configfile.ConfigFile, authConfig registrytypes.AuthConfig) error {\n\tcreds := cfg.GetCredentialsStore(authConfig.ServerAddress)\n\tif err := creds.Store(configtypes.AuthConfig{\n\t\tUsername:      authConfig.Username,\n\t\tPassword:      authConfig.Password,\n\t\tServerAddress: authConfig.ServerAddress,\n\n\t\t// TODO(thaJeztah): Are these expected to be included?\n\t\tAuth:          authConfig.Auth,\n\t\tIdentityToken: authConfig.IdentityToken,\n\t\tRegistryToken: authConfig.RegistryToken,\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"error saving credentials: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc loginWithRegistry(ctx context.Context, apiClient client.SystemAPIClient, options client.RegistryLoginOptions) (client.RegistryLoginResult, error) {\n\tres, err := apiClient.RegistryLogin(ctx, options)\n\tif err != nil {\n\t\tif client.IsErrConnectionFailed(err) {\n\t\t\t// daemon isn't responding; attempt to login client side.\n\t\t\treturn loginClientSide(ctx, options)\n\t\t}\n\t\treturn client.RegistryLoginResult{}, err\n\t}\n\n\treturn res, nil\n}\n","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/registry/login.go#L316-L352","documentation":"Error \"error saving credentials: %v\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/registry/login.go:334 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}