EnsureDbConsistency returns error related to Groups


(Marcin Rataj) #1

Hi,

today /logs of my instance listed an error item caused by EnsureDbConsistency job:

Job exception: Validation failed: Name has already been taken

backtrace:

/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `block in save!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `save!'
/var/www/discourse/app/models/group.rb:138:in `refresh_automatic_group!'
/var/www/discourse/app/models/group.rb:151:in `block in refresh_automatic_groups!'
/var/www/discourse/app/models/group.rb:150:in `each'
/var/www/discourse/app/models/group.rb:150:in `refresh_automatic_groups!'
/var/www/discourse/app/jobs/scheduled/ensure_db_consistency.rb:8:in `execute'
/var/www/discourse/app/jobs/base.rb:154:in `block (2 levels) in perform'

Should I be worried? How can I get rid of this error?
I use pl_PL locale and suspect this may be related to this.


(Marcin Rataj) #2

Late follow-up: this issue was probably caused by a duplicate name for one of automatic groups.
Polish translation file had label for trust level 0 twice (level 1 had the same name as 0), seems that it was causing this job’s validation fail.

I fixed pl_PL some time ago and was checking /logs/ every now and then, and after over a month I think the issue is gone for good.