Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

samples.samples.snippets_test: test_create_client_with_query_options failed #406

Closed

Description

@flaky-bot

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 7b8d856
buildURL: Build Status, Sponge
status: failed

Test output
args = (session: "projects/python-docs-samples-tests/instances/test-instance-03175cbad1/databases/test-db-78e4b8da2e/sessions...s"
params {
}
query_options {
  optimizer_version: "1"
  optimizer_statistics_package: "auto_20191128_14_47_22UTC"
}
,)
kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/python-docs-samples-tests/instances/test-instance-03175cbad1/...0j9Vuyc7VWPLqdjZfVQ'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.38.1 gax/1.31.0 gccl/3.6.0')], 'timeout': 3600.0}
result = <_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
>
prefetch_first = True
@general_helpers.wraps(callable_)
def error_remapped_callable(*args, **kwargs):
    try:
        result = callable_(*args, **kwargs)
        # Auto-fetching the first result causes PubSub client's streaming pull
        # to hang when re-opening the stream, thus we need examine the hacky
        # hidden flag to see if pre-fetching is disabled.
        # https://github.com/googleapis/python-pubsub/issues/93#issuecomment-630762257
        prefetch_first = getattr(callable_, "_prefetch_first_result_", True)
        return _StreamingResponseIterator(
          result, prefetch_first_result=prefetch_first
        )

.nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:161:


self = <google.api_core.grpc_helpers._StreamingResponseIterator object at 0x7f2e0595d710>
wrapped = <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

prefetch_first_result = True

def __init__(self, wrapped, prefetch_first_result=True):
    self._wrapped = wrapped

    # This iterator is used in a retry context, and returned outside after init.
    # gRPC will not throw an exception until the stream is consumed, so we need
    # to retrieve the first result, in order to fail, in order to trigger a retry.
    try:
        if prefetch_first_result:
          self._stored_first_result = six.next(self._wrapped)

.nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:83:


self = <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

def __next__(self):
  return self._next()

.nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:426:


self = <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

def _next(self):
    with self._state.condition:
        if self._state.code is None:
            event_handler = _event_handler(self._state,
                                           self._response_deserializer)
            self._state.due.add(cygrpc.OperationType.receive_message)
            operating = self._call.operate(
                (cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS),),
                event_handler)
            if not operating:
                self._state.due.remove(cygrpc.OperationType.receive_message)
        elif self._state.code is grpc.StatusCode.OK:
            raise StopIteration()
        else:
            raise self

        def _response_ready():
            return (self._state.response is not None or
                    (cygrpc.OperationType.receive_message
                     not in self._state.due and
                     self._state.code is not None))

        _common.wait(self._state.condition.wait, _response_ready)
        if self._state.response is not None:
            response = self._state.response
            self._state.response = None
            return response
        elif cygrpc.OperationType.receive_message not in self._state.due:
            if self._state.code is grpc.StatusCode.OK:
                raise StopIteration()
            elif self._state.code is not None:
              raise self

E grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
E status = StatusCode.INVALID_ARGUMENT
E details = "Requested optimizer statistics package not found: auto_20191128_14_47_22UTC."
E debug_error_string = "{"created":"@1625909969.479153083","description":"Error received from peer ipv4:74.125.195.95:443","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
E >

.nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:826: _MultiThreadedRendezvous

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

capsys = <_pytest.capture.CaptureFixture object at 0x7f2e0470a940>

def test_create_client_with_query_options(capsys):
  snippets.create_client_with_query_options(INSTANCE_ID, DATABASE_ID)

snippets_test.py:417:


snippets.py:1735: in create_client_with_query_options
for row in results:
../../google/cloud/spanner_v1/streamed.py:149: in iter
self._consume_next()
../../google/cloud/spanner_v1/streamed.py:121: in _consume_next
response = six.next(self._response_iterator)
../../google/cloud/spanner_v1/snapshot.py:59: in _restart_on_unavailable
iterator = method(request=request)
../../google/cloud/spanner_v1/services/spanner/client.py:884: in execute_streaming_sql
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
.nox/py-3-6/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py:145: in call
return wrapped_func(*args, **kwargs)
.nox/py-3-6/lib/python3.6/site-packages/google/api_core/timeout.py:102: in func_with_timeout
return func(*args, **kwargs)
.nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:164: in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)


