GithubHelp home page GithubHelp logo

theforeman / foreman_templates Goto Github PK

View Code? Open in Web Editor NEW
40.0 8.0 55.0 480 KB

A plugin for Foreman to sync provisioning templates from an external source

License: GNU General Public License v3.0

Ruby 29.06% HTML 1.58% JavaScript 63.70% Shell 0.09% Makefile 0.78% SCSS 0.39% Jupyter Notebook 4.40%
hacktoberfest

foreman_templates's Introduction

foreman_templates

This plugin will sync the contents of the Foreman Community Templates repository (or a git repo of your choice) to your local Foreman instance. It can also be used to sync local directory, therefore any other version control systems can be used.

Installation

See Install a plugin in the Foreman documentation for how to install Foreman plugins.

The gem name is "foreman_templates".

RPM users can install the "tfm-rubygem-foreman_templates" or "rubygem-foreman_templates" packages.

Latest code

You can get the develop branch of the plugin by specifying your Gemfile in this way:

gem 'foreman_templates', :git => "https://github.com/theforeman/foreman_templates.git"

Configuration

The plugin comes with settings providing sane defaults for import. You can change them under Administer > Settings, TemplateSync tab. These can be overriden for each import by passing options directly to a Rake task (see Usage section for how to do that)

Usage

For more detailed description, please see the plugin manual, select the approriate version

Integration with other Foreman Plugins

This plugin now fully relies on core importing capabilities. That means models inheriting from Template class are supported. To customize import behavior, you can override import_custom_data in your inheritting class. See example at remote execution plugin

Copyright

Copyright (c) 2013 Greg Sutcliffe

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

foreman_templates's People

Contributors

adamruzicka avatar amirfefer avatar ares avatar arnisoph avatar brandonweeks avatar dlobatog avatar dmitri-d avatar domcleal avatar ehelms avatar ekohl avatar ezr-ondrej avatar fraenki avatar gregsutcliffe avatar hboetes avatar jyejare avatar lzap avatar mariaaga avatar matonb avatar mmoll avatar ofedoren avatar sathieu avatar sean797 avatar sharvit avatar stbenjam avatar stejskalleos avatar stevie- avatar tbrisker avatar treydock avatar unorthodoxgeek avatar xprazak2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foreman_templates's Issues

ptables support (foreman 1.9)

I use a custom git repository for my provisioning templates in foreman.

Can you add support for ptables which are now templates since foreman 1.9 plz ?

Updating locked templates fails

I loaded the templates from theforeman server. After this i imported them with Lock templates: yes.
Making all my templates locked.

Now i want to update a template using git. I try to pull the repo but foreman complains about the template being locked.
I want the template to be locked in foreman. But i still like to be able to make changes using git.

purge does not remove partition tables

Hi,
in a test installation, I experimented with template:sync and imported the community templates first with a foo, then with a foo- prefix. Both sync were cleaned up with a corresponding template:purge. However, the foo and foo- prefixed partition tables remained in the database.
Greetings
Marc

Works with partition table snippets?

We're using Foreman 1.10.3 and have a number of partition table snippets. I'd like to use this plugin to migrate to a git repository, but the plugin doesn't appear to support using snippets in partition tables. Code leads me to believe snippets will be imported as provisioning templates. Is this correct?

Feature Request: API endpoint(s) for configuring git repo & sync options

The plugin creates only two API endpoints, /api/templates/export and /api/templates/import. As far as I can tell, there is no programmatic way to configure the git repo and sync options. This would be a helpful feature for me as I have multiple foreman deployments which are managed / updated via puppet.

Location Association

We have to manually set template association for "location" in Foreman, this line however looks like it should do this automatically:
:desc => N_("Associate to OS's, Locations & Organizations. Options are: always, new or never.")
In only appears to associate to OS's.

support ssh agent for git clone

We would like to use foremna_templates to pull from our private git repo. Thus we always need to support credentials.
Putting credentials in a git HTTPS url using basic auth is not very flexible nor secure.

repo='https://username:[email protected]/path/to.git'

Thus we could use ssh git url which is very flexible and makes use of ssh keypair.

repo='ssh://[email protected]:22/path/to.git'

But apperently rake is not using SSH-Agent from ssh login.

foreman-rake templates:sync associate='always' repo="ssh://[email protected]:22/path/to.git" prefix="MY"
rake aborted!
Git::GitExecuteError: git  clone '--' 'ssh://[email protected]:22/path/to.git' '/tmp/d20161007-26134-zix809'  2>&1:Cloning into '/tmp/d20161007-26134-zix809'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/usr/share/foreman/vendor/ruby/2.0.0/gems/git-1.2.9.1/lib/git/lib.rb:917:in `command'
/usr/share/foreman/vendor/ruby/2.0.0/gems/git-1.2.9.1/lib/git/lib.rb:76:in `clone'
/usr/share/foreman/vendor/ruby/2.0.0/gems/git-1.2.9.1/lib/git/base.rb:29:in `clone'
/usr/share/foreman/vendor/ruby/2.0.0/gems/git-1.2.9.1/lib/git.rb:97:in `clone'
/usr/share/foreman/vendor/ruby/2.0.0/gems/foreman_templates-3.1.0/app/services/foreman_templates/template_importer.rb:34:in `import!'
/usr/share/foreman/vendor/ruby/2.0.0/gems/foreman_templates-3.1.0/lib/tasks/foreman_templates_tasks.rake:22:in `block (2 levels) in <top (required)>'
/usr/bin/rake2.0:37:in `<main>'
Tasks: TOP => templates:sync
(See full trace by running task with --trace)

if we run command on shell it works

git  clone '--' 'ssh://[email protected]:22/path/to.git' '/tmp/d20161007-20901-qbjk9t'

Could we make rake aware of SSH-Agent ?

TemplateSync importing only to DB and not UI in Foreman 1.17

Having a problem with 1.17, think this worked before, not sure why a month later this isn't working.

We have a custom git repo for templates, that we set up in the TemplateSync settings.

We perform:
/sbin/foreman-rake templates:import

It shows our prefixed templates get imported successfully. If we select the given name from the mysql db it returns a row successfully. In the UI, however, this provisioning template does not appear. None of them do. We checked things like possibly a bad name / etc. and have run out of ideas of what could be wrong.

When performing:
/sbin/foreman-rake templates:purge

It does indeed show the records being removed properly from the DB.

Name : tfm-rubygem-foreman_templates
Arch : noarch
Version : 5.0.1
Release : 2.fm1_17.el7

hammer command "import-template" fails on Foreman 3.5

  • foreman-release-3.5.1-1.el8.noarch
  • rubygem-katello-4.7.0-1.el8.noarch
  • rubygem-hammer_cli-3.5.0-1.el8.noarch
  • rubygem-hammer_cli_foreman-3.5.0-1.el8.noarch
  • rubygem-foreman_templates-9.3.0-2.fm3_5.el8.noarch
  • rubygem-hammer_cli_foreman_templates-0.2.0-3.fm3_5.el8.noarch

Currently trying to retrigger an import that ran successfully with foreman-rake templates:import ends like this:

hammer> import-templates
[ INFO 2023-01-31T09:56:25 HammerCLI::ShellMainCommand] Called with options: {}
[DEBUG 2023-01-31T09:56:25 HammerCLIForeman::CommandExtensions::OptionSources] Called block for HammerCLIForeman::Command option sources:
	#<Proc:0x00005589152b2c78 /usr/share/gems/gems/hammer_cli_foreman-3.5.0/lib/hammer_cli_foreman/command_extensions/option_sources.rb:6>
[DEBUG 2023-01-31T09:56:25 Exception] Using exception handler HammerCLIForemanTemplates::ExceptionHandler#handle_general_exception
[ERROR 2023-01-31T09:56:25 Exception] Fehler: undefined method `action' for nil:NilClass
Could not import:
  Fehler: undefined method `action' for nil:NilClass
[ERROR 2023-01-31T09:56:25 Exception] 

NoMethodError (undefined method `action' for nil:NilClass):
    /usr/share/gems/gems/hammer_cli_foreman-3.5.0/lib/hammer_cli_foreman/option_sources/id_params.rb:13:in `available_id_params'
    /usr/share/gems/gems/hammer_cli_foreman-3.5.0/lib/hammer_cli_foreman/option_sources/id_params.rb:43:in `get_options'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/sources/base.rb:8:in `process'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `each'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `inject'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `process'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:22:in `block in process'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `each'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `inject'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/processor_list.rb:21:in `process'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/option_collector.rb:17:in `all_options_raw'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/option_collector.rb:21:in `all_options'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/options/option_collector.rb:25:in `options'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:389:in `options'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:117:in `parse'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:62:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/shell.rb:100:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/lib/hammer_cli/abstract.rb:103:in `run'
    /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /usr/share/gems/gems/hammer_cli-3.5.0/bin/hammer:147:in `<top (required)>'
    /bin/hammer:23:in `load'
    /bin/hammer:23:in `<main>'


hammer> 

Export fails on git v2.17.1 with ruby-git 1.3.0

Summary

