googleapis / googleapis/google-cloud-go

storage: Using regional endpoints results in a `Transport: unhandled response frame type *http2.UnknownFrame` log from the http2 package

Open
#12,695 2 comments 0 reactions 1 assignee Claimed by @cpriti-os View on GitHub
api: storage jules
Dominant language
Go
Stars
4.5k
Forks
1.6k
Avg merge
1d 13h
Merged PRs (30d)
109

Description

# Client

GCS

# Environment

```
go version go1.24.2 darwin/arm64

cloud.google.com/go/auth v0.16.4
cloud.google.com/go/storage v1.56.0
google.golang.org/api v0.246.0
```

# Code and Dependencies

```go
package main

import (
"bytes"
"context"
"io"
"log"

"cloud.google.com/go/auth/credentials/impersonate"
"cloud.google.com/go/storage"
"google.golang.org/api/option"
)

func main() {
ctx := context.TODO()

creds, err := impersonate.NewCredentials(&impersonate.CredentialsOptions{
TargetPrincipal: "",
Scopes: []string{"https://www.googleapis.com/auth/devstorage.read_write"},
})
if err != nil {
log.Fatalf("creating creds: %s", creds)
}

client, err := storage.NewClient(ctx,
option.WithAuthCredentials(creds),
option.WithEndpoint("storage.europe-west3.rep.googleapis.com"),
)

bucket := client.Bucket("")
bucket.Attrs(ctx) //

object := bucket.Object("file.txt")

testMessage := bytes.NewReader([]byte(`hello world!`))
w := object.NewWriter(ctx)
if _, err := io.Copy(w, testMessage); err != nil {
_ = w.Close()
log.Fatalf("writing to GCS bucket: %s", err)
}

if err := w.Close(); err != nil {
log.Fatalf("closing writing to GCS bucket: %s", err)
}
log.Print("uploaded successfully, closing storage client", client.Close())
}
```

# Behavior

Calls to `bucket.Attrs(ctx)` and `w.Close()` when supplying `option.WithEndpoint` result in http2 package logging `Transport: unhandled response frame type *http2.UnknownFrame`

The uploads are successful, but I don't know whether this log deserves any attention and if it doesn't then it is simply inflating my logs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.