Rake aborted! foreman-rake db:seed

Hi,

I'm trying to install foreman 1.15.6 using an external postgresql.

When I run the foreman-installer, with this parameters:
–enable-foreman-compute-vmware --enable-foreman-plugin-hooks
–enable-foreman-plugin-salt --enable-foreman-proxy-plugin-salt
–enable-foreman-proxy --foreman-proxy-tftp=true
–foreman-proxy-tftp-servername=10.130.30.62 --foreman-db-type=postgresql
–foreman-db-manage=false --foreman-db-host=10.130.10.247
–foreman-db-database=foreman --foreman-db-username=foreman
–foreman-db-password='foreman' --foreman-proxy-register-in-foreman=false
–foreman-proxy-plugin-salt-api

it seems to work fine until 72% when executing foreman-rake-db:seed:

/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:
seed]: Failed to call refresh: '/usr/sbin/foreman-rake db:seed' returned 1
instead of one of [0]
/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:
seed]: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:106:in
fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:164:insync
'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:603:in
refresh' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager .rb:147:inprocess_callback'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:34:in
block in process_events' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:119:inblock in queued_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager
.rb:118:in each' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:inqueued_events'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:33:in
process_events' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:247:ineval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in call' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:inblock (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in block in thinmark' /opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:inrealtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in thinmark' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:inblock
in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in
traverse' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:inevaluate'
/usr/share/gems/gems/kafo-2.0.0/modules/kafo_configure/lib/puppet/parser/
functions/add_progress.rb:30:in evaluate_with_trigger' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:inblock in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in
with_destination' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:142 :inas_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in
apply' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:inblock in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in block in benchmark' /opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:inrealtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in
benchmark' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:inapply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in run_internal' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:inblock in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in
override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:inoverride'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in
run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:350: inapply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in
block in main' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:inoverride'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in override' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:inmain'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in
run_command' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:inblock
in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in exit_on_fail' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:358:inrun'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:
in run' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:inexecute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Installing Done [
100%] […]

after that, I try to run foreman-rake db:seed in command line:

foreman-rake db:seed

Seeding /usr/share/foreman/db/seeds.d/02-partition_tables_list.rb
Seeding /usr/share/foreman/db/seeds.d/02-permissions_list.rb
Seeding /usr/share/foreman/db/seeds.d/02-provisioning_templates_list.rb
Seeding /usr/share/foreman/db/seeds.d/02-roles_list.rb
Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/03-roles.rb
Seeding /usr/share/foreman/db/seeds.d/04-admin.rb
Seeding /usr/share/foreman/db/seeds.d/05-taxonomies.rb
Seeding /usr/share/foreman/db/seeds.d/06-architectures.rb
Seeding /usr/share/foreman/db/seeds.d/07-data.rb
Seeding /usr/share/foreman/db/seeds.d/07-provisioning_templates.rb
Seeding /usr/share/foreman/db/seeds.d/08-data.rb
Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb
Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb
Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb
Seeding /usr/share/foreman/db/seeds.d/16-mail_notifications.rb
Seeding /usr/share/foreman/db/seeds.d/17-notification_blueprints.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6/db/
seeds.d/20-foreman_tasks_permissions.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6/db/
seeds.d/60-dynflow_proxy_feature.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.9.6/db/
seeds.d/61-foreman_tasks_bookmarks.rb
Seeding /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/
seeds.d/75-salt_seeds.rb
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Filters.role is locked for
user modifications.
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/validations.rb:79:in raise_record_invalid&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:43:insave!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:29:in
save!&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/transactions.rb:291:inblock in save!'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in
block in with_transaction_returning_status&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:inblock in transaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/connection_adapters/abstract/transaction.rb:184:in
within_new_transaction&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:intransaction'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in
transaction&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/transactions.rb:348:inwith_transaction_returning_status'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:291:in
save!&#39; /usr/share/foreman/app/models/role.rb:169:inadd_permissions!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/
75-salt_seeds.rb:9:in block in &lt;top (required)&gt;&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:ineach'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:in
each&#39; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/ 75-salt_seeds.rb:8:in<top (required)>'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in
load&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:inblock in load'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/
active_support/dependencies.rb:240:in load_dependency&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:inload'
/usr/share/foreman/db/seeds.rb:38:in block in &lt;top (required)&gt;&#39; /usr/share/foreman/db/seeds.rb:36:ineach'
/usr/share/foreman/db/seeds.rb:36:in &lt;top (required)&gt;&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:inload'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/
active_support/dependencies.rb:268:in block in load&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:inload_dependency'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in
load&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/ engine.rb:547:inload_seed'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:250:in
load_seed&#39; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:183:inblock (2 levels) in <top (required)>'
Tasks: TOP => db:seed

