Skip to content

BigTable cluster update() requires location_id #15311

@fm100

Description

@fm100

https://cloud.google.com/python/docs/reference/bigtable/latest/cluster

This doc says that location_id is Creation Only, but it raises an exception when not given. Didn't have any problems with the code example below when using google-cloud-bigtable==1.7.3.

Environment details

  • OS type and version:
  • Python version: 3.11
  • pip version: pip 24.0
  • google-cloud-bigtable version: 2.23.0, 2.23.1

Steps to reproduce

  1. Create the client
  2. Create the instance with instance ID
  3. Create the cluster with cluster ID
  4. Set serve_nodes to change the node count
  5. Update the cluster.
  6. Fail

Code example

from google.cloud.bigtable import Client

project = "my-project"
instance_id = "my-bt-instance"
cluster_id = "my-bt-cluster"

client = Client(admin=True)
instance = client.instance(instance_id)
cluster = instance.cluster(cluster_id)
cluster.serve_nodes = 2
cluster.update()

Stack trace

Traceback (most recent call last):
  File "/opt/python3.11/lib/python3.11/site-packages/google/api_core/grpc_helpers.py", line 76, in error_remapped_callable
    return callable_(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/grpc/_channel.py", line 1176, in __call__
    return _end_unary_response_blocking(state, call, False, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/grpc/_channel.py", line 1005, in _end_unary_response_blocking
    raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "When parsing 'projects/focal-elf-631/locations/None' : Location name expected in the form 'projects/<project_id>/locations/<zone_id>'."
	debug_error_string = "UNKNOWN:Error received from peer ipv4:64.233.181.95:443 {created_time:"2024-05-16T19:56:00.268248494+00:00", grpc_status:3, grpc_message:"When parsing \'projects/focal-elf-631/locations/None\' : Location name expected in the form \'projects/<project_id>/locations/<zone_id>\'."}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/operators/python.py", line 192, in execute
    return_value = self.execute_callable()
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/airflow/operators/python.py", line 209, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/gcs/dags/dsp_data_eng/mtt_scan/mtt_scan_all_regions.py", line 79, in prework
    operation = cluster.update()
                ^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/google/cloud/bigtable/cluster.py", line 444, in update
    return client.instance_admin_client.partial_update_cluster(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py", line 1814, in partial_update_cluster
    response = rpc(
               ^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
    return wrapped_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
    raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.InvalidArgument: 400 When parsing 'projects/focal-elf-631/locations/None' : Location name expected in the form 'projects/<project_id>/locations/<zone_id>'

Metadata

Metadata

Assignees

Labels

api: bigtableIssues related to the Bigtable API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions