{"record":{"id":"733cbe25250688cd","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-metadata-for-bucket-q-w","errorCode":null,"errorMessage":"failed to get metadata for bucket %q: %w","messagePattern":"failed to get metadata for bucket %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cloudstorage/cloudstorage.go","lineNumber":349,"sourceCode":"\tcreatedAttrs, err := bkt.Attrs(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get metadata for created bucket %q: %w\", bucket, err)\n\t}\n\treturn map[string]any{\n\t\t\"bucket\":   bucket,\n\t\t\"created\":  true,\n\t\t\"metadata\": createdAttrs,\n\t}, nil\n}\n\n// GetBucketMetadata returns raw bucket metadata from the Cloud Storage client.\nfunc (s *Source) GetBucketMetadata(ctx context.Context, bucket string) (*storage.BucketAttrs, error) {\n\tif err := s.validateBucket(bucket); err != nil {\n\t\treturn nil, err\n\t}\n\tattrs, err := s.client.Bucket(bucket).Attrs(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get metadata for bucket %q: %w\", bucket, err)\n\t}\n\treturn attrs, nil\n}\n\n// GetBucketIAMPolicy returns bucket IAM bindings in a stable, agent-friendly\n// shape while preserving conditional bindings when present.\nfunc (s *Source) GetBucketIAMPolicy(ctx context.Context, bucket string) (map[string]any, error) {\n\tif err := s.validateBucket(bucket); err != nil {\n\t\treturn nil, err\n\t}\n\tpolicy, err := s.client.Bucket(bucket).IAM().Policy(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get IAM policy for bucket %q: %w\", bucket, err)\n\t}\n\n\tbindings := make([]map[string]any, 0)\n\tif policy != nil && policy.InternalProto != nil {\n\t\tfor _, binding := range policy.InternalProto.Bindings {","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cloudstorage/cloudstorage.go#L331-L367","documentation":"Error \"failed to get metadata for bucket %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/cloudstorage/cloudstorage.go:349 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}