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.backup_sample_test: test_create_backup_with_encryption_key failed #408

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: 1b04bbf
buildURL: Build Status, Sponge
status: failed

Test output
args = (parent: "projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa"
backup_id: "test-backup-073212d0df"
b...ojects/python-docs-samples-tests/locations/us-central1/keyRings/spanner-test-keyring/cryptoKeys/spanner-test-cmek"
}
,)
kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/...sts/instances/test-instance-4deefb9cfa'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.38.1 gax/1.31.0 gccl/3.6.0')]}
@six.wraps(callable_)
def error_remapped_callable(*args, **kwargs):
    try:
      return callable_(*args, **kwargs)

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


self = <grpc._channel._UnaryUnaryMultiCallable object at 0x7fb9f6bf2438>
request = parent: "projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa"
backup_id: "test-backup-073212d0df"
ba...projects/python-docs-samples-tests/locations/us-central1/keyRings/spanner-test-keyring/cryptoKeys/spanner-test-cmek"
}

timeout = None
metadata = [('google-cloud-resource-prefix', 'projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/backups/test-...ests/instances/test-instance-4deefb9cfa'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.38.1 gax/1.31.0 gccl/3.6.0')]
credentials = None, wait_for_ready = None, compression = None

def __call__(self,
             request,
             timeout=None,
             metadata=None,
             credentials=None,
             wait_for_ready=None,
             compression=None):
    state, call, = self._blocking(request, timeout, metadata, credentials,
                                  wait_for_ready, compression)
  return _end_unary_response_blocking(state, call, False, None)

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


state = <grpc._channel._RPCState object at 0x7fb9f6c8f978>
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7fb9f6a63548>
with_call = False, deadline = None

def _end_unary_response_blocking(state, call, with_call, deadline):
    if state.code is grpc.StatusCode.OK:
        if with_call:
            rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
            return state.response, rendezvous
        else:
            return state.response
    else:
      raise _InactiveRpcError(state)

E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.FAILED_PRECONDITION
E details = "Cannot create backup (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/backups/test-backup-073212d0df) for database (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/databases/test-db-a8bb22aa8e) because the maximum number of pending backups (1) for the database has been reached. Please retry the operation once the pending backups complete."
E debug_error_string = "{"created":"@1626168610.152835507","description":"Error received from peer ipv4:74.125.195.95:443","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"Cannot create backup (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/backups/test-backup-073212d0df) for database (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/databases/test-db-a8bb22aa8e) because the maximum number of pending backups (1) for the database has been reached. Please retry the operation once the pending backups complete.","grpc_status":9}"
E >

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

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

capsys = <_pytest.capture.CaptureFixture object at 0x7fb9f6a65278>
spanner_instance = <google.cloud.spanner_v1.instance.Instance object at 0x7fb9f6bc48d0>
database = <google.cloud.spanner_v1.database.Database object at 0x7fb9f6bc4588>

def test_create_backup_with_encryption_key(capsys, spanner_instance, database):
    kms_key_name = "projects/{}/locations/{}/keyRings/{}/cryptoKeys/{}".format(
        spanner_instance._client.project, "us-central1", "spanner-test-keyring", "spanner-test-cmek"
    )
  backup_sample.create_backup_with_encryption_key(INSTANCE_ID, DATABASE_ID, CMEK_BACKUP_ID, kms_key_name)

backup_sample_test.py:92:


backup_sample.py:74: in create_backup_with_encryption_key
operation = backup.create()
../../google/cloud/spanner_v1/backup.py:261: in create
future = api.create_backup(request=request, metadata=metadata,)
../../google/cloud/spanner_admin_database_v1/services/database_admin/client.py:1426: in create_backup
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/grpc_helpers.py:69: in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)


value = None
from_value = <_InactiveRpcError of RPC that terminated with:
status = StatusCode.FAILED_PRECONDITION
details = "Cannot create bac...) for the database has been reached. Please retry the operation once the pending backups complete.","grpc_status":9}"

???
E google.api_core.exceptions.FailedPrecondition: 400 Cannot create backup (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/backups/test-backup-073212d0df) for database (projects/python-docs-samples-tests/instances/test-instance-4deefb9cfa/databases/test-db-a8bb22aa8e) because the maximum number of pending backups (1) for the database has been reached. Please retry the operation once the pending backups complete.

:3: FailedPrecondition

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 13, 2021
  2. added
    api: spannerIssues related to the googleapis/python-spanner API.
    samplesIssues that are directly related to samples.
    on Jul 13, 2021
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: 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.samplesIssues that are directly related to samples.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions