theforeman / foreman_templates Goto Github PK
View Code? Open in Web Editor NEWA plugin for Foreman to sync provisioning templates from an external source
License: GNU General Public License v3.0
A plugin for Foreman to sync provisioning templates from an external source
License: GNU General Public License v3.0
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.
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>
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
Hi, it would be great to have an option to import templates from local directory on disk.
Regards
Dmitry
A setting to set taxonomy would make lot of sense in Satellite context. All imported templates are missing taxonomy completely.
Hi,
Currently when you sync templates with a prefix, the snippets referenced are not updated.
Ideally, it would update the referenced templates too and replace them with a prefix.
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)
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
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?
I'm trying to export templates to my own git repo (hosted on an internal Gitlab).
Imports work as expected.
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)
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 ?
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)
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.
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:
os_missing_ptable:
After manually associating the template to the os_family, notice everything works as expected:
ptable_template:
os_with_ptable:
Recommend that the os_family be associated when importing templates as well. Documentation for the settings should also be updated to reflect this.
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?
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.
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.
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 ?
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.