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

2016-04-04 Thread Dmytro Sen

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


Ship it!




Ship It!

- Dmytro Sen


On Апрель 4, 2016, 4:41 д.п., Aravindan Vijayan wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45665/
> ---
> 
> (Updated Апрель 4, 2016, 4:41 д.п.)
> 
> 
> 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-04 Thread Aravindan Vijayan


> On April 4, 2016, 5:10 a.m., Sumit Mohanty wrote:
> > 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

We already handle "500" and other errors in the caller side. For those we do 
not want to retry. I added this as a special case where do want to retry.


> On April 4, 2016, 5:10 a.m., Sumit Mohanty wrote:
> > 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.

We log the response code in Line 120.


- Aravindan


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


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/#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
> 
>