ricardolsmendes / datacatalog-tag-manager

Python package to manage Google Cloud Data Catalog tags, loading metadata from external sources -- currently supports the CSV file format
MIT License
18 stars 11 forks source link

google.api_core.exceptions.MethodNotImplemented: 501 Received http2 header with status: 404 #39

Closed sandeep2sky closed 3 years ago

sandeep2sky commented 3 years ago

Hi @ricardolsmendes ,

Thanks for the Data catalog package. It is throwing below error while running on GCP Cloud Shell. Could you please help me to resolve it.

Error Log============= INFO:root:===> Upsert Tags from CSV [STARTED] INFO:root: INFO:root:Reading CSV file: DataCatalog_input.csv... INFO:root: INFO:root:Upserting the Tags... INFO:root: INFO:root:GET Entry: //bigquery.googlapis.com/projects/one-global-dde-dev/datasets/OPUS/tables/DWL_DOM_AR INFO:root:-------------------------------------------------- Traceback (most recent call last): File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 73, in error_remappedcallable return callable(*args, **kwargs) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/grpc/_channel.py", line 923, in call return _end_unary_response_blocking(state, call, False, None) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking raise _InactiveRpcError(state) grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with: status = StatusCode.UNIMPLEMENTED details = "Received http2 header with status: 404" debug_error_string = "{"created":"@1616126950.574176093","description":"Received http2 :status header with non-200 OK status","file":"src/core/ext/filters/http/client/http_client_filter.cc","file_line":129,"grpc_message":"Received http2 header with sta tus: 404","grpc_status":12,"value":"404"}"

The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/sandeeyadav/datacatalog-tag-manager/env/bin/datacatalog-tags", line 8, in sys.exit(main()) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_manager_cli.py", line 55, in main TagManagerCLI.run(argv[1:] if len(argv) > 0 else argv) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_manager_cli.py", line 15, in run args.func(args) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_manager_cli.py", line 45, in upsert_tags file_path=args.csv_file) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_datasource_processor.py", line 35, in upsert_tags_from_csv dataframe, processor=self.datacatalog_facade.upsert_tag) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_datasource_processor.py", line 73, in process_tags_from_dataframe catalog_entry = self.find_entry(entry_name_or_resource) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/tag_datasource_processor.py", line 111, in __find_entry return self.datacatalog_facade.get_entry(name_or_resource) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/datacatalog_tag_manager/datacatalog_facade.py", line 35, in get_entry entry = self.datacatalog.get_entry(name=name) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/cloud/datacatalog_v1beta1/services/data_catalog/client.py", line 1357, in get_entry response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 145, in call return wrapped_func(*args, **kwargs) File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func on_error=on_error, File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target return target() File "/home/sandeeyadav/datacatalog-tag-manager/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 75, in error_remapped_callable six.raise_from(exceptions.from_grpc_error(exc), exc) File "", line 3, in raise_from google.api_core.exceptions.MethodNotImplemented: 501 Received http2 header with status: 404 (env) sandeeyadav@cloudshell:~/datacatalog-tag-manager (dcsea-ac-one-sandbox)$

github-actions[bot] commented 3 years ago

Thanks for taking the time to open an issue. We will have a look and answer as soon as we can.

ricardolsmendes commented 3 years ago

Thanks @sandeep2sky and @mesmacosta. The execution failed at the GET ENTRY call, according to this log. I think @mesmacosta has the same understanding based on this comment.

@sandeep2sky, could you please confirm the service account you're using to run the script has appropriate access to //bigquery.googlapis.com/projects/one-global-dde-dev/datasets/OPUS/tables/DWL_DOM_AR?

sandeep2sky commented 3 years ago

Thanks @mesmacosta @ricardolsmendes. The issue got resolved. It was due to csv file. I was using csv file that I have saved from an Excel file in the predefined format. I tried to use the CSV from the GitHub provided in the package itself and it resolved the issue. Layout and content was same but it works with csv from repo. Thanks for your support and comment.

ricardolsmendes commented 3 years ago

Thanks for letting us know, @sandeep2sky!