Google Certified Professional Data Engineer

Sign Up Free or Log In to participate!

When i try to execute the insert+with_dml function in snippets.py i get this error

Command used: python snippets.py Testspanner –database-id demodb2 insert_data

Traceback (most recent call last):

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/cloud/spanner_v1/pool.py", line 272, in get

session = self._sessions.get_nowait()

File "/usr/lib/python3.7/queue.py", line 198, in get_nowait

return self.get(block=False)

File "/usr/lib/python3.7/queue.py", line 167, in get

raise Empty

_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable

return callable_(*args, **kwargs)

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/grpc/_channel.py", line 923, in call

return _end_unary_response_blocking(state, call, False, None)

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking

raise _InactiveRpcError(state)

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:

status = StatusCode.INVALID_ARGUMENT

details = "Invalid CreateSession request."

debug_error_string = "{"created":"@1609974114.294819487","description":"Error received from peer ipv4:74.125.202.95:443","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Invalid CreateSession request.","grpc_status":3}"

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

Traceback (most recent call last):

File "snippets.py", line 1770, in

insert_data(args.instance_id, args.database_id)

File "snippets.py", line 105, in insert_data

with database.batch() as batch:

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/cloud/spanner_v1/database.py", line 619, in enter

session = self._session = self._database._pool.get()

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/cloud/spanner_v1/pool.py", line 275, in get

session.create()

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/cloud/spanner_v1/session.py", line 126, in create   

session_pb = api.create_session(request=request, metadata=metadata,)

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/cloud/spanner_v1/services/spanner/client.py", line 441, in create_session

response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 145, in call

return wrapped_func(*args, **kwargs)

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func

on_error=on_error,

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target

return target()

File "/home/cloud_user_p_fcd470ed/python-spanner/samples/samples/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable

six.raise_from(exceptions.from_grpc_error(exc), exc)

File "", line 3, in raise_from

google.api_core.exceptions.InvalidArgument: 400 Invalid CreateSession request.

0 Answers

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?