Bug #986

oneacctd automatically stop

Added by kawe demo over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:11/17/2011
Priority:HighDue date:
Assignee:Daniel Molina% Done:

100%

Category:CLI
Target version:Release 3.2
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.0

Description

oneacctd stop

I am trying to use MySQL with Opennebula Watch, but I have problems to connect to the database.
I created a database oneacct in my MySQL server (the documentation says neither whether the database has to be created nor if a specific name has to be used) and have given all privileges on that database to the oneadmin user. I edited the /etc/one/acctd.conf file and added a line like:

:DB: mysql://root:abc123@localhost/opennebula

my system also have 2 vm running.below i logfile error after oneacctd crash:-

Thu Nov 17 10:04:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:04:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:05:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:05:07 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:05:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:06:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:06:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:06:37 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:07:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:07:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:08:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:08:07 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:08:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:08:37 +0800 2011 OneWatch::Accounting
Thu Nov 17 10:09:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:09:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:09:37 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:10:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:10:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:11:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:11:07 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:11:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:12:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:12:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:12:37 +0800 2011 OneWatch::HostMonitoring
Thu Nov 17 10:13:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:13:37 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:13:37 +0800 2011 OneWatch::Accounting
Thu Nov 17 10:14:07 +0800 2011 OneWatch::VmMonitoring
Thu Nov 17 10:14:07 +0800 2011 OneWatch::HostMonitoring
/var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/mysql.rb:175:in `query': Mysql::Error: Duplicate entry '4-0' for key 'PRIMARY' (Sequel::DatabaseError)
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/mysql.rb:175:in `_execute'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/logging.rb:28:in `log_yield'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/mysql.rb:175:in `_execute'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:23:in `execute'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/connection_pool/threaded.rb:71:in `hold'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/connecting.rb:226:in `synchronize'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:23:in `execute'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/query.rb:71:in `execute_dui'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/dataset/actions.rb:639:in `execute_dui'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/mysql.rb:333:in `execute_dui'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/adapters/mysql.rb:321:in `update'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/model/associations.rb:1197:in `_remove_all_samples'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/model/associations.rb:1383:in `send'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/model/associations.rb:1383:in `remove_all_associated_objects'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/model/associations.rb:1212:in `remove_all_samples'
from /srv/cloud/one/lib/ruby/acct/watch_helper.rb:279:in `fix_size'
from /srv/cloud/one/lib/ruby/acct/watch_helper.rb:449:in `flush'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/query.rb:231:in `_transaction'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/query.rb:210:in `transaction'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/connecting.rb:226:in `synchronize'
from /var/lib/gems/1.8/gems/sequel-3.28.0/lib/sequel/database/query.rb:208:in `transaction'
from /srv/cloud/one/lib/ruby/acct/watch_helper.rb:446:in `flush'
from /srv/cloud/one/lib/ruby/acct/monitoring.rb:31:in `insert'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:77:in `update'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:59:in `each'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:59:in `update'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:57:in `each'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:57:in `update'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:129
from /srv/cloud/one/lib/ruby/acct/acctd.rb:124:in `loop'
from /srv/cloud/one/lib/ruby/acct/acctd.rb:124

I would appreciate if someone could tell me what I am doing wrong. Thanks.

Cheers,
kawe


Related issues

Related to Bug #957: oneacctd crashes when using MySQL-db Closed 11/01/2011

History

#1 Updated by Ruben S. Montero over 9 years ago

  • Target version set to Release 3.2 - Beta1

#2 Updated by Ruben S. Montero over 9 years ago

  • Assignee changed from Carlos de Alfonso Laguna to Daniel Molina

#3 Updated by Ruben S. Montero over 9 years ago

  • Target version changed from Release 3.2 - Beta1 to Release 3.2

#4 Updated by Ruben S. Montero over 9 years ago

  • Status changed from New to Assigned

#5 Updated by Daniel Molina over 9 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Resolution set to fixed

OK, I found out the problem. This patch should fix the problem.

http://dev.opennebula.org/projects/opennebula/repository/revisions/6176e07bac684135cbfe1cd46f9213cc8b41a371/diff/src/acct/watch_helper.rb

This patch is already included in 3.2-beta1 packages.

Also available in: Atom PDF