Fresh install does not support mysql2 dbadapter

Performing a fresh install of 1.1RC1 fails on db:migrate due to an
issue in Puppet. The host this is on is CentOS 6.3, Puppet-2.6.17.
Using the mysql2 database adapter results in failed migration [1].

This issue is mentioned here, http://www.theforeman.org/issues/1350,
but does not seem to have been fixed in 1.1. Puppet does not seem to
have supported mysql2 as a database adapter till 2.7.10 2. The
offending lines in the code for 2.6.x 3 will result in MySQL
specific schema operations being skipped. This patch resolved the
issue for me:

— a/migrate/20090714132448_create_hosts.rb
+++ b/migrate/20090714132448_create_hosts.rb
@@ -4,7 +4,7 @@ class CreateHosts < ActiveRecord::Migration
# we are only creating the full database if the hosts table
doesn't exists, if it does, we assume that store config is already
configured
unless Host.table_exists?
require 'puppet/rails/database/schema'

  •  Puppet[:dbadapter]=
    

ActiveRecord::Base.configurations[RAILS_ENV]["adapter"]

  • Puppet[:dbadapter]=
    

ActiveRecord::Base.configurations[Rails.env]["adapter"].sub("mysql2",
"mysql")
Puppet::Rails::Schema.init
Puppet::Rails.migrate()
end

I am submitting a pull request right now as well as updating Redmine issue 1350.

[1]:
$ bundle exec rake db:migrate RAILS_ENV=production --trace
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10:
warning: already initialized constant ENC_NONE
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11:
warning: already initialized constant ENC_EUC
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12:
warning: already initialized constant ENC_SJIS
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13:
warning: already initialized constant ENC_UTF8
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateHosts: migrating ====================================================
rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: BLOB/TEXT column 'title' used in key specification
without a key length: CREATE INDEX
index_resources_on_title_and_restype ON resources (title,
restype)
/usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in
query&#39; /usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:inexecute'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:202:in
log&#39; /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.17/lib/active_support/notifications/instrumenter.rb:21:ininstrument'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:200:in
log&#39; /usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:inexecute'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/schema_statements.rb:348:in
add_index&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:insend'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:in
method_missing&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:insay_with_time'
/usr/lib/ruby/1.8/benchmark.rb:293:in measure&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:insay_with_time'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:381:in
method_missing&#39; /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:28:ininit'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:in
instance_eval&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:indefine'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:8:in init&#39; /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:178:inbenchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in realtime&#39; /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:inbenchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:4:in init&#39; /usr/share/foreman/db/migrate/20090714132448_create_hosts.rb:8:inup_without_benchmarks'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in
send&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:inmigrate'
/usr/lib/ruby/1.8/benchmark.rb:293:in measure&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:inmigrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:in
__send__&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:inmigrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:539:in
migrate&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:incall'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:in
ddl_transaction&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:538:inmigrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:in
each&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:inmigrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:435:in
up&#39; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:417:inmigrate'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/railties/databases.rake:151
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:inexecute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
invoke_with_call_chain&#39; /usr/lib/ruby/1.8/monitor.rb:242:insynchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in run&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run&#39; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33 /usr/bin/rake:19:inload'
/usr/bin/rake:19
Tasks: TOP => db:migrate

  • Trey

> Performing a fresh install of 1.1RC1 fails on db:migrate due to an
> issue in Puppet. The host this is on is CentOS 6.3, Puppet-2.6.17.
> Using the mysql2 database adapter results in failed migration [1].
>
> This issue is mentioned here, Bug #1350: Mysql2::Error: BLOB/TEXT column 'title' used in key specification without a key length - Foreman,
> but does not seem to have been fixed in 1.1. Puppet does not seem to
> have supported mysql2 as a database adapter till 2.7.10 2. The
>

Does this means we (foreman) should not support mysql2 for puppets older
than that?

Ohad

··· On Sat, Dec 15, 2012 at 7:05 PM, Trey Dockendorf wrote:

offending lines in the code for 2.6.x 3 will result in MySQL
specific schema operations being skipped. This patch resolved the
issue for me:

— a/migrate/20090714132448_create_hosts.rb
+++ b/migrate/20090714132448_create_hosts.rb
@@ -4,7 +4,7 @@ class CreateHosts < ActiveRecord::Migration
# we are only creating the full database if the hosts table
doesn’t exists, if it does, we assume that store config is already
configured
unless Host.table_exists?
require ‘puppet/rails/database/schema’

  •  Puppet[:dbadapter]=
    

ActiveRecord::Base.configurations[RAILS_ENV][“adapter”]

  • Puppet[:dbadapter]=
    

ActiveRecord::Base.configurations[Rails.env][“adapter”].sub(“mysql2”,
“mysql”)
Puppet::Rails::Schema.init
Puppet::Rails.migrate()
end

I am submitting a pull request right now as well as updating Redmine issue
1350.

[1]:
$ bundle exec rake db:migrate RAILS_ENV=production --trace
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10:
warning: already initialized constant ENC_NONE
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11:
warning: already initialized constant ENC_EUC
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12:
warning: already initialized constant ENC_SJIS
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13:
warning: already initialized constant ENC_UTF8
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateHosts: migrating

rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: BLOB/TEXT column ‘title’ used in key specification
without a key length: CREATE INDEX
index_resources_on_title_and_restype ON resources (title,
restype)

/usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in
`query’

/usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in
`execute’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:202:in
`log’

/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.17/lib/active_support/notifications/instrumenter.rb:21:in
`instrument’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:200:in
`log’

/usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in
`execute’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/schema_statements.rb:348:in
`add_index’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:in
`send’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:in
`method_missing’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:in
say_with_time' /usr/lib/ruby/1.8/benchmark.rb:293:in measure’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:in
`say_with_time’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:381:in
method_missing' /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:28:in init’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:in
`instance_eval’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:in
define' /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:8:in init’
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:178:in benchmark' /usr/lib/ruby/1.8/benchmark.rb:308:in realtime’
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:in benchmark' /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:4:in init’
/usr/share/foreman/db/migrate/20090714132448_create_hosts.rb:8:in
`up_without_benchmarks’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in
`send’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in
migrate' /usr/lib/ruby/1.8/benchmark.rb:293:in measure’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:in
`send

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:539:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:in
`call’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:in
`ddl_transaction’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:538:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:in
`each’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:435:in
`up’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:417:in
`migrate’

/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/railties/databases.rake:151
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
run' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run' /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33 /usr/bin/rake:19:in load’
/usr/bin/rake:19
Tasks: TOP => db:migrate

  • Trey


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

>
>
>
>>
>> Performing a fresh install of 1.1RC1 fails on db:migrate due to an
>> issue in Puppet. The host this is on is CentOS 6.3, Puppet-2.6.17.
>> Using the mysql2 database adapter results in failed migration [1].
>>
>> This issue is mentioned here, http://www.theforeman.org/issues/1350,
>> but does not seem to have been fixed in 1.1. Puppet does not seem to
>> have supported mysql2 as a database adapter till 2.7.10 [2]. The
>
>
> Does this means we (foreman) should not support mysql2 for puppets older
> than that?
>
> Ohad
>>
>> offending lines in the code for 2.6.x [3] will result in MySQL
>> specific schema operations being skipped. This patch resolved the
>> issue for me:
>>
>> — a/migrate/20090714132448_create_hosts.rb
>> +++ b/migrate/20090714132448_create_hosts.rb
>> @@ -4,7 +4,7 @@ class CreateHosts < ActiveRecord::Migration
>> # we are only creating the full database if the hosts table
>> doesn't exists, if it does, we assume that store config is already
>> configured
>> unless Host.table_exists?
>> require 'puppet/rails/database/schema'
>> - Puppet[:dbadapter]=
>> ActiveRecord::Base.configurations[RAILS_ENV]["adapter"]
>> + Puppet[:dbadapter]=
>> ActiveRecord::Base.configurations[Rails.env]["adapter"].sub("mysql2",
>> "mysql")
>> Puppet::Rails::Schema.init
>> Puppet::Rails.migrate()
>> end
>>
>> I am submitting a pull request right now as well as updating Redmine
issue
>> 1350.
>>
>> [1]:
>> $ bundle exec rake db:migrate RAILS_ENV=production --trace
>>
>>
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10:
>> warning: already initialized constant ENC_NONE
>>
>>
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11:
>> warning: already initialized constant ENC_EUC
>>
>>
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12:
>> warning: already initialized constant ENC_SJIS
>>
>>
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13:
>> warning: already initialized constant ENC_UTF8
>> ** Invoke db:migrate (first_time)
>> ** Invoke environment (first_time)
>> ** Execute environment
>> ** Execute db:migrate
>> == CreateHosts: migrating
>> ====================================================
>> rake aborted!
>> An error has occurred, all later migrations canceled:
>>
>> Mysql2::Error: BLOB/TEXT column 'title' used in key specification
>> without a key length: CREATE INDEX
>> index_resources_on_title_and_restype ON resources (title,
>> restype)
>>
>>
/usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in
>> query&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in &gt;&gt;execute'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:202:in
>> log&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.17/lib/active_support/notifications/instrumenter.rb:21:in &gt;&gt;instrument'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract_adapter.rb:200:in
>> log&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/mysql2-0.2.18/lib/active_record/connection_adapters/mysql2_adapter.rb:265:in &gt;&gt;execute'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/schema_statements.rb:348:in
>> add_index&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:in &gt;&gt;send'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:385:in
>> method_missing&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:in &gt;&gt;say_with_time'
>> /usr/lib/ruby/1.8/benchmark.rb:293:in measure&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:361:in &gt;&gt;say_with_time'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:381:in
>> method_missing&#39; &gt;&gt; /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:28:ininit'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:in
>> instance_eval&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/schema.rb:51:in &gt;&gt;define'
>> /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:8:in init&#39; &gt;&gt; /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:178:inbenchmark'
>> /usr/lib/ruby/1.8/benchmark.rb:308:in realtime&#39; &gt;&gt; /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:inbenchmark'
>> /usr/lib/ruby/site_ruby/1.8/puppet/rails/database/schema.rb:4:in init&#39; &gt;&gt; /usr/share/foreman/db/migrate/20090714132448_create_hosts.rb:8:in &gt;&gt;up_without_benchmarks'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in
>> send&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in &gt;&gt;migrate'
>> /usr/lib/ruby/1.8/benchmark.rb:293:in measure&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:314:in &gt;&gt;migrate'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:in
>> __send__&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:397:in &gt;&gt;migrate'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:539:in
>> migrate&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:in &gt;&gt;call'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:615:in
>> ddl_transaction&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:538:in &gt;&gt;migrate'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:in
>> each&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:525:in &gt;&gt;migrate'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:435:in
>> up&#39; &gt;&gt; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:417:in &gt;&gt;migrate'
>>
>>
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.17/lib/active_record/railties/databases.rake:151
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:inexecute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
>> invoke_with_call_chain&#39; &gt;&gt; /usr/lib/ruby/1.8/monitor.rb:242:insynchronize'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
>> invoke_with_call_chain&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
>> invoke_task&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in &gt;&gt;top_level'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
>> each&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in &gt;&gt;top_level'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
>> standard_exception_handling&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in &gt;&gt;top_level'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
>> run&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in &gt;&gt;standard_exception_handling'
>> /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
>> run&#39; &gt;&gt; /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33 &gt;&gt; /usr/bin/rake:19:inload'
>> /usr/bin/rake:19
>> Tasks: TOP => db:migrate
>>
>> [2]: http://projects.puppetlabs.com/issues/9997#note-4
>> [3]:
>>
https://github.com/puppetlabs/puppet/blob/2.6.x/lib/puppet/rails/database/schema.rb#L25
>>
>> - Trey
>>
>> –
>> You received this message because you are subscribed to the Google Groups
>> "Foreman users" group.
>> To post to this group, send email to foreman-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> foreman-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/foreman-users?hl=en.
>>
>
> –
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to
> foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/foreman-users?hl=en.

Functionally the changes Puppet-2.7.10 made to support mysql2 were to just
treat mysql and mysql2 the same.
https://github.com/puppetlabs/puppet/commit/036678925a540e00262a1b66cba1fd468ba0fcf5.
Maybe dropping mysql2 support for Puppet < 2.7.10 is appropriate but only
for stored configs. When not using Foreman with the stored configs
database, there's no real interaction with the Foreman dbadapter and Puppet
except for the initial database migration, correct?

  • Trey
··· On Sun, Dec 16, 2012 at 2:05 PM, Ohad Levy wrote: > On Sat, Dec 15, 2012 at 7:05 PM, Trey Dockendorf wrote:

I don't think there's any db contact when not sharing, although Ohad
will correct me if I'm wrong. Personally I'm adding this to my "list
of reasons we should deprecate/remove db sharing soon" :slight_smile:

··· On 17 December 2012 01:39, Trey Dockendorf wrote: > Functionally the changes Puppet-2.7.10 made to support mysql2 were to just > treat mysql and mysql2 the same. > https://github.com/puppetlabs/puppet/commit/036678925a540e00262a1b66cba1fd468ba0fcf5. > Maybe dropping mysql2 support for Puppet < 2.7.10 is appropriate but only > for stored configs. When not using Foreman with the stored configs database, > there's no real interaction with the Foreman dbadapter and Puppet except for > the initial database migration, correct?

> > Functionally the changes Puppet-2.7.10 made to support mysql2 were to
> just
> > treat mysql and mysql2 the same.
> >
> (#9997) Add mysql2 gem support · puppetlabs/puppet@0366789 · GitHub
> .
> > Maybe dropping mysql2 support for Puppet < 2.7.10 is appropriate but
> only
> > for stored configs. When not using Foreman with the stored configs
> database,
> > there's no real interaction with the Foreman dbadapter and Puppet except
> for
> > the initial database migration, correct?
>
> I don't think there's any db contact when not sharing, although Ohad
> will correct me if I'm wrong. Personally I'm adding this to my "list
> of reasons we should deprecate/remove db sharing soon" :slight_smile:
>
>
I agree, the main concern here is what if you dont have the mysql gem
installed (e.g. changing from mysql2 to mysql require the mysql gem too?)

and yes, + 1 for cutting foreman from storeconfigs in v 1.2

Ohad

··· On Mon, Dec 17, 2012 at 12:50 PM, Greg Sutcliffe wrote: > On 17 December 2012 01:39, Trey Dockendorf wrote:


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

I'm not sure I understand the concern, the mysql2 gem is a complete
substitute for mysql gem. In my testing I don't have a mysql gem
installed, and the change worked fine. The only gem I have is mysql2

In my production that's coming

gem list | grep mysql

mysql2 (0.2.18)

On my dev system
$ gem list | grep mysql
$ ls vendor/ruby/1.8/gems/ | grep mysql
mysql2-0.2.18

  • Trey
··· On Mon, Dec 17, 2012 at 6:30 AM, Ohad Levy wrote: > > > > On Mon, Dec 17, 2012 at 12:50 PM, Greg Sutcliffe > wrote: >> >> On 17 December 2012 01:39, Trey Dockendorf wrote: >> > Functionally the changes Puppet-2.7.10 made to support mysql2 were to >> > just >> > treat mysql and mysql2 the same. >> > >> > https://github.com/puppetlabs/puppet/commit/036678925a540e00262a1b66cba1fd468ba0fcf5. >> > Maybe dropping mysql2 support for Puppet < 2.7.10 is appropriate but >> > only >> > for stored configs. When not using Foreman with the stored configs >> > database, >> > there's no real interaction with the Foreman dbadapter and Puppet except >> > for >> > the initial database migration, correct? >> >> I don't think there's any db contact when not sharing, although Ohad >> will correct me if I'm wrong. Personally I'm adding this to my "list >> of reasons we should deprecate/remove db sharing soon" :) >> > > I agree, the main concern here is what if you dont have the mysql gem > installed (e.g. changing from mysql2 to mysql require the mysql gem too?) > > and yes, + 1 for cutting foreman from storeconfigs in v 1.2 > > Ohad >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To post to this group, send email to foreman-users@googlegroups.com. >> To unsubscribe from this group, send email to >> foreman-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/foreman-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.