Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigTable cluster update() requires location_id #963

Open
fm100 opened this issue May 17, 2024 · 0 comments
Open

BigTable cluster update() requires location_id #963

fm100 opened this issue May 17, 2024 · 0 comments
Assignees
Labels
api: bigtable Issues related to the googleapis/python-bigtable API.

Comments

@fm100
Copy link

fm100 commented May 17, 2024

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>'
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API.
Projects
None yet
Development

No branches or pull requests

2 participants