Database initialization of Sequel Model fails on first run.

Bug #581980 reported by Chris Tusa on 2010-05-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Telegard
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) on 2010-05-17
Changed in telegard:
assignee: nobody → Chris Tusa (chris-tusa)
importance: Undecided → High
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) on 2010-06-03
Changed in telegard:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers