GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cloud Spanner client incorrectly handles NOT_FOUND error returned by create database · Issue #4071 · googleapis/google-cloud-python

Cloud Spanner client incorrectly handles NOT_FOUND error returned by create database #4071

New issue
Copy link
New issue
Copy link
Closed
Closed
Cloud Spanner client incorrectly handles NOT_FOUND error returned by create database#4071
Copy link
Assignees
yoshi-automation
Labels
api: spannerIssues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.

Description

@vkedia
vkedia
opened on Sep 27, 2017
Issue body actions

While creating a database, is the backend returns NOT_FOUND error, the client assumes it to indicate that instance is not found and thus returns "Instance not found" error message:
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/spanner/google/cloud/spanner_v1/database.py#L213

This is not always the case as cloud spanner can return NOT_FOUND in other scenarios. For eg in the "CREATE INDEX ... " ddl statement that table that the index is being created on does not exist it would return a NOT_FOUND. I think the fix would be to just pass the error message returned by the rpc to the user.

This can be reproduced using:

from google.cloud import spanner

"""Creates a database and tables for pattern 1 sample data."""

spanner_client = spanner.Client()

instance = spanner_client.instance("test-instance")



database = instance.database("bitemporal_pattern1", ddl_statements=[

    """CREATE TABLE MyTable (

        Id        String(36) NOT NULL,

        Field1  STRING(36) NOT NULL

) PRIMARY KEY (Id)"""

,

"""CREATE INDEX IDX ON yTable (Field1)"""

])



operation = database.create()



print('Waiting for operation to complete...')

operation.result()

Activity

  1. lukesneeringer
    added
    api: spannerIssues related to the Spanner API.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Sep 27, 2017
  2. vkedia commented on Oct 13, 2017

    @vkedia
    vkedia
    on Oct 13, 2017
    Author
    More actions

    @lukesneeringer @tseaver Any updates on this?

  3. chemelnucfin
    added 3 commits that reference this issue on Dec 8, 2017

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 19097f4 is merged into the 'master' branch.
    19097f4

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit fc96009 is merged into the 'master' branch.
    fc96009

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit b0cbb6a is merged into the 'master' branch.
    b0cbb6a
  4. chemelnucfin
    added 8 commits that reference this issue on Dec 20, 2017

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit f16fff4 is merged into the 'master' branch.
    f16fff4

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit f542031 is merged into the 'master' branch.
    f542031

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 3deb5fa is merged into the 'master' branch.
    3deb5fa

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 84271e2 is merged into the 'master' branch.
    84271e2

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 046e79d is merged into the 'master' branch.
    046e79d

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 9117427 is merged into the 'master' branch.
    9117427

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit a68f323 is merged into the 'master' branch.
    a68f323

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 9f701bc is merged into the 'master' branch.
    9f701bc
  5. dhermes
    added a commit that references this issue on Dec 20, 2017

    Spanner: Fix database not found error, Closes googleapis#4071

    This issue will close once commit 7c9b048 is merged into the 'master' branch.
    7c9b048
  6. dhermes
    closed this as completedin #4557on Dec 20, 2017
  7. dhermes
    added a commit that references this issue on Dec 20, 2017

    Spanner: Use details from gRPC exception on datatbase create failure (#…

    This issue will close once commit d8317b5 is merged into the 'main' branch.
    d8317b5
  8. JustinBeckwith
    assigned
    yoshi-automation
    on Feb 1, 2021
  9. parthea
    added a commit that references this issue on Sep 22, 2023

    chore: move samples from python-docs-sample (#33)

    69c4425
  10. parthea
    added a commit that references this issue on Mar 9, 2026

    Spanner: Use details from gRPC exception on datatbase create failure (#…

    This issue will close once commit dbcb5db is merged into the 'main' branch.
    dbcb5db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @yoshi-automation
    yoshi-automation

Labels

api: spannerIssues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.