Results 1 to 8 of 8

Thread: [RESOLVED] Livestatus crash

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    9

    [RESOLVED] Livestatus crash

    I am trying to integrate RackTables with Shinken and I found out that:
    echo -e "GET hosts\nColumns: name state\nFilter: localhost\n\n" | netcat localhost 50000

    livestatus module crashes:
    [1327400378] [broker-1] ERROR : the module Livestatus just crash! Please look at the traceback:
    [1327400378] [broker-1] Traceback (most recent call last):
    File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 780, in main
    self.do_main()
    File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 1019, in do_main
    response, keepalive = self.livestatus.handle_request(open_connections[socketid]['buffer'])
    File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus.py", line 123, in handle_request
    request.parse_input(data)
    File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_request.py", line 96, in parse_input
    query.parse_input('\n'.join(query_cmds))
    File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_query.py", line 251, in parse_input
    cmd, attribute, operator, reference = self.split_option(line, 2) + ['']
    ValueError: need more than 3 values to unpack

    [1327400380] [broker-1] Error : the external module Livestatus goes down unexpectly!

  2. #2
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Livestatus crash

    Hi,

    There was a refactoring of the LiveStatus module in the last commits. Can you update with a git version and give it a try? thanks
    No direct support by personal message. Please open a thread so everyone can see the solution

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    9

    Re: Livestatus crash

    Hi

    After update to 1.0rc1. I have still crashes.

    The same one as previously:
    Code:
    echo -e "GET hosts\nColumns: name state\nFilter: localhost\n\n" | socat - TCP4:localhost:50000
    
    [1329308479] [broker-1] ERROR : the module Livestatus just crash! Please look at the traceback:
    [1329308479] [broker-1] Traceback (most recent call last):
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 165, in main
      self.do_main()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 222, in do_main
      self.manage_lql_thread()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 579, in manage_lql_thread
      response, keepalive = self.livestatus.handle_request(open_connections[socketid]['buffer'])
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus.py", line 50, in handle_request
      request.parse_input(data)
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_request.py", line 89, in parse_input
      query.parse_input('\n'.join(query_cmds))
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_query.py", line 146, in parse_input
      _, attribute, operator, reference = self.split_option(line, 2) + ['']
    ValueError: need more than 3 values to unpack
    
    [1329308481] [broker-1] Error : the external module Livestatus goes down unexpectly!
    [1329308481] [broker-1] Info : Setting the module Livestatus to restart
    [1329308481] [broker-1] Trying to init module : Livestatus
    [1329308481] [broker-1] I'm stopping module 'Livestatus' process pid:1204
    [1329308481] [broker-1] Starting external process for instance Livestatus
    [1329308481] [broker-1] Livestatus is now started ; pid=1233
    One more:
    Code:
    echo -e "GET services\nStats: state = 0\nStats: state = 1\nStats: state = 2\nStats: state = 3\nFilter: host_name \n" | socat - TCP4:localhost:50000
    
    [1329308295] [broker-1] ERROR : the module Livestatus just crash! Please look at the traceback:
    [1329308295] [broker-1] Traceback (most recent call last):
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 165, in main
      self.do_main()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 222, in do_main
      self.manage_lql_thread()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 579, in manage_lql_thread
      response, keepalive = self.livestatus.handle_request(open_connections[socketid]['buffer'])
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus.py", line 50, in handle_request
      request.parse_input(data)
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_request.py", line 89, in parse_input
      query.parse_input('\n'.join(query_cmds))
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_query.py", line 146, in parse_input
      _, attribute, operator, reference = self.split_option(line, 2) + ['']
    ValueError: need more than 3 values to unpack
    
    [1329308297] [broker-1] Error : the external module Livestatus goes down unexpectly!
    [1329308297] [broker-1] Info : Setting the module Livestatus to restart
    [1329308297] [broker-1] Trying to init module : Livestatus
    [1329308297] [broker-1] I'm stopping module 'Livestatus' process pid:1148
    [1329308297] [broker-1] Starting external process for instance Livestatus
    [1329308297] [broker-1] Livestatus is now started ; pid=1168

    But I also noticed that livestatus is crashing "randomly". So far I wasn't able to find what triggers this crash. The log:
    Code:
     [1329308903] [broker-1] ERROR : the module Livestatus just crash! Please look at the traceback:
    [1329308903] [broker-1] Traceback (most recent call last):
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 165, in main
      self.do_main()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 222, in do_main
      self.manage_lql_thread()
     File "/usr/local/lib/python2.6/dist-packages/shinken/modules/livestatus_broker/livestatus_broker.py", line 383, in manage_lql_thread
      self.rg.manage_brok(b)
     File "/usr/local/lib/python2.6/dist-packages/shinken/misc/regenerator.py", line 78, in manage_brok
      return manage(brok)
     File "/usr/local/lib/python2.6/dist-packages/shinken/misc/regenerator.py", line 853, in manage_update_program_status_brok
      msg = Message(id=0, type='NeedData', data={'full_instance_id' : c_id})
    NameError: global name 'Message' is not defined
    
    [1329308904] [broker-1] Error : the external module Livestatus goes down unexpectly!
    [1329308904] [broker-1] Info : Setting the module Livestatus to restart
    [1329308904] [broker-1] Trying to init module : Livestatus
    [1329308904] [broker-1] I'm stopping module 'Livestatus' process pid:2120
    [1329308904] [broker-1] Starting external process for instance Livestatus
    [1329308904] [broker-1] Livestatus is now started ; pid=2147

  4. #4

    Re: Livestatus crash

    Stats: state = 3\nFilter: host_name \n"
    or
    "GET hosts\nColumns: name state\nFilter: localhost\n\n"
    are no valid LQL queries. That's what the parser crashes. Github is down in the moment, i will push an update tomorrow which makes the module more robust.

  5. #5

    Re: Livestatus crash

    I just committed a fix for this one: "NameError: global name 'Message' is not defined"
    And this one "ValueError: need more than 3 values to unpack" is also handled in a more robust manner. Queries which can be correctly parsed don't crash the broker, they simply return an empty response now.

    Gerhard

  6. #6
    Junior Member
    Join Date
    Jan 2012
    Posts
    9

    Re: Livestatus crash

    I have tested it (version from git from today) and it works - I have no more crashes.
    Thanks

  7. #7
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: Livestatus crash

    Great ;D

    I close the thread
    No direct support by personal message. Please open a thread so everyone can see the solution

  8. #8
    There are many super stars in the field of the writing. I like to have the new calculation of the best resume writing services 2019 in the work of excavation. These stars of writing are making their future in the writing and this give them value in front of others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •