Re: Review Request 45665: AMBARI-15680 : METRICS_GRAFANA START failed with 401 Unauthorized Error

2016-04-03 Thread Sumit Mohanty

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45665/#review126789
---




ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 (line 121)


Is 401 the only code to retry for? Perhaps OK now but in future it may be 
more. Should we go for 
if response.status in [401] - so that all we need is to add more code to 
the array



ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 (line 124)


Nit: We should log the error or the return code. Today its just 401 but in 
future it may be some other code.


- Sumit Mohanty


On April 4, 2016, 4:41 a.m., Aravindan Vijayan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45665/
> ---
> 
> (Updated April 4, 2016, 4:41 a.m.)
> 
> 
> Review request for Ambari, Dmytro Sen, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-15680
> https://issues.apache.org/jira/browse/AMBARI-15680
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> METRICS_GRAFANA fails to start after deploying cluster with custom pid 
> directories/
> {code}
> {
>   "href" : "<>",
>   "Tasks" : {
> "attempt_cnt" : 1,
> "cluster_name" : "cl1",
> "command" : "START",
> "command_detail" : "METRICS_GRAFANA START",
> "end_time" : 1459221778314,
> "error_log" : "/var/lib/ambari-agent/data/errors-155.txt",
> "exit_code" : 1,
> "host_name" : "os-d7-ptluou-ambari-se-config-3-3.novalocal",
> "id" : 155,
> "output_log" : "/var/lib/ambari-agent/data/output-155.txt",
> "request_id" : 4,
> "role" : "METRICS_GRAFANA",
> "stage_id" : 4,
> "start_time" : 1459221664137,
> "status" : "FAILED",
> "stderr" : "Traceback (most recent call last):\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
>  line 64, in \nAmsGrafana().execute()\n  File 
> \"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\",
>  line 219, in execute\nmethod(env)\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
>  line 46, in start\ncreate_ams_datasource()\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py\",
>  line 224, in create_ams_datasource\n(response.status, response.reason, 
> data))\nresource_management.core.exceptions.Fail: Ambari Metrics Grafana data 
> source creation failed. POST request status: 401 Unauthorized 
> \n{\"message\":\"Invalid username or password\"}",
> {code}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
>  012bdcb 
> 
> Diff: https://reviews.apache.org/r/45665/diff/
> 
> 
> Testing
> ---
> 
> Manual testing done
> Python unit tests pass.
> 
> 
> Thanks,
> 
> Aravindan Vijayan
> 
>



Re: Review Request 45665: AMBARI-15680 : METRICS_GRAFANA START failed with 401 Unauthorized Error

2016-04-03 Thread Sumit Mohanty

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45665/#review126790
---


Ship it!




Minor changes suggested. Fix if you think they are reasonable and then ship.

- Sumit Mohanty


On April 4, 2016, 4:41 a.m., Aravindan Vijayan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45665/
> ---
> 
> (Updated April 4, 2016, 4:41 a.m.)
> 
> 
> Review request for Ambari, Dmytro Sen, Sumit Mohanty, and Sid Wagle.
> 
> 
> Bugs: AMBARI-15680
> https://issues.apache.org/jira/browse/AMBARI-15680
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> METRICS_GRAFANA fails to start after deploying cluster with custom pid 
> directories/
> {code}
> {
>   "href" : "<>",
>   "Tasks" : {
> "attempt_cnt" : 1,
> "cluster_name" : "cl1",
> "command" : "START",
> "command_detail" : "METRICS_GRAFANA START",
> "end_time" : 1459221778314,
> "error_log" : "/var/lib/ambari-agent/data/errors-155.txt",
> "exit_code" : 1,
> "host_name" : "os-d7-ptluou-ambari-se-config-3-3.novalocal",
> "id" : 155,
> "output_log" : "/var/lib/ambari-agent/data/output-155.txt",
> "request_id" : 4,
> "role" : "METRICS_GRAFANA",
> "stage_id" : 4,
> "start_time" : 1459221664137,
> "status" : "FAILED",
> "stderr" : "Traceback (most recent call last):\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
>  line 64, in \nAmsGrafana().execute()\n  File 
> \"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\",
>  line 219, in execute\nmethod(env)\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
>  line 46, in start\ncreate_ams_datasource()\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py\",
>  line 224, in create_ams_datasource\n(response.status, response.reason, 
> data))\nresource_management.core.exceptions.Fail: Ambari Metrics Grafana data 
> source creation failed. POST request status: 401 Unauthorized 
> \n{\"message\":\"Invalid username or password\"}",
> {code}
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
>  012bdcb 
> 
> Diff: https://reviews.apache.org/r/45665/diff/
> 
> 
> Testing
> ---
> 
> Manual testing done
> Python unit tests pass.
> 
> 
> Thanks,
> 
> Aravindan Vijayan
> 
>



Review Request 45665: AMBARI-15680 : METRICS_GRAFANA START failed with 401 Unauthorized Error

2016-04-03 Thread Aravindan Vijayan

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45665/
---

Review request for Ambari, Dmytro Sen, Sumit Mohanty, and Sid Wagle.


Bugs: AMBARI-15680
https://issues.apache.org/jira/browse/AMBARI-15680


Repository: ambari


Description
---

METRICS_GRAFANA fails to start after deploying cluster with custom pid 
directories/
{code}
{
  "href" : "<>",
  "Tasks" : {
"attempt_cnt" : 1,
"cluster_name" : "cl1",
"command" : "START",
"command_detail" : "METRICS_GRAFANA START",
"end_time" : 1459221778314,
"error_log" : "/var/lib/ambari-agent/data/errors-155.txt",
"exit_code" : 1,
"host_name" : "os-d7-ptluou-ambari-se-config-3-3.novalocal",
"id" : 155,
"output_log" : "/var/lib/ambari-agent/data/output-155.txt",
"request_id" : 4,
"role" : "METRICS_GRAFANA",
"stage_id" : 4,
"start_time" : 1459221664137,
"status" : "FAILED",
"stderr" : "Traceback (most recent call last):\n  File 
\"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
 line 64, in \nAmsGrafana().execute()\n  File 
\"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\",
 line 219, in execute\nmethod(env)\n  File 
\"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
 line 46, in start\ncreate_ams_datasource()\n  File 
\"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py\",
 line 224, in create_ams_datasource\n(response.status, response.reason, 
data))\nresource_management.core.exceptions.Fail: Ambari Metrics Grafana data 
source creation failed. POST request status: 401 Unauthorized 
\n{\"message\":\"Invalid username or password\"}",
{code}


Diffs
-

  
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 012bdcb 

Diff: https://reviews.apache.org/r/45665/diff/


Testing
---

Manual testing done
Python unit tests pass.


Thanks,

Aravindan Vijayan