{"record":{"id":"cb36cc97e3f0d353","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-metadata-for-object-q-in-bucket-q","errorCode":null,"errorMessage":"failed to get metadata for object %q in bucket %q: %w","messagePattern":"failed to get metadata for object %q in bucket %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cloudstorage/cloudstorage.go","lineNumber":404,"sourceCode":"\t\treturn fmt.Sprint(bindings[i][\"role\"]) < fmt.Sprint(bindings[j][\"role\"])\n\t})\n\n\treturn map[string]any{\n\t\t\"bucket\":   bucket,\n\t\t\"bindings\": bindings,\n\t}, nil\n}\n\n// GetObjectMetadata returns the raw *storage.ObjectAttrs for an object, giving\n// callers the full field set the GCS client exposes (name, size, contentType,\n// hashes, timestamps, user metadata, etc.) without a curated subset.\nfunc (s *Source) GetObjectMetadata(ctx context.Context, bucket, object string) (*storage.ObjectAttrs, error) {\n\tif err := s.validateBucket(bucket); err != nil {\n\t\treturn nil, err\n\t}\n\tattrs, err := s.client.Bucket(bucket).Object(object).Attrs(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get metadata for object %q in bucket %q: %w\", object, bucket, err)\n\t}\n\treturn attrs, nil\n}\n\n// DownloadObject streams a GCS object to destination on the local filesystem.\n// Unlike ReadObject there is no size cap and no UTF-8 check — the bytes go to\n// disk, not into the LLM context, so binary payloads are fine. When overwrite\n// is false, a pre-existing destination returns cloudstoragecommon.ErrDestinationExists\n// (mapped to AgentError so the caller can retry with overwrite=true).\nfunc (s *Source) DownloadObject(ctx context.Context, bucket, object, destination string, overwrite bool) (map[string]any, error) {\n\tif err := s.validateBucket(bucket); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := s.validateLocalPath(destination); err != nil {\n\t\treturn nil, err\n\t}\n\treader, err := s.client.Bucket(bucket).Object(object).NewReader(ctx)\n\tif err != nil {","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cloudstorage/cloudstorage.go#L386-L422","documentation":"Error \"failed to get metadata for object %q in bucket %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/cloudstorage/cloudstorage.go:404 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"}