> 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
> > <https://reviews.apache.org/r/45665/diff/1/?file=1323758#file1323758line121>
> >
> >     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
> > <https://reviews.apache.org/r/45665/diff/1/?file=1323758#file1323758line124>
> >
> >     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 <module>\n    AmsGrafana().execute()\n  File 
> \"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py\",
>  line 219, in execute\n    method(env)\n  File 
> \"/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py\",
>  line 46, in start\n    create_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
> 
>

Reply via email to