'/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]

can you execute foreman-rake db:migrate and foreman-rake db:seed manually as root and post the output here please?

Thanks for the quick response.

I ran db:migrate before when started and this is the results.

sudo /usr/sbin/foreman-rake db:migrate
rake aborted!
Sequel::Migrator::Error: Missing migration version(s) needed to migrate down to target version (current: 24, target: 20)
/usr/share/gems/gems/sequel-5.42.0/lib/sequel/extensions/migration.rb:546:in `initialize'
/usr/share/gems/gems/sequel-5.42.0/lib/sequel/extensions/migration.rb:406:in `new'
/usr/share/gems/gems/sequel-5.42.0/lib/sequel/extensions/migration.rb:406:in `run'
/usr/share/gems/gems/dynflow-1.5.0/lib/dynflow/persistence_adapters/sequel.rb:254:in `migrate_db'
/usr/share/foreman/lib/tasks/dynflow.rake:23:in `block (2 levels) in <top (required)>'
/usr/share/foreman/lib/tasks/dynflow.rake:42:in `block (2 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => dynflow:migrate
(See full trace by running task with --trace)

Then as I continued the upgrade now it is given this error.

 /usr/sbin/foreman-rake db:migrate
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.

When run db:seed this is the error.

sudo  /usr/sbin/foreman-rake db:seed
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
rake aborted!
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Setting::General'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:234:in `rescue in find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:227:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in `find_by'
/usr/share/foreman/app/services/setting_registry.rb:185:in `_find_or_new_db_record'
/usr/share/foreman/app/services/setting_registry.rb:67:in `[]='
/usr/share/foreman/app/models/setting.rb:92:in `[]='
/usr/share/foreman/lib/tasks/config.rake:175:in `block in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'

Caused by:
NameError: uninitialized constant Setting::General
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in `const_get'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in `block in constantize'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `each'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `inject'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in `constantize'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:229:in `find_sti_class'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in `discriminate_class_for_record'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in `instantiate'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block (2 levels) in find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `block in each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in `each'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `map'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in `block in find_by_sql'
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in `find_by_sql'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in `block in exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in `skip_query_cache_if_necessary'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in `exec_queries'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in `load'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in `records'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in `find_take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in `take'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in `find_by'
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in `find_by'
/usr/share/foreman/app/services/setting_registry.rb:185:in `_find_or_new_db_record'
/usr/share/foreman/app/services/setting_registry.rb:67:in `[]='
/usr/share/foreman/app/models/setting.rb:92:in `[]='
/usr/share/foreman/lib/tasks/config.rake:175:in `block in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

It is broken now, and the URL gives this error:
Oops, we’re sorry but something went wrong undefined method `minutes’ for nil:NilClass

Heh, I just edited your post to add some code blocks.

Thanks

This implies you have a plugin that is not compatible with 3.1

Can you list the plugins you have installed? (rpm -qa |grep rubygem-foreman should get a list)

rpm -qa |grep rubygem-foreman

rubygem-foreman-tasks-5.2.3-1.fm3_1.el8.noarch
rubygem-foreman_memcache-0.1.1-4.fm2_5.el8.noarch
rubygem-foreman_remote_execution-5.0.6-1.fm3_1.el8.noarch
rubygem-foreman_azure_rm-2.2.6-1.fm3_1.el8.noarch
rubygem-foreman_ansible-7.0.4-1.fm3_1.el8.noarch
rubygem-foreman_maintain-1.0.8-1.el8.noarch

I bet it’s foreman_memcache. Can you uninstall it and see if the upgrade works?
(You’ll also probably have to remove any references to memcache from the settings in /etc/foreman)

Mh, no, memcache doesn’t define any Settings outside the YAML, so it wouldn’t be affected by the changes.

(it’s still good to remove it, I know it will break with Foreman 3.4+, but that’s a different story)

removed the rubygem-foreman_memcache-0.1.1-4.fm2_5.el8.noarch
no reference to memcache in /etc/foreman/settings.yaml

Then I just ran db:seed. This is the result.

/usr/sbin/foreman-rake db:seed
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
rake aborted!
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: ‘Setting::General’. This error is raised because the column ‘category’ is reserved for storing the class in case of inheritance. Please rename this column if you didn’t intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:234:in rescue in find_sti_class' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:227:in find_sti_class’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in discriminate_class_for_record' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in instantiate’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in block (2 levels) in find_by_sql' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in block in each’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in each' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in each’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in map' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in block in find_by_sql’
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in instrument' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in find_by_sql’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in block in exec_queries' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in skip_query_cache_if_necessary’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in exec_queries' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in load’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in records' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in find_take’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in take' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in find_by’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in find_by' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in find_by’
/usr/share/foreman/app/services/setting_registry.rb:185:in _find_or_new_db_record' /usr/share/foreman/app/services/setting_registry.rb:67:in =’
/usr/share/foreman/app/models/setting.rb:92:in []=' /usr/share/foreman/lib/tasks/config.rake:175:in block in <top (required)>’
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>’

Caused by:
NameError: uninitialized constant Setting::General
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in const_get' /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:284:in block in constantize’
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in each' /usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in inject’
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/inflector/methods.rb:280:in constantize' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:229:in find_sti_class’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/inheritance.rb:215:in discriminate_class_for_record' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/persistence.rb:257:in instantiate’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in block (2 levels) in find_by_sql' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in block in each’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in each' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/result.rb:62:in each’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in map' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:58:in block in find_by_sql’
/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/notifications/instrumenter.rb:24:in instrument' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:56:in find_by_sql’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:821:in block in exec_queries' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:839:in skip_query_cache_if_necessary’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:808:in exec_queries' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:626:in load’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation.rb:250:in records' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:499:in find_take’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:98:in take' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/finder_methods.rb:81:in find_by’
/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/querying.rb:21:in find_by' /usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/core.rb:183:in find_by’
/usr/share/foreman/app/services/setting_registry.rb:185:in _find_or_new_db_record' /usr/share/foreman/app/services/setting_registry.rb:67:in =’
/usr/share/foreman/app/models/setting.rb:92:in []=' /usr/share/foreman/lib/tasks/config.rake:175:in block in <top (required)>’
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>’
Tasks: TOP => db:seed
(See full trace by running task with --trace)

Can you run a grep -r 'Setting::General' /usr/share/gems? I wonder what still references that.

Thats grep command return nothing.

And echo 'select name,category from settings;' | sudo -u postgres psql foreman?

could not change directory to "/root": Permission denied
                          name                          |         category
--------------------------------------------------------+--------------------------
 default_proxy_download_policy                          | Setting::Content
 foreman_tasks_sync_task_timeout                        | Setting::ForemanTasks
 dynflow_enable_console                                 | Setting::ForemanTasks
 dynflow_console_require_auth                           | Setting::ForemanTasks
 foreman_tasks_proxy_action_retry_count                 | Setting::ForemanTasks
 foreman_tasks_proxy_action_retry_interval              | Setting::ForemanTasks
 foreman_tasks_proxy_batch_trigger                      | Setting::ForemanTasks
 foreman_tasks_proxy_batch_size                         | Setting::ForemanTasks
 foreman_tasks_troubleshooting_url                      | Setting::ForemanTasks
 foreman_tasks_polling_multiplier                       | Setting::ForemanTasks
 orphan_protection_time                                 | Setting::Content
 remote_execution_ssh_user                              | Setting::RemoteExecution
 ansible_ssh_private_key_file                           | Setting::Ansible
 administrator                                          | Setting::General
 foreman_url                                            | Setting::General
 entries_per_page                                       | Setting::General
 fix_db_cache                                           | Setting::General
 proxy_request_timeout                                  | Setting::General
 login_text                                             | Setting::General
 failed_login_attempts_limit                            | Setting::Auth
 restrict_registered_smart_proxies                      | Setting::Auth
 require_ssl_smart_proxies                              | Setting::Auth
 trusted_hosts                                          | Setting::Auth
 login_delegation_logout_url                            | Setting::Auth
 restrict_composite_view                                | Setting::Content
 default_download_policy                                | Setting::Content
 default_redhat_download_policy                         | Setting::Content
 content_default_http_proxy                             | Setting::Content
 cdn_ssl_version                                        | Setting::Content
 katello_default_provision                              | Setting::Content
 katello_default_finish                                 | Setting::Content
 katello_default_user_data                              | Setting::Content
 katello_default_PXELinux                               | Setting::Content
 katello_default_PXEGrub                                | Setting::Content
 katello_default_PXEGrub2                               | Setting::Content
 katello_default_iPXE                                   | Setting::Content
 katello_default_ptable                                 | Setting::Content
 katello_default_kexec                                  | Setting::Content
 katello_default_atomic_provision                       | Setting::Content
 manifest_refresh_timeout                               | Setting::Content
 content_action_accept_timeout                          | Setting::Content
 content_action_finish_timeout                          | Setting::Content
 content_disconnected                                   | Setting::Content
 errata_status_installable                              | Setting::Content
 check_services_before_actions                          | Setting::Content
 foreman_proxy_content_batch_size                       | Setting::Content
 foreman_proxy_content_auto_sync                        | Setting::Content
 pulp_docker_registry_port                              | Setting::Content
 pulp_export_destination                                | Setting::Content
 local_boot_PXELinux                                    | Setting::Provisioning
 local_boot_PXEGrub                                     | Setting::Provisioning
 pulpcore_export_destination                            | Setting::Content
 pulp_client_key                                        | Setting::Content
 pulp_client_cert                                       | Setting::Content
 sync_connect_timeout                                   | Setting::Content
 unregister_delete_host                                 | Setting::Content
 register_hostname_fact                                 | Setting::Content
 expire_soon_days                                       | Setting::Content
 content_view_solve_dependencies                        | Setting::Content
 host_dmi_uuid_duplicates                               | Setting::Content
 host_profile_assume                                    | Setting::Content
 host_profile_assume_build_can_change                   | Setting::Content
 host_re_register_build_only                            | Setting::Content
 remote_execution_by_default                            | Setting::Content
 register_hostname_fact_strict_match                    | Setting::Content
 host_tasks_workers_pool_size                           | Setting::Content
 applicability_batch_size                               | Setting::Content
 autosearch_while_typing                                | Setting::Content
 autosearch_delay                                       | Setting::Content
 bulk_load_size                                         | Setting::Content
 upload_profiles_without_dynflow                        | Setting::Content
 default_location_subscribed_hosts                      | Setting::Content
 rss_enable                                             | Setting::Notification
 rss_url                                                | Setting::Notification
 ansible_post_provision_timeout                         | Setting::Ansible
 ansible_out_of_sync_disabled                           | Setting::Ansible
 ansible_inventory_template                             | Setting::Ansible
 ansible_roles_to_ignore                                | Setting::Ansible
 db_pending_seed                                        | Setting::General
 instance_id                                            | Setting::General
 default_locale                                         | Setting::General
 default_timezone                                       | Setting::General
 instance_title                                         | Setting::General
 bmc_credentials_accessible                             | Setting::Auth
 oidc_jwks_url                                          | Setting::Auth
 oidc_audience                                          | Setting::Auth
 oidc_issuer                                            | Setting::Auth
 oidc_algorithm                                         | Setting::Auth
 email_reply_address                                    | Setting::Email
 email_subject_prefix                                   | Setting::Email
 send_welcome_email                                     | Setting::Email
 delivery_method                                        | Setting::Email
 smtp_enable_starttls_auto                              | Setting::Email
 smtp_openssl_verify_mode                               | Setting::Email
 smtp_address                                           | Setting::Email
 smtp_port                                              | Setting::Email
 smtp_domain                                            | Setting::Email
 host_owner                                             | Setting::Provisioning
 root_pass                                              | Setting::Provisioning
 smtp_user_name                                         | Setting::Email
 smtp_password                                          | Setting::Email
 unattended_url                                         | Setting::Provisioning
 safemode_render                                        | Setting::Provisioning
 access_unattended_without_build                        | Setting::Provisioning
 ignore_facts_for_domain                                | Setting::Provisioning
 oauth_active                                           | Setting::Auth
 global_PXEGrub2                                        | Setting::Provisioning
 global_PXELinux                                        | Setting::Provisioning
 global_PXEGrub                                         | Setting::Provisioning
 global_iPXE                                            | Setting::Provisioning
 local_boot_PXEGrub2                                    | Setting::Provisioning
 local_boot_iPXE                                        | Setting::Provisioning
 puppet_interval                                        | Setting::Puppet
 puppet_out_of_sync_disabled                            | Setting::Puppet
 default_puppet_environment                             | Setting::Puppet
 Default_parameters_Lookup_Path                         | Setting::Puppet
 interpolate_erb_in_parameters                          | Setting::Puppet
 enc_environment                                        | Setting::Puppet
 use_uuid_for_certificates                              | Setting::Puppet
 update_environment_from_facts                          | Setting::Puppet
 update_subnets_from_facts                              | Setting::Puppet
 audits_period                                          | Setting
 host_details_ui                                        | Setting
 server_ca_file                                         | Setting
 foreman_ansible_proxy_batch_size                       | Setting
 remote_execution_fallback_proxy                        | Setting::RemoteExecution
 remote_execution_global_proxy                          | Setting::RemoteExecution
 remote_execution_effective_user                        | Setting::RemoteExecution
 remote_execution_effective_user_method                 | Setting::RemoteExecution
 remote_execution_effective_user_password               | Setting::RemoteExecution
 remote_execution_sync_templates                        | Setting::RemoteExecution
 remote_execution_ssh_port                              | Setting::RemoteExecution
 remote_execution_connect_by_ip                         | Setting::RemoteExecution
 remote_execution_connect_by_ip_prefer_ipv6             | Setting::RemoteExecution
 remote_execution_ssh_password                          | Setting::RemoteExecution
 remote_execution_ssh_key_passphrase                    | Setting::RemoteExecution
 remote_execution_workers_pool_size                     | Setting::RemoteExecution
 remote_execution_cleanup_working_dirs                  | Setting::RemoteExecution
 remote_execution_cockpit_url                           | Setting::RemoteExecution
 remote_execution_form_job_template                     | Setting::RemoteExecution
 remote_execution_job_invocation_report_template        | Setting::RemoteExecution
 ansible_connection                                     | Setting::Ansible
 ansible_winrm_server_cert_validation                   | Setting::Ansible
 ansible_verbosity                                      | Setting::Ansible
 ansible_interval                                       | Setting::Ansible
 token_duration                                         | Setting::Provisioning
 default_location                                       | Setting::Puppet
 default_organization                                   | Setting::Puppet
 host_power_status                                      | Setting::General
 http_proxy                                             | Setting::General
 http_proxy_except_list                                 | Setting::General
 lab_features                                           | Setting::General
 append_domain_name_for_hosts                           | Setting::General
 outofsync_interval                                     | Setting::General
 oauth_consumer_key                                     | Setting::Auth
 oauth_consumer_secret                                  | Setting::Auth
 oauth_map_users                                        | Setting::Auth
 ssl_certificate                                        | Setting::Auth
 ssl_ca_file                                            | Setting::Auth
 ssl_priv_key                                           | Setting::Auth
 ssl_client_dn_env                                      | Setting::Auth
 ssl_client_verify_env                                  | Setting::Auth
 ssl_client_cert_env                                    | Setting::Auth
 websockets_ssl_key                                     | Setting::Auth
 websockets_ssl_cert                                    | Setting::Auth
 websockets_encrypt                                     | Setting::Auth
 authorize_login_delegation_auth_source_user_autocreate | Setting::Auth
 authorize_login_delegation                             | Setting::Auth
 authorize_login_delegation_api                         | Setting::Auth
 idle_timeout                                           | Setting::Auth
 bcrypt_cost                                            | Setting::Auth
 smtp_authentication                                    | Setting::Email
 sendmail_arguments                                     | Setting::Email
 sendmail_location                                      | Setting::Email
 manage_puppetca                                        | Setting::Provisioning
 ignore_puppet_facts_for_provisioning                   | Setting::Provisioning
 ignored_interface_identifiers                          | Setting::Provisioning
 ignore_facts_for_operatingsystem                       | Setting::Provisioning
 query_local_nameservers                                | Setting::Provisioning
 ssh_timeout                                            | Setting::Provisioning
 libvirt_default_console_address                        | Setting::Provisioning
 update_ip_from_built_request                           | Setting::Provisioning
 use_shortname_for_vms                                  | Setting::Provisioning
 dns_timeout                                            | Setting::Provisioning
 clean_up_failed_deployment                             | Setting::Provisioning
 name_generator_type                                    | Setting::Provisioning
 default_pxe_item_global                                | Setting::Provisioning
 default_pxe_item_local                                 | Setting::Provisioning
 intermediate_ipxe_script                               | Setting::Provisioning
 destroy_vm_on_host_delete                              | Setting::Provisioning
 excluded_facts                                         | Setting::Provisioning
 maximum_structured_facts                               | Setting::Provisioning
 default_global_registration_item                       | Setting::Provisioning
 default_host_init_config_template                      | Setting::Provisioning
 update_hostgroup_from_facts                            | Setting::Puppet
 matchers_inheritance                                   | Setting::Puppet
 create_new_host_when_facts_are_uploaded                | Setting::Puppet
 create_new_host_when_report_is_uploaded                | Setting::Puppet
 location_fact                                          | Setting::Puppet
 organization_fact                                      | Setting::Puppet
 always_show_configuration_status                       | Setting::Puppet
(201 rows)

BTW: how did you edit to nice readable format when posting, as you just did to my 1st question?

The posts support mardown, so you can can “fenced code blocks”

```
your code goes here
```

Thanks

Okay, so you still have settings defined that use the Settings::General category, which is gone in 3.1.

The DB should have been updated by this migration: https://github.com/theforeman/foreman/blob/3.1-stable/db/migrate/20210915132645_general_setting_to_dsl.rb

Can you show me the output of echo 'select * from schema_migrations;' | sudo -u postgres psql foreman (That’s be quite long, sorry in advance)

Yes, it is a long one.


echo ‘select * from schema_migrations;’ | sudo -u postgres psql foreman
could not change directory to “/root”: Permission denied
version

20090714132448
20090714132449
20090715143858
20090717025820
20090718060746
20090718064254
20090720134126
20090722140138
20090722141107
20090729132209
20090730152224
20090802062223
20090804130144
20090820130541
20090905150131
20090905155444
20090907045751
20090915030726
20090916053824
20090920043521
20090920064156
20090920065522
20091012135004
20091016031017
20091022054108
20091214045923
20091219132338
20091219132839
20100115021803
20100310080727
20100325142616
20100414125652
20100416124600
20100419151910
20100523114430
20100523141204
20100524080302
20100525094200
20100601221000
20100616114400
20100625155400
20100628123400
20100629093200
20100701081235
20100822072954
20100823181036
20100914092104
20101018120548
20101018120603
20101018120621
20101019122857
20101019183859
20101103150254
20101118130026
20101121080425
20101121135521
20101122132041
20101123152150
20101123153303
20101125153351
20101130093613
20101130100315
20101202104444
20101213085232
20110117162722
20110128130239
20110213104226
20110216101848
20110301154453
20110321070954
20110327123639
20110404150043
20110407091150
20110412103238
20110417102947
20110420150600
20110613141800
20110616080444
20110617190131
20110619130336
20110628115422
20110712064120
20110712070522
20110725142054
20110801090318
20110803114134
20111124095053
20111124095054
20111124095055
20111205231500
20111227095806
20120102071633
20120110113051
20120122131037
20120126113850
20120127141602
20120311081257
20120313081913
20120502105518
20120506143325
20120509131302
20120510113417
20120521142924
20120523065531
20120529113900
20120529115814
20120604114049
20120607074318
20120612070100
20120613082125
20120620124658
20120620124659
20120621135042
20120623002052
20120624081510
20120624093958
20120624094034
20120705130038
20120824142048
20120905095532
20120905131841
20120916080843
20120916080926
20120921000313
20120921105349
20120927020752
20121003172526
20121011115320
20121015113502
20121018152459
20121026160433
20121029164911
20121101141448
20121118120028
20121118125341
20121119102104
20121210214810
20121218084123
20121219040534
20130109155024
20130121130826
20130211160200
20130228145456
20130329195742
20130409081924
20130417110127
20130418134513
20130419145808
20130430150500
20130520152000
20130520161514
20130523131455
20130530061844
20130625113217
20130725081334
20130804131949
20130813105054
20130814132531
20130908100439
20130908170524
20130924145800
20131003143143
20131014133347
20131014135042
20131014225132
20131016124255
20131017142515
20131021125612
20131021152315
20131104132542
20131107094849
20131114084718
20131114094841
20131120225132
20131122093940
20131122150434
20131122170726
20131125230654
20131127112625
20131128150357
20131202120621
20131202131847
20131202144415
20131204174455
20131205204140
20131209122644
20131212125626
20131216212502
20131216212621
20131218174203
20131223120945
20131224153518
20131224153743
20131224154836
20140110000001
20140110164135
20140115130443
20140117160939
20140123185537
20140123194519
20140128123153
20140206200439
20140212131812
20140212143454
20140212143642
20140217145303
20140217160132
20140219183342
20140219183343
20140219183345
20140222022712
20140304184854
20140305101813
20140306132108
20140310102051
20140314004243
20140318153157
20140318174203
20140318221513
20140320000449
20140320004050
20140324104010
20140325093623
20140325185413
20140404122011
20140407161817
20140407162007
20140407162059
20140409031625
20140410134234
20140411134235
20140413123650
20140414214152
20140415032811
20140415052549
20140415053029
20140418124032
20140422000001
20140423191446
20140425155126
20140429193743
20140502164009
20140502174412
20140514165842
20140522122215
20140531160506
20140610083129
20140610154745
20140610170142
20140617100300
20140623103442
20140623144932
20140624183938
20140624184401
20140626055258
20140626204657
20140626204902
20140630114339
20140705173549
20140707113214
20140707203534
20140709150428
20140710132249
20140711142510
20140716102950
20140716140436
20140716211853
20140725101621
20140728190218
20140805114754
20140807175457
20140811141742
20140813215942
20140821084214
20140826104209
20140828111505
20140901115249
20140902102858
20140908082450
20140908192300
20140910111148
20140910153654
20140912113254
20140912114124
20140912145052
20140915141937
20140928131124
20140928140206
20140928210618
20140929073150
20140929073343
20140930170628
20140930201523
20141001170628
20141003210742
20141014131912
20141015164522
20141021105446
20141023114229
20141109131448
20141110084848
20141112165600
20141112180709
20141116131324
20141117093914
20141120140051
20141124055509
20141124182205
20141203082104
20141203123206
20141204203609
20141209103005
20141210173220
20141215213720
20141217101211
20141222151001
20141225073211
20150114141626
20150114225023
20150119153452
20150127085513
20150212161904
20150224083608
20150225124617
20150225131946
20150227213850
20150312144232
20150423134004
20150428070436
20150428110835
20150505180030
20150507131145
20150508124600
20150513034751
20150514072626
20150514114044
20150514121649
20150519142008
20150521121315
20150525081931
20150602153751
20150602153753
20150602153754
20150602153755
20150602153756
20150602153757
20150603045418
20150604104449
20150605073820
20150605103059
20150606021722
20150606065713
20150611140455
20150612105614
20150612121541
20150612135546
20150613134559
20150614171717
20150616080015
20150618093433
20150622090115
20150623135424
20150705131449
20150708070742
20150708133241
20150708133242
20150708133305
20150713143226
20150714132601
20150714140850
20150714151223
20150715142649
20150717142559
20150721131324
20150728122736
20150811170401
20150812110800
20150812145900
20150813185339
20150814204140
20150817102538
20150819105725
20150826165942
20150826170004
20150826191632
20150827144500
20150827152730
20150901213759
20150902164543
20150903192731
20150907124936
20150907131503
20150908222711
20150917155300
20150923125825
20150928221648
20150930183738
20151009084350
20151013135415
20151014144004
20151015152947
20151019174035
20151022105508
20151022123457
20151025120534
20151104100257
20151109152507
20151112152108
20151116105412
20151120153254
20151120171100
20151124162300
20151203100824
20151203230940
20151210143537
20151215114631
20151217092555
20151219152536
20151219203225
20151220093801
20160108134600
20160108141144
20160111113032
20160113161916
20160113162007
20160114120200
20160114125628
20160114200145
20160118124600
20160125155108
20160127134031
20160127162711
20160129192548
20160131182301
20160201131211
20160203104056
20160203110216
20160203195736
20160211134035
20160215143900
20160222143432
20160224155909
20160225115638
20160225131917
20160228140111
20160301070319
20160302091113
20160307120453
20160308102459
20160315161936
20160317070258
20160317171813
20160323065901
20160404074723
20160404132250
20160413230128
20160414063050
20160415134454
20160415135858
20160426145517
20160505181337
20160516070529
20160520175340
20160527093031
20160530184400
20160605160933
20160605162929
20160609092110
20160613150922
20160616074718
20160617124149
20160619223332
20160626085636
20160627125310
20160701180402
20160705082036
20160706074540
20160707195442
20160715131352
20160717125402
20160719081324
20160719095445
20160719100624
20160722193256
20160725142557
20160726085358
20160727084256
20160727142242
20160727144242
20160728005028
20160728095626
20160729094457
20160802153302
20160805094233
20160808002834
20160817125655
20160818062936
20160818091420
20160831121418
20160906181923
20160907231049
20160908234510
20160914125418
20160920151810
20160922144222
20160923143611
20160924213018
20160924213020
20160924213030
20160926225841
20160927071039
20160927071147
20160927073233
20160930121245
20160930150810
20161003091412
20161003130853
20161003204325
20161006070258
20161007115719
20161014133811
20161021072346
20161026191118
20161028153131
20161031204903
20161102194100
20161122154057
20161129091049
20161209162947
20161214151548
20161227082709
20161227082721
20170110113824
20170110145641
20170112175131
20170114051758
20170118142654
20170118154134
20170122204325
20170125152421
20170127094357
20170131142526
20170201135815
20170208215148
20170209084517
20170209113134
20170213154641
20170214132230
20170220679403
20170221075203
20170221100747
20170221195674
20170222131211
20170223114114
20170223161638
20170226193446
20170228134258
20170301155205
20170306100129
20170315154334
20170316142703
20170319131341
20170321012632
20170404134531
20170405065305
20170424131346
20170523182831
20170525112713
20170604082313
20170606115344
20170608130132
20170610132326
20170613101039
20170622011347
20170629080604
20170714144125
20170718142148
20170720142145
20170815130257
20170821170915
20170821170916
20170828114310
20170911133318
20170913183848
20170920211135
20171005114442
20171010170443
20171010172724
20171011175510
20171014051810
20171016202300
20171025163149
20171026082635
20171109095957
20171110082124
20171112174357
20171112174358
20171114150937
20171114183353
20171119094913
20171120144843
20171121082256
20171121111333
20171126131104
20171129103615
20171208113210
20171211124439
20171213161035
20171214050230
20171225122601
20171231134017
20180102082705
20180103230812
20180110104432
20180111130853
20180112125015
20180117202932
20180119152210
20180119205740
20180123140634
20180129143410
20180202072115
20180202123215
20180207150921
20180207232901
20180208053256
20180216092715
20180216094550
20180218191449
20180226095631
20180227094827
20180228132500
20180305111232
20180312080251
20180322102951
20180323175122
20180326145716
20180326150339
20180326190408
20180402160223
20180403144853
20180404082603
20180410125416
20180410140909
20180411160809
20180413153126
20180417031215
20180424080702
20180502155123
20180521200848
20180601102951
20180612163403
20180612164926
20180612165011
20180613100703
20180614184822
20180618195941
20180622105300
20180625082051
20180626160422
20180628125416
20180702102759
20180705164601
20180705191153
20180705230311
20180713154128
20180715202514
20180720143228
20180724062531
20180724152638
20180725083800
20180806151925
20180806205420
20180807145652
20180807164405
20180808013432
20180814202747
20180816110716
20180816142044
20180820072858
20180821144248
20180823081502
20180828161400
20180831115634
20180903154354
20180904122343
20180904142922
20180913101042
20180917173645
20180918135943
20180920123913
20180920171008
20180920214134
20180927120509
20181001141138
20181008201422
20181017181806
20181019135324
20181023112532
20181027014323
20181101101145
20181105061336
20181116104823
20181206123910
20181206124952
20181206131436
20181206131627
20181219205642
20181224174419
20190107160723
20190108151133
20190111153330
20190116120705
20190121084601
20190122115421
20190129204844
20190205142619
20190219152921
20190221201724
20190225115728
20190226182746
20190228160047
20190305150816
20190312200644
20190318094437
20190318153925
20190326145039
20190328114657
20190404030833
20190410143011
20190510082811
20190513162209
20190604081000
20190605014649
20190617142328
20190618034438
20190619192151
20190621160800
20190627083110
20190630034751
20190701174401
20190701192616
20190702182118
20190705060630
20190708195809
20190718093321
20190723171639
20190730183518
20190730203334
20190801143210
20190814025338
20190816162733
20190821135704
20190822144300
20190829102315
20190912210927
20190918170516
20190919155550
20190923180644
20190930192813
20191001120743
20191010074208
20191017151119
20191028082812
20191118072000
20191204020703
20191204214919
20191213161248
20200102150855
20200107154252
20200107181613
20200109162354
20200112121946
20200121213430
20200127103144
20200129123555
20200129172534
20200204034123
20200205105956
20200211073049
20200213184848
20200217110708
20200304201026
20200311131527
20200311134414
20200318135632
20200324210540
20200326164755
20200402130013
20200402190048
20200406113832
20200407171926
20200421201839
20200427151946
20200429153103
20200501155054
20200506163345
20200507103900
20200511204005
20200513092446
20200514092553
20200517215015
20200519093217
20200521082853
20200525073201
20200526200422
20200602155700
20200610112009
20200611090846
20200615071719
20200616134403
20200623073022
20200625081552
20200630092207
20200701150946
20200709021250
20200709160133
20200721142707
20200818040551
20200818192230
20200820122057
20200820145217
20200825121733
20200908120905
20200910140340
20200911083030
20200914200906
20200918223816
20200929200357
20201008204114
20201012172713
20201012192035
20201021150008
20201030102020
20201119211133
20201224095619
20210114143800
20210115124508
20210119162528
20210120150019
20210122200618
20210125161911
20210128231228
20210201163238
20210208213920
20210218214048
20210224160921
20210302165636
20210309160925
20210312074713
20210317090500
20210317170111
20210318204533
20210319123300
20210322142311
20210331180353
20210401124332
20210407104300
20210409033915
20210502113529
20210512170039
20210512192745
20210525144427
20210609093404
20210610131920
20210610134000
20210624221630
20210625095042
20210628182553
20210714140440
20210720115251
20210721163730
20210728130748
20210831161843
2021051713291621250977
20200921135723
20210816100932
20210818083407
20210901081438
20210915132645
20210929132645
20190802112101
20210909140337
20210910190324
20211006161617
20211019192121
20211025181315
20211115215210
20211129200124
20211202172358
(890 rows)


So Rails thinks that migration has been applied, weird.

Anyway, let’s see if we can get you past this. You have a backup from before the upgrade, right?

Let’s manually update those settings:

echo "UPDATE settings SET category='Setting' WHERE category='Setting::General';" | sudo -u postgres psql foreman