You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Andrew Onischuk (JIRA)" <ji...@apache.org> on 2013/10/01 17:45:34 UTC

[jira] [Updated] (AMBARI-3306) Empty ambari server .pid causes Traceback

     [ https://issues.apache.org/jira/browse/AMBARI-3306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Onischuk updated AMBARI-3306:
------------------------------------

    Attachment: AMBARI-3306_1.4.1.patch

> Empty ambari server .pid causes Traceback
> -----------------------------------------
>
>                 Key: AMBARI-3306
>                 URL: https://issues.apache.org/jira/browse/AMBARI-3306
>             Project: Ambari
>          Issue Type: Bug
>    Affects Versions: 1.4.1
>            Reporter: Jeff Sposetti
>            Assignee: Andrew Onischuk
>         Attachments: AMBARI-3306_1.4.1.patch, AMBARI-3306.patch
>
>
> Went thru and make some ambari-server changes -- don't have steps to repro -- but it resulted in the ambari-server.pid file to empty (file exists but 0 size).
> ambari-server start or status command caused a traceback but this did not provide enough into to fix. We deleted /var/run/ambari-server/ambari-server.pid and things were OK.
> {code}
> ec2-user@ip-10-111-19-223 ambari-server]$ ambari-server status
> Using python  /usr/bin/python2.6
> Ambari-server status
> Traceback (most recent call last):
>   File "/usr/sbin/ambari-server.py", line 3988, in <module>
>     main() 
>   File "/usr/sbin/ambari-server.py", line 3813, in main
>     status(options)
>   File "/usr/sbin/ambari-server.py", line 2471, in status
>     status, pid = is_server_runing()
>   File "/usr/sbin/ambari-server.py", line 3221, in is_server_runing
>     pid = int(f.readline())
> ValueError: invalid literal for int() with base 10: ''
> {code}
> Regardless of how we got to an empty .pid file, ambari-server should handle an empty .pid file and print a more appropriate message (and not a traceback). At least that would give the user something to go look at.
> {code}
> ERROR: unable to read /var/run/ambari-server/ambari-server.pid
> {code}
> Additionally, if we find the file is 0 size, we should print this error and just delete the file automatically (well, tell them we are removing first).
> {code}
> ERROR: /var/run/ambari-server/ambari-server.pid is empty. Removing.
> ERROR: unable to read /var/run/ambari-server/ambari-server.pid
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)