Bug #1080

acctd error when monitoring pending machines

Added by Daniel Molina 4 months ago. Updated 4 months ago.

Status:Closed Start date:01/23/2012
Priority:Normal Due date:
Assignee:Daniel Molina % Done:

0%

Category:-
Target version:Release 3.2.1
Resolution:fixed Affected Version:OpenNebula 3.2
Story points-
Velocity based estimate-

Description

Sun Jan 22 13:40:57 +0200 2012 OneWatch::Accounting
/usr/lib/one/ruby/acct/accounting.rb:98:in `update_history': undefined
method `[]' for nil:NilClass (NoMethodError)
from /usr/lib/one/ruby/acct/accounting.rb:126:in `insert_vm'
from /usr/lib/one/ruby/acct/accounting.rb:68:in `insert'

When updating history pending machines must be ignore:

            if hr = vm['HISTORY_RECORDS']
                unless hr['HISTORY'].instance_of?(Array)
                    if hr['HISTORY']['SEQ'] == seq
                        # The VM has not moved from the Host
                        insert_register(vm_sql, last_register, hr['HISTORY'])
                        return

Thanks Rolandas Naujikas for your feedback

Associated revisions

Revision 2173fae0
Added by Daniel Molina 4 months ago

bug #1080: acctd error when monitoring VMs with no history

Revision 820af055
Added by Daniel Molina 4 months ago

bug #1080: acctd error when monitoring VMs with no history(cherry picked from commit 2173fae04847cfb5424583cd5dca6acb74d3bab9)

History

Updated by Daniel Molina 4 months ago

  • Description updated (diff)

Updated by Rolandas Naujikas 4 months ago

That is probably only one of the cause. Our system usually is steady most of the time (no PENDING VM's), but oneacctd still crashes.

Updated by Ruben S. Montero 4 months ago

  • Target version changed from Release 3.2 to Release 3.4 - S0

Updated by Daniel Molina 4 months ago

I have uploaded a patch that fixes this bug, or at least the one I reproduced. The error triggers when the acct daemon tries to update a VM in DONE state with no history records, for example if you start a VM and then delete it in the same accounting step.

Updated by olivier sallou 4 months ago

I have taken the patch to test it, it is currently running, I will let you know if it is still up tomorrow

Updated by olivier sallou 4 months ago

Hi,
I have tested the patch after several hours running, creating/deleting VM with no activity... and acctd is still up. Patch looks ok.

Updated by Carlos Martín 4 months ago

  • Status changed from New to Closed
  • Target version changed from Release 3.4 - S0 to Release 3.2.1
  • Resolution set to fixed
  • Affected Version changed from OpenNebula 2.2 to OpenNebula 3.2

Also available in: Atom PDF