Title: Misleading error message when user is missing permissions · Issue #342 · googleapis/python-api-core · GitHub
Open Graph Title: Misleading error message when user is missing permissions · Issue #342 · googleapis/python-api-core
X Title: Misleading error message when user is missing permissions · Issue #342 · googleapis/python-api-core
Description: Environment details OS type and version: MacOS 11.6.2 Python version: 3.9.9 pip version: 20.3.4 pandas-gbq version: 0.17.0 Steps to reproduce Create a service account that has the "BigQuery Data Editor" and "BigQuery JobUser" roles (thes...
Open Graph Description: Environment details OS type and version: MacOS 11.6.2 Python version: 3.9.9 pip version: 20.3.4 pandas-gbq version: 0.17.0 Steps to reproduce Create a service account that has the "BigQuery Data Ed...
X Description: Environment details OS type and version: MacOS 11.6.2 Python version: 3.9.9 pip version: 20.3.4 pandas-gbq version: 0.17.0 Steps to reproduce Create a service account that has the "BigQuery Da...
Opengraph URL: https://github.com/googleapis/python-api-core/issues/342
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Misleading error message when user is missing permissions","articleBody":"#### Environment details\r\n\r\n - OS type and version: MacOS 11.6.2\r\n - Python version: 3.9.9\r\n - pip version: 20.3.4\r\n - `pandas-gbq` version: 0.17.0\r\n\r\n#### Steps to reproduce\r\n\r\n1. Create a service account that has the \"BigQuery Data Editor\" and \"BigQuery JobUser\" roles (these are not sufficient for using read_gbq; it's a user error to use them, but the focus of this ticket is that the helpful error message gets lost):\r\n2. Invoke pandas_gbq.read_gbq with params that should work - i.e. they'd work fine if the user had the \"BigQuery User\" role\r\n\r\nYou'll get this error:\r\n\r\n```\r\n\u003e if isinstance(rpc_exc, grpc.Call) or _is_informative_grpc_error(rpc_exc):\r\nE AttributeError: 'NoneType' object has no attribute 'Call'\r\n```\r\n\r\nThe actual error is visible in the traceback:\r\n\r\n```\r\nE grpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\nE \tstatus = StatusCode.PERMISSION_DENIED\r\nE \tdetails = \"request failed: the user does not have 'bigquery.readsessions.create' permission for 'projects/redacted'\"\r\n```\r\n\r\nThe \"NoneType has no attribute\" message is misleading and obscures the problem. I believe the error should be reporting the permission issue that is captured in the above block.\r\n\r\nAgain, this is ultimately a user error due to the wrong permissions being used, but a user will find that out more quickly by getting back the actual error instead of the \"NoneType has no attribute\" error. ","author":{"url":"https://github.com/rjrudin","@type":"Person","name":"rjrudin"},"datePublished":"2022-02-17T18:34:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/342/python-api-core/issues/342"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e0e14896-b00a-7ad5-9e1a-0732825ade46 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAC4:3E7EA5:17FDFD6:232C03B:6A4E533D |
| html-safe-nonce | 3ee45f48d4bd7b2ff06430bd93d1eafb4c60426266258c20a7c2334866cbdbe4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUM0OjNFN0VBNToxN0ZERkQ2OjIzMkMwM0I6NkE0RTUzM0QiLCJ2aXNpdG9yX2lkIjoiNjQ0NDk1Mjg3MTYwNzYyMDQxMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a3a7f6a3a7e24388e9e17fd2858ad88e6405f058db6091b076b5875acd5b2d1 |
| hovercard-subject-tag | issue:1142014886 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-api-core/342/issue_layout |
| twitter:image | https://opengraph.githubassets.com/083961b290ebc80d863c5e46b5319c97507e517651453e26a7e37339c4cf00d7/googleapis/python-api-core/issues/342 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/083961b290ebc80d863c5e46b5319c97507e517651453e26a7e37339c4cf00d7/googleapis/python-api-core/issues/342 |
| og:image:alt | Environment details OS type and version: MacOS 11.6.2 Python version: 3.9.9 pip version: 20.3.4 pandas-gbq version: 0.17.0 Steps to reproduce Create a service account that has the "BigQuery Data Ed... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rjrudin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992456 |
| octolytics-dimension-repository_nwo | googleapis/python-api-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992456 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-api-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f344f1eab54fc7dfc02d0d018cda7e158c3db65c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width