Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If index isn't found for meta - catch exception, WARN message #57

Open
jtaleric opened this issue Feb 11, 2022 · 0 comments
Open

If index isn't found for meta - catch exception, WARN message #57

jtaleric opened this issue Feb 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@jtaleric
Copy link
Member

Instead of dumping the exception of index not found, catch, print a warning message, and continue.

+--------------+-------------------------+--------------------------------------+------------------------------------------------+
| ['pod_name'] |        metadata         | fa458c42-2f61-52f6-b403-a7676bdfa702 |                     value                      |
+--------------+-------------------------+--------------------------------------+------------------------------------------------+
|   pod_name   | backpack-fa458c42-nmwk9 |           value.Model name           | Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
|   pod_name   | backpack-fa458c42-nmwk9 |          value.Architecture          |                     x86_64                     |
|   pod_name   | backpack-fa458c42-nmwk9 |             value.CPU(s)             |                       2                        |
|   pod_name   | backpack-fa458c42-qq2qp |           value.Model name           | Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
|   pod_name   | backpack-fa458c42-qq2qp |          value.Architecture          |                     x86_64                     |
|   pod_name   | backpack-fa458c42-qq2qp |             value.CPU(s)             |                       2                        |
+--------------+-------------------------+--------------------------------------+------------------------------------------------+
+--------------+-------------------------+--------------------------------------+------------+
| ['pod_name'] |        metadata         | fa458c42-2f61-52f6-b403-a7676bdfa702 |   value    |
+--------------+-------------------------+--------------------------------------+------------+
|   pod_name   | backpack-fa458c42-nmwk9 |            value.MemTotal            | 7934444 kB |
|   pod_name   | backpack-fa458c42-qq2qp |            value.MemTotal            | 7934444 kB |
+--------------+-------------------------+--------------------------------------+------------+
Traceback (most recent call last):
  File "/home/jtaleric/dev/benchmark-comparison/demo/bin/touchstone_compare", line 33, in <module>
    sys.exit(load_entry_point('touchstone==0.0.0', 'console_scripts', 'touchstone_compare')())
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/compare.py", line 244, in render
    main(sys.argv[1:])
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/compare.py", line 153, in main
    database_instance.get_metadata(uuid, metadata_search_map[index], index, metadata_dict)
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/databases/elasticsearch.py", line 142, in get_metadata
    response = s.execute()
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch_dsl-7.3.0-py3.10.egg/elasticsearch_dsl/search.py", line 715, in execute
    self, es.search(index=self._index, body=self.to_dict(), **self._params)
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/client/utils.py", line 168, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/client/__init__.py", line 1670, in search
    return self.transport.perform_request(
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/transport.py", line 415, in perform_request
    raise e
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/transport.py", line 381, in perform_request
    status, headers_response, data = connection.perform_request(
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/connection/http_urllib3.py", line 277, in perform_request
    self._raise_error(response.status, raw_data)
  File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/connection/base.py", line 330, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.NotFoundError: NotFoundError(404, 'index_not_found_exception', 'no such index [k8s_cluster_info-metadata]', k8s_cluster_info-metadata, index_or_alias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant