Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #30647 - Parameterize redhat_register install parameters for kt_activation_keys. #7904

Merged
merged 3 commits into from
Oct 29, 2020
Merged

Fixes #30647 - Parameterize redhat_register install parameters for kt_activation_keys. #7904

merged 3 commits into from
Oct 29, 2020

Conversation

jeffmcutter
Copy link
Contributor

For redhat_register provisioning template snippet when passing kt_activation_keys parameter as in the case for when an activation key is defined in the hosts host group:

Parameterize redhat_install_agent, redhat_install_host_tools, and redhat_install_host_tracer_tools.
Change default for redhat_install_agent from false to true to align with deprecation and bootstrap.py behavior.

Fixes https://projects.theforeman.org/issues/30647.

Parameterize redhat_install_agent, redhat_install_host_tools, and redhat_install_host_tracer_tools.
Change default for redhat_install_agent from false to true to align with deprecation and bootstrap.py behavior.
@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

2 similar comments
@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@tbrisker
Copy link
Member

ok to test

@ares
Copy link
Member

ares commented Aug 26, 2020

@jeffmcutter please update the commit message to also start with Fixes #30647 - so it's properly linked to redmine issue. You will also need to refresh templates snapshots, in order to make the tests pass. rake snapshots:generate should do the trick.

@jturel one more PR I'd like your consultation on. It seems reasonable to me, I wonder if katello seeds these as global params and if not, should it, so people know what they can override/fine-tune?

@jturel
Copy link
Contributor

jturel commented Aug 26, 2020

@jturel one more PR I'd like your consultation on. It seems reasonable to me, I wonder if katello seeds these as global params and if not, should it, so people know what they can override/fine-tune?

@ares it sounds like a good thing to do but I'm unfamiliar with the idea. can you point me to where/how global params are seeded in Foreman as an example?

redhat_install_host_tools = true
redhat_install_host_tracer_tools = false
redhat_install_host_tools = false if host_param_false?('redhat_install_host_tools')
redhat_install_host_tracer_tools = host_param_true?('redhat_install_host_tracer_tools')
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be consolidated like so:

redhat_install_agent = host_param_true?('redhat_install_agent', true)
redhat_install_host_tools = host_param_true?('redhat_install_host_tools', true)
redhat_install_host_tracer_tools = host_param_true?('redhat_install_host_tracer_tools')

I would prefer to continue installing katello-agent by default even though it's deprecated because I think changing the default behavior at this time would cause a bit of a headache for some.

@jturel
Copy link
Contributor

jturel commented Aug 26, 2020

I think this change needs to be made in the community-templates repo since we sync this template from there periodically: https://github.com/theforeman/community-templates/blob/develop/provisioning_templates/snippet/redhat_register.erb

@tbrisker
Copy link
Member

I think this change needs to be made in the community-templates repo since we sync this template from there periodically: https://github.com/theforeman/community-templates/blob/develop/provisioning_templates/snippet/redhat_register.erb

we no longer sync from there, the repo was archived - https://community.theforeman.org/t/provisioning-templates-testing-separate-repository/13654/49 for more details

@jturel
Copy link
Contributor

jturel commented Aug 26, 2020

I think this change needs to be made in the community-templates repo since we sync this template from there periodically: https://github.com/theforeman/community-templates/blob/develop/provisioning_templates/snippet/redhat_register.erb

we no longer sync from there, the repo was archived - https://community.theforeman.org/t/provisioning-templates-testing-separate-repository/13654/49 for more details

Wow I missed that! Thanks

@ares
Copy link
Member

ares commented Aug 27, 2020

@ares it sounds like a good thing to do but I'm unfamiliar with the idea. can you point me to where/how global params are seeded in Foreman as an example?

we don't really do that right now in core, we should though. This is how foreman_chef does it https://github.com/theforeman/foreman_chef/blob/master/db/seeds.rb#L33-L48, similarly you can take a look at the Satellite branding plugin.

@ares
Copy link
Member

ares commented Oct 7, 2020

Hello @jeffmcutter, would you mind sharing the status on this? There were several suugestion made as part of the code review. Could you please take a look or let us know, if/when you'll get back to it?

@xprazak2
Copy link
Contributor

This might be (partially) solved by #7994

@jeffmcutter
Copy link
Contributor Author

I'm afraid it's a bit over my head. If I had a more clear understanding of which comments need to be addressed, I would love to be able to contribute.

@ares
Copy link
Member

ares commented Oct 14, 2020

Thanks for the reply. I believe the agent installation has been addressed by the linked PR already. This PR only needs to be rebased and only

ruby

redhat_install_host_tools = host_param_true?('redhat_install_host_tools', true)
redhat_install_host_tracer_tools = host_param_true?('redhat_install_host_tracer_tools')

should be kept. Then I believe it's good to be merged. Please let me know if you need any further clarification. Thanks!

jturel
jturel previously approved these changes Oct 19, 2020
Copy link
Contributor

@jturel jturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ares
Copy link
Member

ares commented Oct 21, 2020

The PR is now ready, however the tests are now failing, since the template renders to a different output now. To fix that, please run the rake snapshots:generate and commit the new version of snapshots too. That should make tests green. Good to merge afterwards.

@jeffmcutter
Copy link
Contributor Author

Any thoughts on the errors I'm encountering for that?

[vagrant@centos7-katello-devel-stable-3 foreman]$ rake snapshots:generate --trace
rake aborted!
LoadError: cannot load such file -- active_support/dependencies
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/home/vagrant/foreman/config/boot.rb:7:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/home/vagrant/foreman/config/application.rb:4:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/home/vagrant/foreman/Rakefile:1:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'

Thanks,
-Jeff

@jturel
Copy link
Contributor

jturel commented Oct 22, 2020

Try bundle update and then bundle exec rake <...> which makes sure all the deps get loaded properly

@jeffmcutter
Copy link
Contributor Author

Thank you, that helped some. I have a new error now, not really sure...

[vagrant@centos7-katello-devel-stable-3 foreman]$ bundle exec rake snapshots:generate
/home/vagrant/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/home/vagrant/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
2020-10-22T14:34:38 [I|app|] Rails cache backend: File
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
/home/vagrant/foreman/app/services/facets.rb:2: warning: already initialized constant Facets::SUPPORTED_CORE_OBJECTS
/home/vagrant/foreman/app/services/facets.rb:2: warning: previous definition of SUPPORTED_CORE_OBJECTS was here
2020-10-22T14:34:42 [D|app|] Registering 5 assets for plugin foreman-tasks precompilation
2020-10-22T14:34:42 [W|app|] DEPRECATION WARNING: Initialization autoloaded the constants EncryptValue, PermissionName, UrlSchemaValidator, RegexpValidator, ArrayTypeValidator, ArrayHostnamesIpsValidator, EmailValidator, Setting, Setting::ForemanTasks, Foreman::Gettext::AllDomains, Foreman::Telemetry, Foreman::TelemetrySinks, Foreman::TelemetrySinks::MetricExporterSink, Host, Host::Hostmix, HasManyCommon, StripWhitespace, Parameterizable, Authorizable, ValidateOsFamily, PxeLoaderSupport, ParameterValidators, ScopedSearchExtensions, ParameterSearch, NoWhitespaceValidator, Foreman::Fips, PasswordCrypt, Operatingsystem, Nic, Foreman::STI, Encryptable, MacAddressValidator, SubnetsConsistencyValidator, BelongsToHostTaxonomyValidator, Nic::Base, Net::Validations, Nic::Interface, ProxyAPI, Orchestration::Task, Orchestration::Queue, Orchestration::ProgressReport, Orchestration, Orchestration::Common, Orchestration::DHCP, Orchestration::DNS, Orchestration::TFTP, SubnetsHelper, Orchestration::ExternalIPAM, DnsInterface, InterfaceCloning, Exportable, BelongsToSubnetValidator, Nic::BMC, Nic::WithAttachedDevices, Nic::Bond, Nic::Bridge, Nic::Managed, InterfaceTypeMapper, UrlValidator, Setting::General, Role, Foreman::ForemanUrlRenderer, Foreman::Controller, Foreman::Provision, Foreman::Model, DirtyAssociations, Taxonomix, ComputeResource, KeyPairComputeResource, KeyPairCapabilities, Foreman::Model::EC2, FogExtensions::AWS, FogExtensions::AWS::Flavor, FogExtensions::AWS::Server, Foreman::Model::GCE, FogExtensions::Google, FogExtensions::Google::MachineType, FogExtensions::Google::Server, ComputeResourceConsoleCommon, Foreman::Model::Libvirt, FogExtensions::Libvirt, FogExtensions::Libvirt::Server, Foreman::Model::Ovirt, FogExtensions::Ovirt, FogExtensions::Ovirt::Server, FogExtensions::Ovirt::Template, FogExtensions::Ovirt::Volume, Foreman::Model::Openstack, FogExtensions::Openstack, FogExtensions::Openstack::Core, FogExtensions::Openstack::Server, FogExtensions::Openstack::Flavor, ComputeResourceCaching, Foreman::Model::Vmware, FogExtensions::Vsphere::Server, FogExtensions::Vsphere::Folder, FogExtensions, Setting::Email, Setting::Notification, TemplateKind, PxeTemplateNameValidator, Setting::Provisioning, Setting::Puppet, Setting::Auth, SettingSelectCollection, TaxonomyCollisionFinder, TemplateTax, Ptable, Template, ProvisioningTemplate, Foreman::TelemetryHelper, Foreman::ThreadSession, UserTime, UserUsergroupCommon, TopbarCacheExpiry, JwtAuth, Foreman::Observable, Foreman::ObservableModel, User, TopbarSweeper, MediumProviders, MediumProviders::Provider, MediumProviders::Default, Facets, ForemanRegister, Facets::Base, ForemanRegister::RegistrationFacet, Facets::Entry, Facets::HostBaseEntry, FactImporter, StructuredFactImporter, PuppetFactImporter, FactParser, PuppetFactParser, DestroyFlag, Hostext, Hostext::Ownership, Facets::ModelExtensionsBase, Facets::BaseHostExtensions, PxeLoaderSuggestion, Host::Base, Hostext::PowerInterface, Hostext::Search, ConfigurationStatusScopedSearch, SmartProxyHostExtensions, Report, ConfigReport, HostStatus::ConfigurationStatus, HostStatus::BuildStatus, HostStatus::Status, HostStatus, HostStatus::Global, Hostext::SmartProxy, Hostext::Token, Hostext::OperatingSystem, Hostext::Puppetca, SelectiveClone, HostInfoExtensions, HostInfo, HostInfoProviders, HostInfo::Provider, HostInfoProviders::StaticInfo, HostInfoProviders::ConfigGroupsInfo, HostInfoProviders::PuppetInfo, HostInfoProviders::HostParamsInfo, HostParams, Facets::ManagedHostExtensions, ForemanRegister::HostExtensions, Hostext::UINotifications, PxeLoaderValidator, BelongsToProxies, HostCommon, ProxyFeaturesValidator, ProxyReferenceRegistry, SmartProxyReference, Orchestration::Compute, Orchestration::Puppetca, Orchestration::SSHProvision, Orchestration::Realm, HostTemplateHelpers, Host::Managed, PuppetHostExtensions, ForemanInternal, ForemanTasks::Task::Search, ForemanTasks::Task, Permission, ForemanTasks::RecurringLogic, Filter, Filtering, Foreman::Plugin::RoleLock, AuthSource, and AuthSourceHidden.
 | 
 | Being able to do this is deprecated. Autoloading during initialization is going
 | to be an error condition in future versions of Rails.
 | 
 | Reloading does not reboot the application, and therefore code executed during
 | initialization does not run again. So, if you reload EncryptValue, for example,
 | the expected changes won't be reflected in that stale Module object.
 | 
 | `config.autoloader` is set to `classic`. These autoloaded constants would have been unloaded if `config.autoloader` had been set to `:zeitwerk`.
 | 
 | Please, check the "Autoloading and Reloading Constants" guide for solutions.
 |  (called from <top (required)> at /home/vagrant/foreman/config/environment.rb:5)
