Title: Use package grpcio-status to parse rich errors in trailing metadata. · Issue #99 · googleapis/python-api-core · GitHub
Open Graph Title: Use package grpcio-status to parse rich errors in trailing metadata. · Issue #99 · googleapis/python-api-core
X Title: Use package grpcio-status to parse rich errors in trailing metadata. · Issue #99 · googleapis/python-api-core
Description: Package: https://pypi.org/project/grpcio-status/ Example: https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L37 We are from IAM Policy Analyzer team and we've recently found that the python client library does not...
Open Graph Description: Package: https://pypi.org/project/grpcio-status/ Example: https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L37 We are from IAM Policy Analyzer team and we've recently found...
X Description: Package: https://pypi.org/project/grpcio-status/ Example: https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L37 We are from IAM Policy Analyzer team and we've recently f...
Opengraph URL: https://github.com/googleapis/python-api-core/issues/99
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use package grpcio-status to parse rich errors in trailing metadata. ","articleBody":"Package: https://pypi.org/project/grpcio-status/\r\n\r\nExample: https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L37\r\n\r\n\u003e We are from IAM Policy Analyzer team and we've recently found that the python client library does not seems to surface the `details` in the Error Status properly. We've tried using gcloud and it works as expected. The comparison is as below:\r\n\r\n```\r\n$ gcloud beta asset analyze-iam-policy --project=cai-playground\r\nERROR: (gcloud.beta.asset.analyze-iam-policy) INVALID_ARGUMENT: Some specified value(s) are invalid.\r\n- '@type': type.googleapis.com/google.rpc.BadRequest\r\n fieldViolations:\r\n - description: At least one of resource selector, identity selector or access selector\r\n needs to be specified.\r\n field: analysis_query\r\n```\r\n\r\n```py\r\n$ gcloud auth application-default login\r\n$ python3\r\n from google.cloud import asset_v1p4beta1\r\n from google.cloud.asset_v1p4beta1 import AnalyzeIamPolicyRequest, IamPolicyAnalysisQuery\r\n parent=\"projects/cai-playground\"\r\n client = asset_v1p4beta1.AssetServiceClient()\r\n response = client.analyze_iam_policy(request=AnalyzeIamPolicyRequest(analysis_query=IamPolicyAnalysisQuery(parent=parent)))\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/local/google/home/aaronlichen/.local/lib/python3.8/site-packages/google/api_core/grpc_helpers.py\", line 57, in error_remapped_callable\r\n return callable_(*args, **kwargs)\r\n File \"/usr/local/google/home/aaronlichen/.local/lib/python3.8/site-packages/grpc/_channel.py\", line 826, in __call__\r\n return _end_unary_response_blocking(state, call, False, None)\r\n File \"/usr/local/google/home/aaronlichen/.local/lib/python3.8/site-packages/grpc/_channel.py\", line 729, in _end_unary_response_blocking\r\n raise _InactiveRpcError(state)\r\ngrpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\n status = StatusCode.INVALID_ARGUMENT\r\n details = \"Some specified value(s) are invalid.\"\r\n debug_error_string = \"{\"created\":\"@1602024200.721639270\",\"description\":\"Error received from peer ipv4:74.125.142.95:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1061,\"grpc_message\":\"Some specified value(s) are invalid.\",\"grpc_status\":3}\"\r\n```","author":{"url":"https://github.com/busunkim96","@type":"Person","name":"busunkim96"},"datePublished":"2020-10-23T00:24:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/99/python-api-core/issues/99"}
| 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:0bdf1c41-b4a1-24d1-6827-a1f3610c0910 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB4C:FCF93:47B16F:69453E:6A4E09BE |
| html-safe-nonce | 944c15789666cc3e8129a1fd553c65aca3874366eaad3b7d01561d048d6ca43d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjRDOkZDRjkzOjQ3QjE2Rjo2OTQ1M0U6NkE0RTA5QkUiLCJ2aXNpdG9yX2lkIjoiMjA1MDA0NDY4NDUxNjg1NDIwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2d06745641b5fc44f347bbf3414543a5589de30cd138dad690fce4db7632f248 |
| hovercard-subject-tag | issue:727804162 |
| 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/99/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ccf022efc2ddfaac08814a74c646ea01834899119c7b35f9953a20954e4bc8a/googleapis/python-api-core/issues/99 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ccf022efc2ddfaac08814a74c646ea01834899119c7b35f9953a20954e4bc8a/googleapis/python-api-core/issues/99 |
| og:image:alt | Package: https://pypi.org/project/grpcio-status/ Example: https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L37 We are from IAM Policy Analyzer team and we've recently found... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | busunkim96 |
| hostname | github.com |
| expected-hostname | github.com |
| None | df0492960db29b4938cb72070351d6b1d0c6c0767b27ceb8394bbf4fcc0223c6 |
| 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 | 52bde38e24398476f8eb1e0760c81346c6a00812 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width