Enabling ansible plugin results in failure of db:migrate

I found the problem and a workaround as my colleague @Crited ran in the same problem, for solutions perhaps @ezr-ondrej or @Ondrej_Prazak can have a look as the code owners.

When running the migration I recognized the GraphQL code added with 7.0.0 is trying to accessing the not initialized database, so I did the following:

mv /usr/share/gems/gems/foreman_ansible-7.0.2/app/graphql /tmp
vi /usr/share/gems/gems/foreman_ansible-7.0.2/lib/foreman_ansible/register.rb (comment the block related to graphql)
foreman-rake db:migrate
mv /tmp/graphql /usr/share/gems/gems/foreman_ansible-7.0.2/app/
vi /usr/share/gems/gems/foreman_ansible-7.0.2/lib/foreman_ansible/register.rb (remove the comment so the code)

So it looks like this problem will hit every fresh installation but not upgrades from older versions.

Afterwards I had another problem that the installer did not restart Foreman so the plugin was loaded before the smart proxy tried to register the feature so it failed and required some manual steps again, but now it looks fine.

2 Likes