Bug #4028

puppetstoredconfigclean not working with sqlite3

Added by Gonçalo Queirós almost 2 years ago. Updated almost 2 years ago.

Status:Rejected Start date:06/17/2010
Priority:Normal Due date:
Assignee:Brice Figureau % Done:

0%

Category:-
Target version:-
Affected Puppet version:0.25.5 Branch:
Keywords:
Votes: 0

Description

Hi there. I’ve tried to use the puppet/ext/puppetstoredconfigclean.rb file to clean some exported resources but i got the following error:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure': Could not find table ‘hosts’ (ActiveRecord::StatementInvalid)

I don’t understand much of ruby, but looking at the script provided on http://projects.puppetlabs.com/issues/1886, i noted that the line “args[:database] = "puppet” unless not args[:database].to_s.empty?“ is the main big difference.

If i comment this line on the puppetstoredconfigclean.rb file the scripts executes fine. Thanks

History

Updated by James Turnbull almost 2 years ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Brice Figureau

That script was yours Brice neh?

Updated by Brice Figureau almost 2 years ago

I’m not the original author of this script, but the error looks familiar. I remember it boils down to an incompatibility between some rails version and sqlite: See #2815 for more details (especially Markus comment).

Updated by Gonçalo Queirós almost 2 years ago

Can’t test it now, will be back on tuesday and report back.Thanks

Updated by Gonçalo Queirós almost 2 years ago

Tried to apply the changes to my sqlite3_adapter.rb but got the same error all the time..

Updated by Brian Pitts almost 2 years ago

I am also experiencing this issue on RHEL4

with the rpms ruby-1.8.5-5.8 puppet 0.24.8-4 sqlite-3.3.6-0.3

and the gems activerecord (2.2.2) sqlite3-ruby (1.2.4).

The exact error is

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure': Could not find table ‘hosts’ (ActiveRecord::StatementInvalid)

I tried upgrading to activerecord (2.3.8) but now have a different error.

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in method_missing': undefined methodestablish_connection' for ActiveRecord::Base:Class (NoMethodError)

from /usr/share/puppet/ext/puppetstoredconfigclean.rb:75

I would try upgrading sqlite3-ruby, but I cannot because 1.2.4 is the latest version that works with ruby 1.8.5.

Updated by James Turnbull almost 2 years ago

  • Status changed from Investigating to Rejected

This is #2815 and not a Puppet issue.

https://rails.lighthouseapp.com/projects/8994/tickets/99-sqlite-connection-failing

Also available in: Atom PDF