Thank you for your help,
Regards

Two things that may help until an expert can give some imput

I recommend all ways using FQDNs for the host and server names. It’s ok if you do not have DNS just add the entries to the local hosts file

Also did you set up the foreman account in Postgres? When you use an external db the user account and access permissions need to be in place.

Regards, Mike.

Hi,

Yes I'm using FQDN and all configuration for user account and access
permissions have been added.

Regards,

··· Le mercredi 18 octobre 2017 01:11:18 UTC+2, Michael Hurn a écrit : > > Two things that may help until an expert can give some imput > > I recommend all ways using FQDNs for the host and server names. It’s ok if > you do not have DNS just add the entries to the local hosts file > > Also did you set up the foreman account in Postgres? When you use an > external db the user account and access permissions need to be in place. > > Regards, Mike.

Hi,
the seeds from foreman_salt in:

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d/
75-salt_seeds.rb

try to add permissions from foreman_salt to an existing role [1] which is
locked. A small patch for foreman_salt will be needed to fix this, I
already created a ticket [2]. Without foreman_salt, the seeds should pass.

Hope this helps,
Ondrej Prazak

[1]


[2] Bug #21372: Modifying viewer role in seeds causes the seeds to fail - Salt - Foreman

··· On Wed, Oct 18, 2017 at 1:11 AM, Michael Hurn wrote:

Two things that may help until an expert can give some imput

I recommend all ways using FQDNs for the host and server names. It’s ok if
you do not have DNS just add the entries to the local hosts file

Also did you set up the foreman account in Postgres? When you use an
external db the user account and access permissions need to be in place.

Regards, Mike.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

It looked like you were not using FQDNs as you used IP addresses in your
foreman install

"–foreman-proxy-tftp-servername=10.130.30.62
–foreman-db-host=10.130.10.247"

Hence my suggestion to use FQDN. It may not be an issue in your case as it
looks like your issue is beyond just using FQDNs.

Good luck with Foreman.

Regards, Mike.

··· On Wednesday, October 18, 2017 at 3:59:29 AM UTC-4, Sam Amara wrote: > > Hi, > > Yes I'm using FQDN and all configuration for user account and access > permissions have been added. > > Regards, > > Le mercredi 18 octobre 2017 01:11:18 UTC+2, Michael Hurn a écrit : >> >> Two things that may help until an expert can give some imput >> >> I recommend all ways using FQDNs for the host and server names. It’s ok >> if you do not have DNS just add the entries to the local hosts file >> >> Also did you set up the foreman account in Postgres? When you use an >> external db the user account and access permissions need to be in place. >> >> Regards, Mike. > >

Hi,

I am bad in RubyonRails :frowning:
How can I add permissions to an existing role? I'm blocked to continue
foreman installation.

Thank you.

··· Le mercredi 18 octobre 2017 08:44:25 UTC+2, Ondrej Prazak a écrit : > > Hi, > the seeds from foreman_salt in: > > /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.d > /75-salt_seeds.rb > > try to add permissions from foreman_salt to an existing role [1] which is > locked. A small patch for foreman_salt will be needed to fix this, I > already created a ticket [2]. Without foreman_salt, the seeds should pass. > > Hope this helps, > Ondrej Prazak > > [1] > https://github.com/theforeman/foreman_salt/blob/8.0.2/db/seeds.d/75-salt_seeds.rb#L5-L10 > [2] http://projects.theforeman.org/issues/21372 > > On Wed, Oct 18, 2017 at 1:11 AM, Michael Hurn > wrote: > >> Two things that may help until an expert can give some imput >> >> I recommend all ways using FQDNs for the host and server names. It’s ok >> if you do not have DNS just add the entries to the local hosts file >> >> Also did you set up the foreman account in Postgres? When you use an >> external db the user account and access permissions need to be in place. >> >> Regards, Mike. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at https://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >

