You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Jeff Sposetti (JIRA)" <ji...@apache.org> on 2013/09/23 16:34:04 UTC

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

Jeff Sposetti created AMBARI-3306:
-------------------------------------

             Summary: 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


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. The customer didn't know how 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, should we 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira