Bug #1080

acctd error when monitoring pending machines

Added by Daniel Molina about 8 years ago. Updated about 8 years ago.

Status:ClosedStart date:01/23/2012
Priority:NormalDue date:
Assignee:Daniel Molina% Done:

0%

Category:-
Target version:Release 3.2.1
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.2

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 about 8 years ago

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

Revision 820af055
Added by Daniel Molina about 8 years ago

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

History

#1 Updated by Daniel Molina about 8 years ago

  • Description updated (diff)

#2 Updated by Rolandas Naujikas about 8 years 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.

#3 Updated by Ruben S. Montero about 8 years ago

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

#4 Updated by Daniel Molina about 8 years 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.

#5 Updated by olivier sallou about 8 years ago

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

#6 Updated by olivier sallou about 8 years 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.

#7 Updated by Carlos Martín about 8 years 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 Versions OpenNebula 3.2 added

Also available in: Atom PDF