{"record":{"id":"68ea2c18d2a8de6d","repo":"googleapis/mcp-toolbox","slug":"failed-to-copy-q-to-object-q-in-bucket-q-w","errorCode":null,"errorMessage":"failed to copy %q to object %q in bucket %q: %w","messagePattern":"failed to copy %q to object %q in bucket %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cloudstorage/cloudstorage.go","lineNumber":487,"sourceCode":"\tf, err := os.Open(source)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open source %q: %w\", source, err)\n\t}\n\tdefer f.Close()\n\n\tif contentType == \"\" {\n\t\tcontentType = mime.TypeByExtension(filepath.Ext(source))\n\t}\n\n\tw := s.client.Bucket(bucket).Object(object).NewWriter(ctx)\n\tif contentType != \"\" {\n\t\tw.ContentType = contentType\n\t}\n\n\tn, err := io.Copy(w, f)\n\tif err != nil {\n\t\t_ = w.Close()\n\t\treturn nil, fmt.Errorf(\"failed to copy %q to object %q in bucket %q: %w\", source, object, bucket, err)\n\t}\n\tif err := w.Close(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to finalize upload of %q to %q/%q: %w\", source, bucket, object, err)\n\t}\n\n\tattrs := w.Attrs()\n\tfinalContentType := \"\"\n\tif attrs != nil {\n\t\tfinalContentType = attrs.ContentType\n\t}\n\treturn map[string]any{\n\t\t\"bucket\":      bucket,\n\t\t\"object\":      object,\n\t\t\"bytes\":       n,\n\t\t\"contentType\": finalContentType,\n\t}, nil\n}\n","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cloudstorage/cloudstorage.go#L469-L505","documentation":"Error \"failed to copy %q to object %q in bucket %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/cloudstorage/cloudstorage.go:487 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"}