reporter
reporter copied to clipboard
Status 401 Unauthorized: "Invalid API key"
Good Day @IzakMarais,
I have done the setup as you mentioned and it was working earlier for a few days but somehow it stopped to work. Tried a lot to find the root cause but failed. Kindly suggest what needs to do here. I am running reporter service using the below command and kept the server certificate to the location(/etc/pki/tls/certs/). Still, I am getting a 401 error, not sure where I missed the configuration.
Command: ./grafana-reporter -ip "my-server:3000" -port ":8686" -proto "https://" -grid-layout=1
Link configured as below: http://my-server:8686/api/v5/report/9CWBz0bik?apitoken=eyJrIjoiandja3A5UWNUclBvM2FJSkVmbDcyc3lmOVdBRlk2cGwiLCJuIjoicmVwb3J0IiwiaWQiOjF9
Error: error fetching dashboard 9CWBz0bik: error obtaining dashboard from https://my-server:3000/api/dashboards/uid/9CWBz0bik?var-env=All&var-interval=5s&var-maxmount=%2F&var-name=All&var-node=All. Got Status 401 Unauthorized, message: {"message":"Invalid API key"}
As I am doing this for the first time, please suggest if I have to take care of any other configuration too.
Log: 2020/08/11 06:05:53 Called with api Token: eyJrIjoiandja3A5UWNUclBvM2FJSkVmbDcyc3lmOVdBRlk2cGwiLCJuIjoicmVwb3J0IiwiaWQiOjF9 2020/08/11 06:05:53 Called with variable: var-node [All] 2020/08/11 06:05:53 Called with variable: var-maxmount [/] 2020/08/11 06:05:53 Called with variable: var-interval [5s] 2020/08/11 06:05:53 Called with variable: var-env [All] 2020/08/11 06:05:53 Called with variable: var-name [All] 2020/08/11 06:05:53 Called with dashboard: 9CWBz0bik 2020/08/11 06:05:53 Called with time range: {now-5m now} 2020/08/11 06:05:53 Connecting to dashboard at https://my-server:3000/api/dashboards/uid/9CWBz0bik?var-env=All&var-interval=5s&var-maxmount=%2F&var-name=All&var-node=All 2020/08/11 06:05:53 Error generating report: error fetching dashboard 9CWBz0bik: error obtaining dashboard from https://my-server:3000/api/dashboards/uid/9CWBz0bik?var-env=All&var-interval=5s&var-maxmount=%2F&var-name=All&var-node=All. Got Status 401 Unauthorized, message: {"message":"Invalid API key"}
@IzakMarais , could you please help me to fix this issue. I am still unable to find any solution to this.
Are you sure you have the entire API key? There may be an '==' at the end.
@onefourfive, yes this "==" was there in older API. I have recreated the API to validate, but there is no sign as you mentioned.
@IzakMarais or Team, if you could help me with this to fix would help a lot.