1

I am trying to write a row to a Bigtable table using the Go SDK for Bigtable. I am using the apply method on a table object.

I receive the following error when I try to write more than once:

rpc error: code = Canceled desc = grpc: the client connection is closing

Following is my code:

func Put(tableName string, columnFamilyName string, rowKey string, attrMap map[string]interface{}) error {

    tbl := BigTableClient.Open(tableName)
    mut := bigtable.NewMutation()

    for key, val := range attrMap {
        if utils.IsJSON(val.(string)) {
            v, _ := json.Marshal(val)
            mut.Set(columnFamilyName, key, bigtable.Now(), []byte(v))
        } else {
            v := val.(string)
            mut.Set(columnFamilyName, key, bigtable.Now(), []byte(v))
        }
    }
    err := tbl.Apply(BigTableContext, rowKey, mut)
    if err != nil {
        errMsg := "Error while writing to BT: " + err.Error()
        logger.LogError(errMsg)
    }
    return err
}

Can someone help me understand the issue?

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
Akshay Apte
  • 1,539
  • 9
  • 24

1 Answers1

1

This seems to be a gRPC error.

Maybe you have network latency that cause gRPC error.

You could test to use as mentioned here using Bigtable with your own gRPC conn.

Misha Brukman
  • 12,938
  • 4
  • 61
  • 78
albttx
  • 3,444
  • 4
  • 23
  • 42