2020-10-22T14:34:43 [W|app|] Creating scope :completer_scope. Overwriting existing method Organization.completer_scope.
2020-10-22T14:34:43 [W|app|] DEPRECATION WARNING: Controller-level `force_ssl` is deprecated and will be removed from Rails 6.1. Please enable `config.force_ssl` in your environment configuration to enable the ActionDispatch::SSL middleware to more fully enforce that your application communicate over HTTPS. If needed, you can use `config.ssl_options` to exempt matching endpoints from being redirected to HTTPS. (called from block in <module:RequireSsl> at /home/vagrant/foreman/app/controllers/concerns/foreman/controller/require_ssl.rb:7)
2020-10-22T14:34:43 [W|app|] DEPRECATION WARNING: You are using a deprecated behavior, it will be removed in version 2.5, Plugin.medium_providers is deprecated, use Plugin.medium_providers_registry instead (called from medium_providers at /home/vagrant/foreman/app/registries/foreman/plugin.rb:570)
2020-10-22T14:34:44 [W|app|] Scoped order is ignored, it's forced to be batch order.
2020-10-22T14:34:44 [W|app|] Creating scope :completer_scope. Overwriting existing method Location.completer_scope.
2020-10-22T14:34:44 [D|app|] Registering 99 assets for plugin katello precompilation
2020-10-22T14:34:44 [W|app|] DEPRECATION WARNING: Controller-level `force_ssl` is deprecated and will be removed from Rails 6.1. Please enable `config.force_ssl` in your environment configuration to enable the ActionDispatch::SSL middleware to more fully enforce that your application communicate over HTTPS. If needed, you can use `config.ssl_options` to exempt matching endpoints from being redirected to HTTPS. (called from block in <module:RequireSsl> at /home/vagrant/foreman/app/controllers/concerns/foreman/controller/require_ssl.rb:7)
This task can only be run in test environment

@jturel
Copy link
Contributor

jturel commented Oct 22, 2020

Hmm, it looks like it wants you to be in the 'test' rails environment which you can accomplish by adding RAILS_ENV=test to your command! Hopefully that's the last hurdle for you :)

@jeffmcutter
Copy link
Contributor Author

That does make sense to me, however the centos7-katello-devel forklift doesn't seem to have a test environment?

/home/vagrant/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/home/vagrant/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
/home/vagrant/foreman/app/services/facets.rb:2: warning: already initialized constant Facets::SUPPORTED_CORE_OBJECTS
/home/vagrant/foreman/app/services/facets.rb:2: warning: previous definition of SUPPORTED_CORE_OBJECTS was here
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:50:in `rescue in postgresql_connection': FATAL:  database "katello_test" does not exist
 (ActiveRecord::NoDatabaseError)
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:33:in `postgresql_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in `new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `checkout_new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in `try_to_checkout_new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in `acquire_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in `checkout'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in `connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1119:in `retrieve_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_handling.rb:221:in `retrieve_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_handling.rb:189:in `connection'
	from /home/vagrant/katello/engines/bastion_katello/lib/bastion_katello/engine.rb:13:in `block in <class:Engine>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `instance_exec'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `catch'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `block in default_terminator'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/reloader.rb:88:in `prepare!'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `instance_exec'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:228:in `block in tsort_each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:431:in `each_strongly_connected_component_from'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:349:in `block in each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `call'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:226:in `tsort_each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:205:in `tsort_each'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:60:in `run_initializers'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/application.rb:363:in `initialize!'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `public_send'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `method_missing'
	from /home/vagrant/foreman/config/environment.rb:5:in `<top (required)>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
	from -e:1:in `<main>'
[vagrant@centos7-katello-devel foreman]$ RAILS_ENV=test bundle exec bin/rake db:migrate
/home/vagrant/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/home/vagrant/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
/home/vagrant/foreman/app/services/facets.rb:2: warning: already initialized constant Facets::SUPPORTED_CORE_OBJECTS
/home/vagrant/foreman/app/services/facets.rb:2: warning: previous definition of SUPPORTED_CORE_OBJECTS was here
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:50:in `rescue in postgresql_connection': FATAL:  database "katello_test" does not exist
 (ActiveRecord::NoDatabaseError)
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:33:in `postgresql_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in `new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `checkout_new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in `try_to_checkout_new_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in `acquire_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in `checkout'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in `connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1119:in `retrieve_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_handling.rb:221:in `retrieve_connection'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_handling.rb:189:in `connection'
	from /home/vagrant/katello/engines/bastion_katello/lib/bastion_katello/engine.rb:13:in `block in <class:Engine>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `instance_exec'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `catch'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `block in default_terminator'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/reloader.rb:88:in `prepare!'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `instance_exec'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:228:in `block in tsort_each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:431:in `each_strongly_connected_component_from'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:349:in `block in each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `call'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:347:in `each_strongly_connected_component'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:226:in `tsort_each'
	from /opt/rh/rh-ruby25/root/usr/share/ruby/tsort.rb:205:in `tsort_each'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/initializable.rb:60:in `run_initializers'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/application.rb:363:in `initialize!'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `public_send'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `method_missing'
	from /home/vagrant/foreman/config/environment.rb:5:in `<top (required)>'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
	from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
	from -e:1:in `<main>'