value = None
from_value = <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

???
E google.api_core.exceptions.InvalidArgument: 400 Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.

:3: InvalidArgument

Activity

  1. added
    flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 10, 2021
  2. added
    api: spannerIssues related to the googleapis/python-spanner API.
    samplesIssues that are directly related to samples.
    on Jul 10, 2021
  3. flaky-bot commented on Jul 10, 2021

    @flaky-bot
    Author

    Looks like this issue is flaky. 😟

    I'm going to leave this open and stop commenting.

    A human should fix and close this.


    When run at the same commit (7b8d856), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

  4. added
    flakybot: flakyTells the Flaky Bot not to close or comment on this issue.
    on Jul 10, 2021
  5. flaky-bot commented on Jul 17, 2021

    @flaky-bot
    Author

    Oops! Looks like this issue is still flaky. It failed again. 😬

    I reopened the issue, but a human will need to close it again.


    commit: bd84a4d
    buildURL: Build Status, Sponge
    status: failed

    Test output
    args = (session: "projects/python-docs-samples-tests/instances/test-instance-42f64f053d/databases/test-db-dfbbd63808/sessions...s"
    params {
    }
    query_options {
      optimizer_version: "1"
      optimizer_statistics_package: "auto_20191128_14_47_22UTC"
    }
    ,)
    kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/python-docs-samples-tests/instances/test-instance-42f64f053d/...1ABm8ruzI_ahos_I9ig'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.38.1 gax/1.31.0 gccl/3.6.0')], 'timeout': 3600.0}
    result = <_MultiThreadedRendezvous of RPC that terminated with:
    	status = StatusCode.INVALID_ARGUMENT
    	details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
    >
    prefetch_first = True
    
    @general_helpers.wraps(callable_)
    def error_remapped_callable(*args, **kwargs):
        try:
            result = callable_(*args, **kwargs)
            # Auto-fetching the first result causes PubSub client's streaming pull
            # to hang when re-opening the stream, thus we need examine the hacky
            # hidden flag to see if pre-fetching is disabled.
            # https://github.com/googleapis/python-pubsub/issues/93#issuecomment-630762257
            prefetch_first = getattr(callable_, "_prefetch_first_result_", True)
            return _StreamingResponseIterator(
    
              result, prefetch_first_result=prefetch_first
    
            )
    

    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:161:


    self = <google.api_core.grpc_helpers._StreamingResponseIterator object at 0x7f71144a5dd8>
    wrapped = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    prefetch_first_result = True

    def __init__(self, wrapped, prefetch_first_result=True):
        self._wrapped = wrapped
    
        # This iterator is used in a retry context, and returned outside after init.
        # gRPC will not throw an exception until the stream is consumed, so we need
        # to retrieve the first result, in order to fail, in order to trigger a retry.
        try:
            if prefetch_first_result:
    
              self._stored_first_result = six.next(self._wrapped)
    

    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:83:


    self = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    def __next__(self):
    
      return self._next()
    

    .nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:426:


    self = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    def _next(self):
        with self._state.condition:
            if self._state.code is None:
                event_handler = _event_handler(self._state,
                                               self._response_deserializer)
                self._state.due.add(cygrpc.OperationType.receive_message)
                operating = self._call.operate(
                    (cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS),),
                    event_handler)
                if not operating:
                    self._state.due.remove(cygrpc.OperationType.receive_message)
            elif self._state.code is grpc.StatusCode.OK:
                raise StopIteration()
            else:
                raise self
    
            def _response_ready():
                return (self._state.response is not None or
                        (cygrpc.OperationType.receive_message
                         not in self._state.due and
                         self._state.code is not None))
    
            _common.wait(self._state.condition.wait, _response_ready)
            if self._state.response is not None:
                response = self._state.response
                self._state.response = None
                return response
            elif cygrpc.OperationType.receive_message not in self._state.due:
                if self._state.code is grpc.StatusCode.OK:
                    raise StopIteration()
                elif self._state.code is not None:
    
                  raise self
    

    E grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
    E status = StatusCode.INVALID_ARGUMENT
    E details = "Requested optimizer statistics package not found: auto_20191128_14_47_22UTC."
    E debug_error_string = "{"created":"@1626514533.392717107","description":"Error received from peer ipv4:74.125.197.95:443","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
    E >

    .nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:826: _MultiThreadedRendezvous

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

    capsys = <_pytest.capture.CaptureFixture object at 0x7f71144b2dd8>

    def test_create_client_with_query_options(capsys):
    
      snippets.create_client_with_query_options(INSTANCE_ID, DATABASE_ID)
    

    snippets_test.py:417:


    snippets.py:1735: in create_client_with_query_options
    for row in results:
    ../../google/cloud/spanner_v1/streamed.py:149: in iter
    self._consume_next()
    ../../google/cloud/spanner_v1/streamed.py:121: in _consume_next
    response = six.next(self._response_iterator)
    ../../google/cloud/spanner_v1/snapshot.py:59: in _restart_on_unavailable
    iterator = method(request=request)
    ../../google/cloud/spanner_v1/services/spanner/client.py:884: in execute_streaming_sql
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py:145: in call
    return wrapped_func(*args, **kwargs)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/timeout.py:102: in func_with_timeout
    return func(*args, **kwargs)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:164: in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)


    value = None
    from_value = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    ???
    E google.api_core.exceptions.InvalidArgument: 400 Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.

    :3: InvalidArgument

  6. larkee commented on Jul 20, 2021

    @larkee
    Contributor

    This test is being skipped as of #422. #421 is tracking when it is unskipped which will require it to pass so I am closing this issue in favour of that one

  7. flaky-bot commented on Jul 21, 2021

    @flaky-bot
    Author

    Oops! Looks like this issue is still flaky. It failed again. 😬

    I reopened the issue, but a human will need to close it again.


    commit: b0455d0
    buildURL: Build Status, Sponge
    status: failed

    Test output
    args = (session: "projects/python-docs-samples-tests/instances/test-instance-a9008232a0/databases/test-db-ce75d04c2d/sessions...s"
    params {
    }
    query_options {
      optimizer_version: "1"
      optimizer_statistics_package: "auto_20191128_14_47_22UTC"
    }
    ,)
    kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/python-docs-samples-tests/instances/test-instance-a9008232a0/...R6tiywtK0p9TO_rKmGQ'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.38.1 gax/1.31.0 gccl/3.6.0')], 'timeout': 3600.0}
    result = <_MultiThreadedRendezvous of RPC that terminated with:
    	status = StatusCode.INVALID_ARGUMENT
    	details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
    >
    prefetch_first = True
    
    @general_helpers.wraps(callable_)
    def error_remapped_callable(*args, **kwargs):
        try:
            result = callable_(*args, **kwargs)
            # Auto-fetching the first result causes PubSub client's streaming pull
            # to hang when re-opening the stream, thus we need examine the hacky
            # hidden flag to see if pre-fetching is disabled.
            # https://github.com/googleapis/python-pubsub/issues/93#issuecomment-630762257
            prefetch_first = getattr(callable_, "_prefetch_first_result_", True)
            return _StreamingResponseIterator(
    
              result, prefetch_first_result=prefetch_first
    
            )
    

    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:161:


    self = <google.api_core.grpc_helpers._StreamingResponseIterator object at 0x7f3bf8d1f748>
    wrapped = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    prefetch_first_result = True

    def __init__(self, wrapped, prefetch_first_result=True):
        self._wrapped = wrapped
    
        # This iterator is used in a retry context, and returned outside after init.
        # gRPC will not throw an exception until the stream is consumed, so we need
        # to retrieve the first result, in order to fail, in order to trigger a retry.
        try:
            if prefetch_first_result:
    
              self._stored_first_result = six.next(self._wrapped)
    

    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:83:


    self = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    def __next__(self):
    
      return self._next()
    

    .nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:426:


    self = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    def _next(self):
        with self._state.condition:
            if self._state.code is None:
                event_handler = _event_handler(self._state,
                                               self._response_deserializer)
                self._state.due.add(cygrpc.OperationType.receive_message)
                operating = self._call.operate(
                    (cygrpc.ReceiveMessageOperation(_EMPTY_FLAGS),),
                    event_handler)
                if not operating:
                    self._state.due.remove(cygrpc.OperationType.receive_message)
            elif self._state.code is grpc.StatusCode.OK:
                raise StopIteration()
            else:
                raise self
    
            def _response_ready():
                return (self._state.response is not None or
                        (cygrpc.OperationType.receive_message
                         not in self._state.due and
                         self._state.code is not None))
    
            _common.wait(self._state.condition.wait, _response_ready)
            if self._state.response is not None:
                response = self._state.response
                self._state.response = None
                return response
            elif cygrpc.OperationType.receive_message not in self._state.due:
                if self._state.code is grpc.StatusCode.OK:
                    raise StopIteration()
                elif self._state.code is not None:
    
                  raise self
    

    E grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
    E status = StatusCode.INVALID_ARGUMENT
    E details = "Requested optimizer statistics package not found: auto_20191128_14_47_22UTC."
    E debug_error_string = "{"created":"@1626860313.876487283","description":"Error received from peer ipv4:74.125.195.95:443","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"
    E >

    .nox/py-3-6/lib/python3.6/site-packages/grpc/_channel.py:826: _MultiThreadedRendezvous

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

    capsys = <_pytest.capture.CaptureFixture object at 0x7f3bf8d67c88>

    def test_create_client_with_query_options(capsys):
    
      snippets.create_client_with_query_options(INSTANCE_ID, DATABASE_ID)
    

    snippets_test.py:417:


    snippets.py:1735: in create_client_with_query_options
    for row in results:
    ../../google/cloud/spanner_v1/streamed.py:149: in iter
    self._consume_next()
    ../../google/cloud/spanner_v1/streamed.py:121: in _consume_next
    response = six.next(self._response_iterator)
    ../../google/cloud/spanner_v1/snapshot.py:59: in _restart_on_unavailable
    iterator = method(request=request)
    ../../google/cloud/spanner_v1/services/spanner/client.py:884: in execute_streaming_sql
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py:145: in call
    return wrapped_func(*args, **kwargs)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/timeout.py:102: in func_with_timeout
    return func(*args, **kwargs)
    .nox/py-3-6/lib/python3.6/site-packages/google/api_core/grpc_helpers.py:164: in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)


    value = None
    from_value = <_MultiThreadedRendezvous of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Requested opt...:1066,"grpc_message":"Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.","grpc_status":3}"

    ???
    E google.api_core.exceptions.InvalidArgument: 400 Requested optimizer statistics package not found: auto_20191128_14_47_22UTC.

    :3: InvalidArgument

  8. added
    type: processA process-related concern. May include testing, release, or the like.
    and removed
    🚨This issue needs some love.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 28, 2021
  9. tseaver commented on Jul 28, 2021

    @tseaver
    Contributor

    @larkee The periodic build rolls back to the most recent released version:

    --- IMPORTANT IMPORTANT IMPORTANT ---
    Now we rewind the repo back to the latest release...
    Previous HEAD position was b0455d0 fix(deps): pin 'google-{api,cloud}-core' to allow 2.x versions (#415)
    HEAD is now at 32a5576 chore: release 3.6.0 (#370)
    The current head is:
    32a557674dfe0718ea922d9a2359b89a26a7baf8
    --- IMPORTANT IMPORTANT IMPORTANT ---
    

    The fix applied in #422 comes after that release. If we can get #398 merged, this bug should close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.flakybot: flakyTells the Flaky Bot not to close or comment on this issue.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.samplesIssues that are directly related to samples.type: processA process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions