hastic-zzz / hastic-grafana-app

Hastic data management server for labeling patterns and anomalies in Grafana
https://hastic.io
GNU General Public License v3.0
179 stars 18 forks source link

Hastic api_key error on creating new analytic unit #422

Closed anagha-sait closed 4 years ago

anagha-sait commented 4 years ago

I have created a new api_key and added it to hastic.But after adding an analytic unit and labelling the data,on clicking the apply button it gives an error "Error: Unauthorized. Check the API_KEY. Request failed with status code 401" Hastic error log content:

**Data kit: fail while request data: Request failed with status code 401 query url: "/api/tsdb/query" Response: status: 401, response data: {"message":"Expired API key"}, headers: {"cache-control":"no-cache","content-type":"application/json; charset=UTF-8","expires":"-1","pragma":"no-cache","x-frame-options":"deny","date":"Fri, 28 Feb 2020 06:28:18 GMT","content-length":"29","connection":"close"}

Error: Unauthorized. Check the API_KEY. Request failed with status code 401 at /root/hastic-server-0.3.6-beta/server/dist/server.js:9:92709 at Generator.next () at a (/root/hastic-server-0.3.6-beta/server/dist/server.js:9:87748) at **

Screenshot from 2020-02-28 15-42-38

rozetko commented 4 years ago

Hey @saitiot

Looks like the API key you use has expired. Please go to Configuration -> API Keys in Grafana and check if the key you use still exists. If it doesn't - create and use a new one.

anagha-sait commented 4 years ago

Hey @saitiot

Looks like the API key you use has expired. Please go to Configuration -> API Keys in Grafana and check if the key you use still exists. If it doesn't - create and use a new one.

When I first checked API key wasn't present. Then I created a new one and even after using it the error still persists.

rozetko commented 4 years ago

@saitot Did you restart hastic-server after changing the API key?

anagha-sait commented 4 years ago

@rozetko Thanks a lot.This hint did help me to solve the issue.