I'm trying to export templates to my own git repo (hosted on an internal Gitlab).

Imports work as expected.

Environment:

  • OS: Ubuntu 18.04
  • Foreman version: 1.20.1
  • Foreman templates plugin version: 6.0.3
  • Git version: 2.17.1

What I've done by following this guide

  • Update the repo setting on foreman w/ this:

    hammer settings set --name template_sync_branch --value master
    hammer settings set --name --value ssh://git@mygitlab/mygroup/foreman-provisioning-templates.git
    
  • Add our gitlab's host key:

    ssh-keyscan -H mygitlab >> /usr/share/foreman/.ssh/known_hosts
    chown foreman:foreman /usr/share/foreman/.ssh/known_hosts
    
  • I created a SSH key on foreman with this:

    sudo -u foreman ssh-keygen
    
  • Using the public key, I created a deploy key in the Gitlab project's "Deploy keys" (I verified I could clone the repo)

  • I installed the hammer cli templates plugin:

    gem install hammer_cli_foreman_templates
    
  • I then ran this

    hammer export-template --verbose true
    
  • Got this error:

    "git '--git-dir=/tmp/d20190110-1928-2om4sm/.git' '--work-tree=/tmp/d20190110-1928-2om4sm' ls-files '--stage' ''  2>&1:fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths"
    

I see that the ruby-git version bundled w/ my foreman is 1.3.0:

cat /usr/share/foreman/Gemfile.lock |grep git
      git                                                       
    git (1.3.0)                                                 

Similar issues:

Import failed using ssh

Hi,

I'm trying to import templates from a custom git repo.

When I run via https it works fine but then I need to enter the password:

sudo foreman-rake templates:sync repo="https://[email protected]/scm/xx/foreman-templates.git" prefix="pre-" --trace

I can clone the repo with git:

git clone ssh://[email protected]/xx/foreman-templates.git

But if I try to combine all of the above to be able to update the templates using the plugin and using a key instead for a password it happens the following:

sudo foreman-rake templates:sync repo="ssh://[email protected]/xx/foreman-templates.git" prefix="pre-" --trace
** Invoke templates:sync (first_time)
** Invoke environment (first_time)
** Execute environment
Workaround for RbVmomi may not work as ComputeResource is already loaded: ComputeResource
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Execute templates:sync
rake aborted!
Errno::ENOENT: No such file or directory - /tmp/d20150602-7732-dw9y0p
/usr/lib/ruby/1.9.1/fileutils.rb:696:in `lstat'
/usr/lib/ruby/1.9.1/fileutils.rb:696:in `remove_entry_secure'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_templates-1.5.0/lib/templates.rake:194:in `ensure in block (2 levels) in <top (required)>'
/usr/share/foreman/vendor/ruby/1.9.1/gems/foreman_templates-1.5.0/lib/templates.rake:194:in `block (2 levels) in <top (required)>'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/share/foreman/vendor/ruby/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/usr/bin/rake1.9.1:32:in `<main>'
Tasks: TOP => templates:sync

Thanks.

X

Unable to import from a local github

We have an internal github instance that has a self signed cert. So I've been using git config --global http.sslverify false in order to push/pull. How would I enable that for the foreman_templates plugin?

'associate' option should also associate the 'os_family'

The associate option will associate Locations, Organization, and Operating Systems. However, the os_family from the template is ignored. When standing up a new Foreman server, if the os_family is ignored, I can sync the templates, and attempt to associate the template with the Operating System, however, because the template does not belong to the os_family, the Operating System doesn't honor the association in the UI.

BEFORE MANUAL ASSOCIATION

Following an import, notice that the partition table (applies to all templates) has the os_family value set, but it does not apply it to the template and it is not selectable from the OS in the UI:

ptable_template:

image

os_missing_ptable:

image

AFTER MANUAL ASSOCIATION:

After manually associating the template to the os_family, notice everything works as expected:

ptable_template:

image

os_with_ptable:

image

Recommend that the os_family be associated when importing templates as well. Documentation for the settings should also be updated to reflect this.

Taxonomy is not set

A setting to set taxonomy would make lot of sense in Satellite context. All imported templates are missing taxonomy completely.

installation fails on new katello setup

hey,

i recently deployed katello.
but i have difficulty installing this plugin.
i relay appreciate any help! :)