Hi,

I have just find this:

Upgrade warnings
>
> - CVE-2016-8634
> <Foreman :: Security>
> is fixed on this version. This means users not in any organization or
> location will not be able to see anything unless they are administrators.
> - Roles ‘Manager’ and ‘Viewer’ used to only have permissions related
> to Foreman itself but no permissions related to Foreman plugins. This
> decision was taken because users found confusing that “Viewer” or “Manager”
> roles would not contain all permissions.
>
> Foreman :: Manual

This has to do with my issue?

··· Le vendredi 20 octobre 2017 14:31:38 UTC+2, Sam Amara a écrit : > > Hi, > > I am bad in RubyonRails :( > How can I add permissions to an existing role? I'm blocked to continue > foreman installation. > > Thank you. > > Le mercredi 18 octobre 2017 08:44:25 UTC+2, Ondrej Prazak a écrit : >> >> Hi, >> the seeds from foreman_salt in: >> >> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds. >> d/75-salt_seeds.rb >> >> try to add permissions from foreman_salt to an existing role [1] which is >> locked. A small patch for foreman_salt will be needed to fix this, I >> already created a ticket [2]. Without foreman_salt, the seeds should pass. >> >> Hope this helps, >> Ondrej Prazak >> >> [1] >> https://github.com/theforeman/foreman_salt/blob/8.0.2/db/seeds.d/75-salt_seeds.rb#L5-L10 >> [2] http://projects.theforeman.org/issues/21372 >> >> On Wed, Oct 18, 2017 at 1:11 AM, Michael Hurn >> wrote: >> >>> Two things that may help until an expert can give some imput >>> >>> I recommend all ways using FQDNs for the host and server names. It’s ok >>> if you do not have DNS just add the entries to the local hosts file >>> >>> Also did you set up the foreman account in Postgres? When you use an >>> external db the user account and access permissions need to be in place. >>> >>> Regards, Mike. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Foreman users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to foreman-user...@googlegroups.com. >>> To post to this group, send email to forema...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/foreman-users. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >>

> > Foreman :: Manual
>
> This has to do with my issue?

Yes, that's "the cause" but it's an issue of foreman_salt plugin that needs to
be fixed.

··· -- Marek

On pátek 20. října 2017 16:34:24 CEST Sam Amara wrote:

Hi,

I have just find this:

Upgrade warnings

is fixed on this version. This means
users not in any organization or location will not be able to see
anything unless they are administrators. - Roles ‘Manager’ and
‘Viewer’ used to only have permissions related to Foreman itself but
no permissions related to Foreman plugins. This decision was taken
because users found confusing that “Viewer” or “Manager” roles would
not contain all permissions.

Foreman :: Manual

This has to do with my issue?

Le vendredi 20 octobre 2017 14:31:38 UTC+2, Sam Amara a écrit :

Hi,

I am bad in RubyonRails :frowning:
How can I add permissions to an existing role? I’m blocked to continue
foreman installation.

Thank you.

Le mercredi 18 octobre 2017 08:44:25 UTC+2, Ondrej Prazak a écrit :

Hi,
the seeds from foreman_salt in:

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-8.0.2/db/seeds.
d/75-salt_seeds.rb

try to add permissions from foreman_salt to an existing role [1] which is
locked. A small patch for foreman_salt will be needed to fix this, I
already created a ticket [2]. Without foreman_salt, the seeds should
pass.

Hope this helps,
Ondrej Prazak

[1]
https://github.com/theforeman/foreman_salt/blob/8.0.2/db/seeds.d/75-salt_
seeds.rb#L5-L10 [2] Bug #21372: Modifying viewer role in seeds causes the seeds to fail - Salt - Foreman

On Wed, Oct 18, 2017 at 1:11 AM, Michael Hurn michae...@gmail.com > >> > >> wrote:

Two things that may help until an expert can give some imput

I recommend all ways using FQDNs for the host and server names. It’s ok
if you do not have DNS just add the entries to the local hosts file

Also did you set up the foreman account in Postgres? When you use an
external db the user account and access permissions need to be in place.

Regards, Mike.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.