Database initialization of Sequel Model fails on first run.

Bug #581980 reported by Chris Tusa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Telegard
Fix Released
High
Chris Tusa

Bug Description

When attempting to start the tg.rb program for the first time, the Telegard.init method fails when loading the Users model. Additionally, on a subsequent run, the "SYSOP" user is created with id 2 instead of id 1, and id 1 does not exist in the users table. The console output is:

Initializing Database Models................................[WAIT]
 DB Model: groups...........................................[DONE]
 DB Model: users............................................/opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/model/base.rb:877:in `_refresh': Record not found (Sequel::Error)
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/model/associations.rb:1022:in `_refresh'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/model/base.rb:898:in `_save'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/model/base.rb:745:in `save'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/model/base.rb:950:in `checked_transaction'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/database.rb:647:in `_transaction'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/database.rb:593:in `transaction'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'
 from /opt/devel/java/jruby-1.5.0/lib/ruby/gems/1.8/gems/sequel-3.11.0/lib/sequel/database.rb:553:in `synchronize'
  ... 12 levels...
 from ./lib/telegard.rb:127:in `loadlib_tgdatabasemodels'
 from ./lib/telegard.rb:172:in `init'
 from ./tg.rb:164

Chris Tusa (chris-tusa)
Changed in telegard:
assignee: nobody → Chris Tusa (chris-tusa)
importance: Undecided → High
Revision history for this message
Chris Tusa (chris-tusa) wrote :

This error was resolved by upgrading to Sequel gem 3.12.0 or later. This new version implements Sequel::Plugins::SkipCreateRefresh. This plugin is no loaded directly after the gem requirement & schema plugin and before the Model loading.

Changed in telegard:
status: New → Fix Committed
Chris Tusa (chris-tusa)
Changed in telegard:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.