[root@katello ~]# foreman-installer --enable-foreman-plugin-templates
2023-06-17 01:09:12 [NOTICE] [root] Loading installer configuration. This will take some time.
2023-06-17 01:09:15 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2023-06-17 01:09:15 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2023-06-17 01:09:21 [NOTICE] [configure] Starting system configuration.
2023-06-17 01:09:29 [NOTICE] [configure] 250 configuration steps out of 1639 steps complete.
2023-06-17 01:09:30 [NOTICE] [configure] 500 configuration steps out of 1695 steps complete.
2023-06-17 01:09:31 [NOTICE] [configure] 750 configuration steps out of 1699 steps complete.
2023-06-17 01:09:39 [NOTICE] [configure] 1000 configuration steps out of 1707 steps complete.
2023-06-17 01:09:39 [NOTICE] [configure] 1250 configuration steps out of 1708 steps complete.
2023-06-17 01:10:00 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2023-06-17 01:10:00 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2023-06-17 01:10:10 [NOTICE] [configure] 1500 configuration steps out of 1708 steps complete.
2023-06-17 01:10:18 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/katello.log

/var/log/foreman-installer/katello.log

[...]
2023-06-17 01:09:40 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Starting to evaluate the resource (1395 of 1708)
2023-06-17 01:09:40 [DEBUG ] [configure] Exec[foreman-rake-db:migrate](provider=posix): Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
2023-06-17 01:09:40 [DEBUG ] [configure] Executing with uid=foreman: '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
2023-06-17 01:09:51 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless: Run `bin/rails db:migrate` to update your database th
en try again.
2023-06-17 01:09:51 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless: You have 2 pending migrations:
2023-06-17 01:09:51 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless:   20180627134929 ChangeLockSetting
2023-06-17 01:09:51 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless:   20211122154929 TemplatesSettingsCategoryToDsl
2023-06-17 01:09:51 [DEBUG ] [configure] Exec[foreman-rake-db:migrate](provider=posix): Executing '/usr/sbin/foreman-rake db:migrate'
2023-06-17 01:09:51 [DEBUG ] [configure] Executing with uid=foreman: '/usr/sbin/foreman-rake db:migrate'
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: rake aborted!
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: StandardError: An error has occurred, this and all l
ater migrations canceled:
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::UndefinedColumn: ERROR:  column settings.categor
y does not exist
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: LINE 1: ... IN (SELECT "settings"."id" FROM "setting
s" WHERE "settings"...
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
         ^
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/activerecord-6.1.7.3/lib/active
_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
2023-06-17 01:10:00 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/activerecord-6.1.7.3/lib/active
_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
[...]
[root@katello ~]# foreman-rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Invoke plugin:refresh_migrations (first_time)
** Invoke environment
** Execute plugin:refresh_migrations
** Execute db:migrate
== 20211122154929 TemplatesSettingsCategoryToDsl: migrating ===================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedColumn: ERROR:  column settings.category does not exist
LINE 1: ... IN (SELECT "settings"."id" FROM "settings" WHERE "settings"...
                                                             ^
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:in `exec_delete'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:179:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation.rb:466:in `update_all'
/usr/share/gems/gems/foreman_templates-9.3.0/db/migrate/20211122154929_templates_settings_category_to_dsl.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/ruby/benchmark.rb:293:in `measure'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column settings.category does not exist
LINE 1: ... IN (SELECT "settings"."id" FROM "settings" WHERE "settings"...
                                                             ^
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:in `exec_delete'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:179:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation.rb:466:in `update_all'
/usr/share/gems/gems/foreman_templates-9.3.0/db/migrate/20211122154929_templates_settings_category_to_dsl.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/ruby/benchmark.rb:293:in `measure'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'

Caused by:
PG::UndefinedColumn: ERROR:  column settings.category does not exist
LINE 1: ... IN (SELECT "settings"."id" FROM "settings" WHERE "settings"...
                                                             ^
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_no_cache'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:649:in `execute_and_clear'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:72:in `exec_delete'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:179:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `update'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation.rb:466:in `update_all'
/usr/share/gems/gems/foreman_templates-9.3.0/db/migrate/20211122154929_templates_settings_category_to_dsl.rb:3:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `public_send'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:870:in `exec_migration'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/share/ruby/benchmark.rb:293:in `measure'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:850:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:849:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1037:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `block in ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/transactions.rb:209:in `transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1380:in `ddl_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `block in migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1251:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1086:in `up'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/migration.rb:1061:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate

Installation with interactive mode does fail the same way.

[root@katello ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.8 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.8 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.8"
[root@katello ~]# rpm -qa | grep 'katello\|foreman'
rubygem-foreman_statistics-2.0.1-4.fm3_5.el8.noarch
foreman-debug-3.6.1-1.el8.noarch
katello-debug-4.8.1-1.el8.noarch
rubygem-foreman-tasks-7.2.1-2.fm3_6.el8.noarch
rubygem-hammer_cli_katello-1.8.1-1.el8.noarch
rubygem-foreman_dhcp_browser-0.0.8-6.fm3_3.el8.noarch
foreman-installer-3.6.1-1.el8.noarch
foreman-selinux-3.6.1-1.el8.noarch
katello-repos-4.8.1-1.el8.noarch
rubygem-foreman_bootdisk-21.0.4-1.fm3_6.el8.noarch
ansiblerole-foreman_scap_client-0.2.0-2.el8.noarch
foreman-postgresql-3.6.1-1.el8.noarch
foreman-dynflow-sidekiq-3.6.1-1.el8.noarch
katello-certs-tools-2.9.0-1.el8.noarch
katello-selinux-4.0.2-3.el8.noarch
katello-common-4.8.1-1.el8.noarch
rubygem-foreman_remote_execution-9.1.0-1.fm3_6.el8.noarch
rubygem-foreman_maintain-1.3.0-1.el8.noarch
rubygem-foreman_webhooks-3.0.5-1.fm3_5.el8.noarch
foreman-proxy-3.6.1-1.el8.noarch
rubygem-foreman_templates-9.3.0-2.fm3_5.el8.noarch
rubygem-hammer_cli_foreman-3.6.0-1.el8.noarch
foreman-ovirt-3.6.1-1.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.18-1.fm3_5.el8.noarch
rubygem-foreman_ansible-11.2.0-1.fm3_6.el8.noarch
rubygem-foreman_openscap-6.0.0-1.fm3_6.el8.noarch
ansible-collection-theforeman-operations-1.3.0-1.el8.noarch
katello-4.8.1-1.el8.noarch
foreman-cli-3.6.1-1.el8.noarch
foreman-3.6.1-1.el8.noarch
ansible-collection-theforeman-foreman-3.10.0-1.el8.noarch
foreman-service-3.6.1-1.el8.noarch
foreman-installer-katello-3.6.1-1.el8.noarch
rubygem-foreman_discovery-22.0.4-1.fm3_6.el8.noarch
katello-client-bootstrap-1.7.9-1.el8.noarch
foreman-release-3.6.1-1.el8.noarch
rubygem-katello-4.8.1-1.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch

If you need any more assistance i can reproduce this and would be able provide additional information.

Please support export over ssh

With my proposed patch I ran into the following problem while trying to export over ssh/git

foreman-rake templates:export repo="ssh://git@gitserver:/home/git/templates2.git" verbose=true
Successfully encrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully decrypted field for Setting::Auth oauth_consumer_key
Successfully encrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
Successfully decrypted field for Setting::Auth oauth_consumer_secret
rake aborted!
Git::GitExecuteError: git '--git-dir=/tmp/d20170328-9946-1oln4r4/.git' '--work-tree=/tmp/d20170328-9946-1oln4r4' push 'origin' ''  2>&1:fatal: remote part of refspec is not a valid name in 
/usr/share/foreman/vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/lib.rb:937:in `command'
/usr/share/foreman/vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/lib.rb:742:in `push'
/usr/share/foreman/vendor/ruby/2.3.0/gems/git-1.3.0/lib/git/base.rb:329:in `push'
/usr/share/foreman/vendor/ruby/2.3.0/bundler/gems/foreman_templates-f7c15eafd844/app/services/foreman_templates/template_exporter.rb:50:in `export_to_git'
/usr/share/foreman/vendor/ruby/2.3.0/bundler/gems/foreman_templates-f7c15eafd844/app/services/foreman_templates/template_exporter.rb:9:in `export!'
/usr/share/foreman/vendor/ruby/2.3.0/bundler/gems/foreman_templates-f7c15eafd844/lib/tasks/foreman_templates_tasks.rake:43:in `block (2 levels) in <top (required)>'
Tasks: TOP => templates:export
(See full trace by running task with --trace)

Error with 6.0.2 and Foreman 1.18 RC3

I just upgraded a test system to 1.18 RC3 and foreman_templates 6.0.2 and am getting an error running the rake task for import:

[root@foreman-test ~]# foreman-rake templates:import
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 0)
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-6.0.2/lib/tasks/foreman_templates_tasks.rake:34:in `to_h'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-6.0.2/lib/tasks/foreman_templates_tasks.rake:34:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-6.0.2/lib/tasks/foreman_templates_tasks.rake:34:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-6.0.2/lib/tasks/foreman_templates_tasks.rake:34:in `map'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_templates-6.0.2/lib/tasks/foreman_templates_tasks.rake:34:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby24/root/usr/share/gems/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => templates:import
(See full trace by running task with --trace)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.