@jturel
Copy link
Contributor

jturel commented Oct 23, 2020

It never ends!

Try bundle exec rake db:create RAILS_ENV=test

@jeffmcutter
Copy link
Contributor Author

bundle exec rake db:create RAILS_ENV=test seems to have gotten me a step or two closer. After that, I ran RAILS_ENV=test bundle exec bin/rake db:migrate successfully. Getting a new error with the snapshots:create though:

[vagrant@centos7-katello-devel foreman]$ RAILS_ENV=test bundle exec bin/rake snapshots:generate --trace
Running via Spring preloader in process 31748
** Invoke snapshots:generate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute snapshots:generate
** Invoke db:fixtures:load (first_time)
** Invoke db:load_config (first_time)
** Invoke environment 
** Execute db:load_config
** Execute db:fixtures:load
rake aborted!
ActiveRecord::RecordNotFound: Couldn't find Setting with [WHERE "settings"."name" = $1]
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/finder_methods.rb:336:in `raise_record_not_found_exception!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/finder_methods.rb:127:in `first!'
/home/vagrant/foreman/app/models/setting.rb:105:in `[]='
/home/vagrant/katello/app/models/katello/concerns/location_extensions.rb:21:in `reset_settings'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:238:in `block in halting_and_conditional'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `block in invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:470:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:47:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `block in save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:44:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:487:in `save_belongs_to_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:203:in `block in add_autosave_association_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `instance_eval'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `block in define_non_cyclic_method'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `catch'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:470:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:47:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `block in save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:44:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/associations/collection_association.rb:362:in `insert_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/associations/has_many_association.rb:36:in `insert_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:406:in `block in save_collection_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:397:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:397:in `save_collection_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:186:in `block in add_autosave_association_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `instance_eval'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `block in define_non_cyclic_method'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:238:in `block in halting_and_conditional'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `block in invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_create_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:331:in `_create_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:110:in `_create_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:905:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `block in create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:135:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:503:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:53:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `block in save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:48:in `save!'
/home/vagrant/foreman/test/factories/disable_auditing.rb:13:in `block (3 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/audited-4.9.0/lib/audited/auditor.rb:115:in `without_auditing'
/home/vagrant/foreman/test/factories/disable_auditing.rb:13:in `block (2 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/evaluation.rb:18:in `create'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:12:in `block in result'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:9:in `tap'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:9:in `result'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory.rb:43:in `run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory_runner.rb:29:in `block in run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:182:in `instrument'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory_runner.rb:28:in `run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy_syntax_method_registrar.rb:28:in `block in define_singular_strategy_method'
/home/vagrant/foreman/lib/tasks/snapshots.rake:18:in `block (3 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/generic/base.rb:16:in `cleaning'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/configuration.rb:87:in `block (2 levels) in cleaning'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/configuration.rb:88:in `cleaning'
/home/vagrant/foreman/lib/tasks/snapshots.rake:13:in `block (2 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/home/vagrant/foreman/bin/rake:9:in `<top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
-e:1:in `<main>'
Tasks: TOP => snapshots:generate
[vagrant@centos7-katello-devel foreman]$ 

Thanks!

@jturel
Copy link
Contributor

jturel commented Oct 27, 2020

We can do this. Try bundle exec rake db:seed RAILS_ENV=test

@jeffmcutter
Copy link
Contributor Author

Hmm, the db::seed seemed to run OK, but no change for the snapshots:generate.

[vagrant@centos7-katello-devel foreman]$ RAILS_ENV=test bundle exec bin/rake db:seed
/home/vagrant/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/home/vagrant/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
/home/vagrant/foreman/app/services/facets.rb:2: warning: already initialized constant Facets::SUPPORTED_CORE_OBJECTS
/home/vagrant/foreman/app/services/facets.rb:2: warning: previous definition of SUPPORTED_CORE_OBJECTS was here
Running via Spring preloader in process 2145
[vagrant@centos7-katello-devel foreman]$ RAILS_ENV=test bundle exec bin/rake snapshots:generate --trace
Running via Spring preloader in process 2162
** Invoke snapshots:generate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute snapshots:generate
** Invoke db:fixtures:load (first_time)
** Invoke db:load_config (first_time)
** Invoke environment 
** Execute db:load_config
** Execute db:fixtures:load
rake aborted!
ActiveRecord::RecordNotFound: Couldn't find Setting with [WHERE "settings"."name" = $1]
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/finder_methods.rb:336:in `raise_record_not_found_exception!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/relation/finder_methods.rb:127:in `first!'
/home/vagrant/foreman/app/models/setting.rb:105:in `[]='
/home/vagrant/katello/app/models/katello/concerns/location_extensions.rb:21:in `reset_settings'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:238:in `block in halting_and_conditional'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `block in invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:470:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:47:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `block in save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:44:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:487:in `save_belongs_to_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:203:in `block in add_autosave_association_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `instance_eval'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `block in define_non_cyclic_method'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `catch'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:201:in `block in halting'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:513:in `invoke_before'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:134:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:470:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:47:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `block in save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:314:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:44:in `save'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/associations/collection_association.rb:362:in `insert_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/associations/has_many_association.rb:36:in `insert_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:406:in `block in save_collection_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:397:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:397:in `save_collection_association'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:186:in `block in add_autosave_association_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `instance_eval'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/autosave_association.rb:158:in `block in define_non_cyclic_method'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:238:in `block in halting_and_conditional'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `block in invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:517:in `invoke_after'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_create_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:331:in `_create_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:110:in `_create_record'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:905:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `block in create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:135:in `run_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/callbacks.rb:327:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/timestamp.rb:128:in `create_or_update'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/persistence.rb:503:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/validations.rb:53:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `block in save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:212:in `transaction'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/transactions.rb:318:in `save!'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.3.4/lib/active_record/suppressor.rb:48:in `save!'
/home/vagrant/foreman/test/factories/disable_auditing.rb:13:in `block (3 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/audited-4.9.0/lib/audited/auditor.rb:115:in `without_auditing'
/home/vagrant/foreman/test/factories/disable_auditing.rb:13:in `block (2 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/evaluation.rb:18:in `create'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:12:in `block in result'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:9:in `tap'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy/create.rb:9:in `result'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory.rb:43:in `run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory_runner.rb:29:in `block in run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:182:in `instrument'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/factory_runner.rb:28:in `run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/factory_bot-5.2.0/lib/factory_bot/strategy_syntax_method_registrar.rb:28:in `block in define_singular_strategy_method'
/home/vagrant/foreman/lib/tasks/snapshots.rake:18:in `block (3 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/generic/base.rb:16:in `cleaning'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/configuration.rb:87:in `block (2 levels) in cleaning'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/database_cleaner-1.8.5/lib/database_cleaner/configuration.rb:88:in `cleaning'
/home/vagrant/foreman/lib/tasks/snapshots.rake:13:in `block (2 levels) in <top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/home/vagrant/foreman/bin/rake:9:in `<top (required)>'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
-e:1:in `<main>'
Tasks: TOP => snapshots:generate

@jturel
Copy link
Contributor

jturel commented Oct 27, 2020

I'm kinda stumped. Try hacking around it by commenting out the after_save :reset_settings line in /home/vagrant/katello/app/models/katello/concerns/location_extensions.rb

@@ -292,3 +292,4 @@ snippet: true
echo "No activation key found: Not registering"
<% end %>
<% end %>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've managed to generate the snapshots locally, looks like the only change is actually due to this extra newline. If you remove it from the commit snapshots should pass.

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tbrisker. Maybe I did that wrong. I see now that I could have committed your suggestion vs. pushing my own attempt to make that change.

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jeffmcutter and congrats on getting your first PR in Foreman! looking forward for more 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants