diff --git a/physical/gcs/gcs.go b/physical/gcs/gcs.go index 3138aa5ddf01..5513ed63a429 100644 --- a/physical/gcs/gcs.go +++ b/physical/gcs/gcs.go @@ -2,6 +2,7 @@ package gcs import ( "context" + "crypto/md5" "errors" "fmt" "io/ioutil" @@ -177,6 +178,8 @@ func (b *Backend) Put(ctx context.Context, entry *physical.Entry) (retErr error) // Insert w := b.client.Bucket(b.bucket).Object(entry.Key).NewWriter(ctx) w.ChunkSize = b.chunkSize + md5Array := md5.Sum(entry.Value) + w.MD5 = md5Array[:] defer func() { closeErr := w.Close() if closeErr != nil { diff --git a/vault/expiration.go b/vault/expiration.go index 4d3ceff54a62..e8aae8393684 100644 --- a/vault/expiration.go +++ b/vault/expiration.go @@ -1384,14 +1384,14 @@ func (m *ExpirationManager) loadEntryInternal(ctx context.Context, leaseID strin view := m.leaseView(ns) out, err := view.Get(ctx, leaseID) if err != nil { - return nil, errwrap.Wrapf("failed to read lease entry: {{err}}", err) + return nil, errwrap.Wrapf(fmt.Sprintf("failed to read lease entry %s: {{err}}", leaseID), err) } if out == nil { return nil, nil } le, err := decodeLeaseEntry(out.Value) if err != nil { - return nil, errwrap.Wrapf("failed to decode lease entry: {{err}}", err) + return nil, errwrap.Wrapf(fmt.Sprintf("failed to decode lease entry %s: {{err}}", leaseID), err) } le.namespace = ns