cloudera / hue

Open source SQL Query Assistant service for Databases/Warehouses
https://cloudera.com
Apache License 2.0
1.17k stars 366 forks source link

Hue catalog search entities with Navigator error #2526

Closed akizminet closed 3 years ago

akizminet commented 3 years ago

When I was loading list of tables from beeswax server, Hue was failed to POST /desktop/api/search/entities and returned error.

[06/Sep/2021 10:55:36 +0700] catalog_api  ERROR    'tuple' object has no attribute 'items'
[06/Sep/2021 10:55:36 +0700] navigator_client INFO     (('query', 'parentPath:"/<database name>" AND type:(table view field)'), ('offset', 0), ('limit', 450))
Traceback (most recent call last):
  File "/usr/share/hue/desktop/libs/metadata/src/metadata/catalog_api.py", line 60, in decorator
    return view_fn(*args, **kwargs)
  File "/usr/share/hue/desktop/libs/metadata/src/metadata/catalog_api.py", line 153, in search_entities
    entities = api.search_entities(query_s, limit=limit, offset=offset, raw_query=raw_query, sources=sources)
  File "/usr/share/hue/desktop/libs/metadata/src/metadata/catalog/navigator_client.py", line 358, in search_entities
    response = self._root.get('entities', headers=self.__headers, params=params)
  File "/usr/share/hue/desktop/core/src/desktop/lib/rest/resource.py", line 157, in get
    return self.invoke("GET", relpath, params, headers=headers, allow_redirects=True, clear_cookies=clear_cookies)
  File "/usr/share/hue/desktop/core/src/desktop/lib/rest/resource.py", line 87, in invoke
    log_response=log_response
  File "/usr/share/hue/desktop/core/src/desktop/lib/rest/resource.py", line 114, in _invoke
    clear_cookies=clear_cookies
  File "/usr/share/hue/desktop/core/src/desktop/lib/rest/http_client.py", line 203, in execute
    url = self._make_url(path, params, do_urlencode=urlencode)
  File "/usr/share/hue/desktop/core/src/desktop/lib/rest/http_client.py", line 251, in _make_url
    param_str = urlencode(params) if do_urlencode else '&'.join(['%s=%s' % (k, v) for k, v in params.items()])
AttributeError: 'tuple' object has no attribute 'items'

I am using thrift_version 7 Hue version: 20210827-140101

romainr commented 3 years ago

Hum, there is a chance that the params are already tuples, so might need to be converted to a dict:

  File "/usr/share/hue/desktop/libs/metadata/src/metadata/catalog/navigator_client.py", line 358, in search_entities
    response = self._root.get('entities', headers=self.__headers, params=params)
github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity and is not "roadmap" labeled or part of any milestone. Remove stale label or comment or this will be closed in 5 days.