cisco-ie / tdm

Telemetry Data Mapper to ease data discovery, correlation, and usage with YANG, MIBs, etc.
Apache License 2.0
37 stars 5 forks source link

Search and all mappings options not working: error 500 #69

Open britonb opened 4 years ago

britonb commented 4 years ago

Hi

Please find logs bellow. Is this problem known?

Kind Regards Nuno

::ffff:172.19.0.3 - - [2020-02-19 21:12:08] "POST /collection-counts HTTP/1.0" 500 445 0.001687 ERROR:web:Exception on /search_es [GET] Traceback (most recent call last): File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/data/web/views.py", line 505, in search_es search_form = construct_search_form(es=True) File "/data/web/views.py", line 815, in construct_search_form search_form.oses.choices = [(pair, pair) for pair in fetch_os_releases()] File "/data/web/views.py", line 829, in fetch_os_releases return query_db(os_releases_query) File "/data/web/views.py", line 1224, in query_db client = ArangoClient(protocol='http', host='dbms') TypeError: init() got an unexpected keyword argument 'protocol'

::ffff:172.19.0.3 - - [2020-02-19 21:12:18] "GET /search_es HTTP/1.0" 500 459 0.002182 ::ffff:172.19.0.3 - - [2020-02-19 21:12:26] "GET /matchmaker HTTP/1.0" 200 15699 0.012075 ::ffff:172.19.0.3 - - [2020-02-19 21:12:26] "GET /static/cui-1.2.2-official/fonts/CiscoSans/CiscoSansTTLightOblique.woff2 HTTP/1.0" 304 202 0.001336 ::ffff:172.19.0.3 - - [2020-02-19 21:12:28] "GET /datapath/direct HTTP/1.0" 200 8412 0.001894 ERROR:web:Exception on /datapath/matches [GET] Traceback (most recent call last): File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/data/web/views.py", line 36, in datapath_matches dml_matches=fetch_all_matches() File "/data/web/views.py", line 55, in fetch_all_matches return query_db(all_matches_query) File "/data/web/views.py", line 1224, in query_db client = ArangoClient(protocol='http', host='dbms') TypeError: init() got an unexpected keyword argument 'protocol'

crisponions commented 4 years ago

It seems a lot of upstream libraries have been changed since this was last updated. I had to add several packages to the pip file to get it to install.

I believe this error is related to a major change to version 5+ of the Arango client.

from arango import ArangoClient.

OLD

client = ArangoClient(protocol='http', host='localhost', port=8529)

NEW (single host)

client = ArangoClient(hosts='http://localhost:8529')