René's URL Explorer Experiment


Title: DatabaseAdmin: on Duplicate name in Schema, gRPC FailedPrecondition status code is not handled and sent back as None · Issue #38 · googleapis/python-spanner · GitHub

Open Graph Title: DatabaseAdmin: on Duplicate name in Schema, gRPC FailedPrecondition status code is not handled and sent back as None · Issue #38 · googleapis/python-spanner

X Title: DatabaseAdmin: on Duplicate name in Schema, gRPC FailedPrecondition status code is not handled and sent back as None · Issue #38 · googleapis/python-spanner

Description: If I have a table that already exists and try to create the same table, this package errors but its error code is None yet its message is Duplicate name in schema: . Reproduction from google.cloud import spanner_v1 as spanner def main():...

Open Graph Description: If I have a table that already exists and try to create the same table, this package errors but its error code is None yet its message is Duplicate name in schema: . Reproduction from google.cloud ...

X Description: If I have a table that already exists and try to create the same table, this package errors but its error code is None yet its message is Duplicate name in schema: . Reproduction from google.cloud ...

Opengraph URL: https://github.com/googleapis/python-spanner/issues/38

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DatabaseAdmin: on Duplicate name in Schema, gRPC FailedPrecondition status code is not handled and sent back as None","articleBody":"If I have a table that already exists and try to create the same table, this package errors but its error code is None yet its message is `Duplicate name in schema: `.\r\n\r\n### Reproduction\r\n```python\r\nfrom google.cloud import spanner_v1 as spanner\r\n\r\ndef main():\r\n    db = spanner.Client().instance('django-tests').database('db1')\r\n    lro = db.update_ddl(['CREATE TABLE foo (id INT64) PRIMARY KEY(id)'])\r\n\r\n    try:\r\n        result = lro.result()\r\n    except Exception as e:\r\n        print('\\033[31mCode: %s gRPC_StatusCode: %s Message: %s\\033[00m' % \r\n                (e.code, e.grpc_status_code, e.message))\r\n        raise e\r\n    else:\r\n        print(result)\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n```\r\nwhich unfortunately prints out\r\n```shell\r\nCode: None gRPC_StatusCode: None Message: Duplicate name in schema: foo.\r\nTraceback (most recent call last):\r\n  File \"duplicate_table_v1.py\", line 18, in \u003cmodule\u003e\r\n    main()\r\n  File \"duplicate_table_v1.py\", line 12, in main\r\n    raise e\r\n  File \"duplicate_table_v1.py\", line 8, in main\r\n    result = lro.result()\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/future/polling.py\", line 127, in result\r\n    raise self._exception\r\ngoogle.api_core.exceptions.GoogleAPICallError: None Duplicate name in schema: foo.\r\n```\r\n\r\nThis bug presents an inconsistency in the error handling because we get an error with a `None` status code and `None` gRPC status code, yet it has a message.\r\n\r\n### Comparison with Go\r\nI can confirm that Cloud Spanner actually sends back the status code because the Go result actually has the status code, with this reproduction and by investigation the responses sent by the Spanner server\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"context\"\r\n\r\n\tdbadmin \"cloud.google.com/go/spanner/admin/database/apiv1\"\r\n\tdbspb \"google.golang.org/genproto/googleapis/spanner/admin/database/v1\"\r\n)\r\n\r\nfunc main() {\r\n\tctx := context.Background()\r\n\tadminClient, err := dbadmin.NewDatabaseAdminClient(ctx)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tddlReq := \u0026dbspb.UpdateDatabaseDdlRequest{\r\n\t\tDatabase: \"projects/orijtech-161805/instances/django-tests/databases/db1\",\r\n\t\tStatements: []string{\r\n\t\t\t\"CREATE TABLE foo (id INT64) PRIMARY KEY(id)\",\r\n\t\t},\r\n\t}\r\n\tlro, err := adminClient.UpdateDatabaseDdl(ctx, ddlReq)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tif err := lro.Wait(ctx); err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n}\r\n```\r\nand prints out\r\n```shell\r\nSleeping for 947.779411ms\r\npanic: rpc error: code = FailedPrecondition desc = Duplicate name in schema: foo.\r\n\r\ngoroutine 1 [running]:\r\nmain.main()\r\n\t/Users/emmanuelodeke/Desktop/spanner-orm-trials/duplicate_table.go:27 +0x1db\r\nexit status 2\r\n```\r\n\r\n### Postulation\r\nI think that the result of waiting on the long running operation isn't being properly used to retrieve the status code.\r\n\r\n/cc @larkee @skuruppu, and for an FYI @bvandiver @timgraham","author":{"url":"https://github.com/odeke-em","@type":"Person","name":"odeke-em"},"datePublished":"2020-03-16T02:38:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/38/python-spanner/issues/38"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8f1eda07-a5df-2dec-d488-9f816d2b0a43
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9CB6:2C07F4:F283FB:151CB1D:6A4DF0EF
html-safe-noncea0a6e3cd6e45c93ee95c463c21359816e50c781afcfd0d99c6192477ceab1651
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0I2OjJDMDdGNDpGMjgzRkI6MTUxQ0IxRDo2QTRERjBFRiIsInZpc2l0b3JfaWQiOiI1MDc1NDM3ODg0MjUwMzg2NjcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca7dfb064793162de971f07c08a811eca810eb8244a3b6000f5ed5b79e9c7f8be
hovercard-subject-tagissue:581949648
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-spanner/38/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b4773e22fef3e969ec5a22901c1de8b727aaa409ccd02f4c2bff1fdbdece1826/googleapis/python-spanner/issues/38
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b4773e22fef3e969ec5a22901c1de8b727aaa409ccd02f4c2bff1fdbdece1826/googleapis/python-spanner/issues/38
og:image:altIf I have a table that already exists and try to create the same table, this package errors but its error code is None yet its message is Duplicate name in schema: . Reproduction from google.cloud ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameodeke-em
hostnamegithub.com
expected-hostnamegithub.com
None5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566
turbo-cache-controlno-preview
go-importgithub.com/googleapis/python-spanner git https://github.com/googleapis/python-spanner.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992630
octolytics-dimension-repository_nwogoogleapis/python-spanner
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992630
octolytics-dimension-repository_network_root_nwogoogleapis/python-spanner
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef4bb89367ca678f057d79b1abc45d6675b1bd5b2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-spanner/issues/38#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-spanner%2Fissues%2F38
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-spanner%2Fissues%2F38
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fpython-spanner
Reloadhttps://github.com/googleapis/python-spanner/issues/38
Reloadhttps://github.com/googleapis/python-spanner/issues/38
Reloadhttps://github.com/googleapis/python-spanner/issues/38
Please reload this pagehttps://github.com/googleapis/python-spanner/issues/38
googleapis https://github.com/googleapis
python-spannerhttps://github.com/googleapis/python-spanner
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Fork 103 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Star 155 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-spanner
Code https://github.com/googleapis/python-spanner
Issues 0 https://github.com/googleapis/python-spanner/issues
Pull requests 0 https://github.com/googleapis/python-spanner/pulls
Actions https://github.com/googleapis/python-spanner/actions
Projects https://github.com/googleapis/python-spanner/projects
Security and quality 0 https://github.com/googleapis/python-spanner/security
Insights https://github.com/googleapis/python-spanner/pulse
Code https://github.com/googleapis/python-spanner
Issues https://github.com/googleapis/python-spanner/issues
Pull requests https://github.com/googleapis/python-spanner/pulls
Actions https://github.com/googleapis/python-spanner/actions
Projects https://github.com/googleapis/python-spanner/projects
Security and quality https://github.com/googleapis/python-spanner/security
Insights https://github.com/googleapis/python-spanner/pulse
DatabaseAdmin: on Duplicate name in Schema, gRPC FailedPrecondition status code is not handled and sent back as Nonehttps://github.com/googleapis/python-spanner/issues/38#top
https://github.com/larkee
api: spannerIssues related to the googleapis/python-spanner API.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22api%3A%20spanner%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com/odeke-em
odeke-emhttps://github.com/odeke-em
on Mar 16, 2020https://github.com/googleapis/python-spanner/issues/38#issue-581949648
@larkeehttps://github.com/larkee
@skuruppuhttps://github.com/skuruppu
@bvandiverhttps://github.com/bvandiver
@timgrahamhttps://github.com/timgraham
larkeehttps://github.com/larkee
api: spannerIssues related to the googleapis/python-spanner API.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22api%3A%20spanner%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.https://github.com/googleapis/python-spanner/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.