Hello,
I would like to update to Foreman 3.6 (hammer fix [CP] Release 4.8.2 by lfu · Pull Request #10624 · Katello/katello · GitHub ). When I run the foreman-installer command I get the following error message and the installer exits:
2023-09-11 10:32:49 [ERROR ] [root] tput: No value for $TERM and no -T specified
This happens with an repository release katello-4.8.4 -1.el8.noarch.rpm and foreman-3.6.2-1.el8.noarch.rpm.
If I use an older release with katello-4.8.0 -1.el8.noarch.rpm and foreman-3.6.1-1.el8.noarch.rpm it is working without any problems.
What’s going wrong?
Best regards,
Thomas
[root@zde01vs1888 pre_commit]# foreman-installer
2023-09-11 10:39:23 [NOTICE] [root] Loading installer configuration. This will take some time.
2023-09-11 10:39:27 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2023-09-11 10:39:27 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Checking server certificate encoding:
[OK]
Checking expiration of certificate:
[OK]
Checking expiration of CA bundle:
[OK]
Checking if server certificate has CA:TRUE flag
[OK]
Checking for private key passphrase:
[OK]
Checking to see if the private key matches the certificate:
[OK]
Checking CA bundle against the certificate file:
[OK]
Checking CA bundle size: 7
[OK]
Checking Subject Alt Name on certificate
[OK]
Checking if any Subject Alt Name on certificate matches the Subject CN
[OK]
Checking Key Usage extension on certificate for Key Encipherment
[OK]
Checking for use of shortname as CN
[OK]
2023-09-11 10:39:31 [ERROR ] [root] tput: No value for $TERM and no -T specified
ekohl
September 11, 2023, 9:19am
2
This comes from this part:
I’m not sure why it would do that. Perhaps your server doesn’t recognize your terminal?
Then another change that went into 3.6.2 is:
committed 10:23AM - 07 Jul 23 UTC
Prior to 688d0a7dc08fc78407ed84466f3b0861c3cbfc2f the execute! method
was used, … which caused the installer to exit if katello-certs-check
failed. That commit changed it to only output the error on failure, but
it no longer stopped the installer.
Fixes: 688d0a7dc08f ("Fixes #34888: Display katello-certs-check output only if error")
(cherry picked from commit 825ac84731e53da8e89cc065ef86d649c4a31ef8)
So I think the script always failed on your server, but then the installer happily continued.
Do you have a $TERM
env var set, and if so, what?
Can you run echo "$(tput setaf 1)bla"
manually without error?
Hello ekohl,
Thanks a lot for the quick response!
I have replaced “fail_and_exit(stdout_stderr)” by “log_and_say(:error, stdout_stderr, true, false)” and now the installer is working! Great!
But:
With Foreman 3.6.2 the auto discovery process fails. Its really a nightmare. Error: 422 undefined method
`[ ]´ for nil:NilClass
Foreman version: 3.6.2
Plugins:
foreman-tasks 7.2.1
foreman_ansible 11.2.0
foreman_bootdisk 21.0.4
foreman_discovery 22.0.4
foreman_remote_execution 9.1.0
katello 4.8.3
2023-09-11T13:19:13 [I|app|e234607e] Started GET "/discovered_hosts/mac00155db2ce4e/edit?utf8=%E2%9C%93&host%5Bhostgroup_id%5D=1&host%5Borganization_id%5D=1&host%5Blocation_id%5D=2&quick_submit=Create+Host" for 10.5.178.37 at 2023-09-11 13:19:13 +0200
2023-09-11T13:19:13 [I|app|e234607e] Processing by DiscoveredHostsController#edit as HTML
2023-09-11T13:19:13 [I|app|e234607e] Parameters: {"utf8"=>"✓", "host"=>{"hostgroup_id"=>"1", "organization_id"=>"1", "location_id"=>"2"}, "quick_submit"=>"Create Host", "id"=>"mac00155db2ce4e"}
2023-09-11T13:19:13 [W|app|e234607e] undefined method `[]' for nil:NilClass
2023-09-11T13:19:13 [I|app|e234607e] Backtrace for 'undefined method `[]' for nil:NilClass' error (NoMethodError): undefined method `[]' for nil:NilClass
e234607e | /usr/share/gems/gems/katello-4.8.3/app/models/katello/concerns/host_managed_extensions.rb:45:in `apply_inherited_attributes'
e234607e | /usr/share/foreman/app/models/host/managed.rb:76:in `initialize'
e234607e | /usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/persistence.rb:573:in `becomes'
e234607e | /usr/share/foreman/app/models/host/base.rb:300:in `becomes'
e234607e | /usr/share/gems/gems/foreman_discovery-22.0.4/app/services/foreman_discovery/host_converter.rb:6:in `to_managed'
e234607e | /usr/share/gems/gems/foreman_discovery-22.0.4/app/controllers/discovered_hosts_controller.rb:61:in `edit'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/base.rb:228:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
e234607e | /usr/share/gems/gems/foreman_discovery-22.0.4/app/controllers/discovered_hosts_controller.rb:328:in `skip_bullet'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/gems/gems/audited-5.3.1/lib/audited/sweeper.rb:16:in `around'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/gems/gems/audited-5.3.1/lib/audited/sweeper.rb:16:in `around'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:137:in `run_callbacks'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/callbacks.rb:41:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/notifications.rb:203:in `block in instrument'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/notifications.rb:203:in `instrument'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
e234607e | /usr/share/gems/gems/activerecord-6.1.7.4/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/base.rb:165:in `process'
e234607e | /usr/share/gems/gems/actionview-6.1.7.4/lib/action_view/rendering.rb:39:in `process'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal.rb:190:in `dispatch'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal.rb:254:in `dispatch'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/routing/route_set.rb:33:in `serve'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/journey/router.rb:50:in `block in serve'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/journey/router.rb:32:in `each'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/journey/router.rb:32:in `serve'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/routing/route_set.rb:842:in `call'
e234607e | /usr/share/gems/gems/katello-4.8.3/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
e234607e | /usr/share/gems/gems/katello-4.8.3/lib/katello/middleware/event_daemon.rb:10:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
e234607e | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/static_dispatcher.rb:68:in `call'
e234607e | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/extractor/recorder.rb:137:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/static.rb:24:in `call'
e234607e | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
e234607e | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
e234607e | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/tempfile_reaper.rb:15:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/etag.rb:27:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/conditional_get.rb:27:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/head.rb:12:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
e234607e | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/session/abstract/id.rb:266:in `context'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/session/abstract/id.rb:260:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/cookies.rb:697:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:98:in `run_callbacks'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
e234607e | /usr/share/gems/gems/railties-6.1.7.4/lib/rails/rack/logger.rb:37:in `call_app'
e234607e | /usr/share/gems/gems/railties-6.1.7.4/lib/rails/rack/logger.rb:28:in `call'
e234607e | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
e234607e | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/request_id.rb:26:in `call'
e234607e | /usr/share/gems/gems/katello-4.8.3/lib/katello/prevent_json_parsing.rb:12:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/method_override.rb:24:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/runtime.rb:22:in `call'
e234607e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/sendfile.rb:110:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/ssl.rb:77:in `call'
e234607e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
e234607e | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
e234607e | /usr/share/gems/gems/railties-6.1.7.4/lib/rails/engine.rb:539:in `call'
e234607e | /usr/share/gems/gems/railties-6.1.7.4/lib/rails/railtie.rb:207:in `public_send'
e234607e | /usr/share/gems/gems/railties-6.1.7.4/lib/rails/railtie.rb:207:in `method_missing'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:74:in `block in call'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:58:in `each'
e234607e | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:58:in `call'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/configuration.rb:252:in `call'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:77:in `block in handle_request'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:76:in `handle_request'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/server.rb:443:in `process_client'
e234607e | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
e234607e | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-09-11T13:19:13 [I|app|e234607e] Rendered common/500.html.erb within layouts/application (Duration: 1.8ms | Allocations: 888)
2023-09-11T13:19:13 [I|app|e234607e] Rendered layouts/base.html.erb (Duration: 4.2ms | Allocations: 7809)
2023-09-11T13:19:13 [I|app|e234607e] Rendered layout layouts/application.html.erb (Duration: 14.1ms | Allocations: 19965)
2023-09-11T13:19:13 [I|app|e234607e] Completed 500 Internal Server Error in 27ms (Views: 14.9ms | ActiveRecord: 1.9ms | Allocations: 25098)
ekohl
September 11, 2023, 1:20pm
5
Now I get Oops, we’re sorry but something went wrong undefined method `assign_single_environment’ for nil:NilClass
I don’t understand the error message. Operating system, host group, kickstart, etc. are defined as usual and work without any problems with Katello 4.7.
2023-09-12T08:01:40 [I|app|a285190b] Started POST "/discovered_hosts/mac00155db2ce4e/auto_provision" for 192.178.168.111 at 2023-09-12 08:01:40 +0200
2023-09-12T08:01:40 [I|app|a285190b] Processing by DiscoveredHostsController#auto_provision as HTML
2023-09-12T08:01:40 [I|app|a285190b] Parameters: {"authenticity_token"=>"k0b3aNAPUWrqilZb0Q0Wak/6MeAajL/ae70vnuZst5A0RQbRgMYSIv3jT5IEvRWR02DT0+VHsyvMHaUfzee1wg==", "id"=>"mac00155db2ce4e"}
2023-09-12T08:01:41 [I|app|a285190b] Match found for host mac00155db2ce4e (167) rule TestFedora36DiscoveryRule (1)
2023-09-12T08:01:41 [W|app|a285190b] Could not find a provider for elmer-archilla. Providers returned {"Katello::ManagedContentMediumProvider"=>["Kickstart repository was not set for host 'elmer-archilla'", "Content source was not set for host 'elmer-archilla'"], "MediumProviders::Default"=>["Operating system was not set for host 'elmer-archilla'", " medium was not set for host 'elmer-archilla'", "Invalid medium '' for ''", "Invalid architecture '' for ''"]}
2023-09-12T08:01:41 [I|app|a285190b] Hostgroup has content view and lifecycle environment assigned; using those
2023-09-12T08:01:41 [W|app|a285190b] undefined method `assign_single_environment' for nil:NilClass
2023-09-12T08:01:41 [I|app|a285190b] Backtrace for 'undefined method `assign_single_environment' for nil:NilClass' error (NoMethodError): undefined method `assign_single_environment' for nil:NilClass
With Foreman 3.6 and Katello 4.8 the hostgroup won’t save the Content View. Set the CV save it, reopen it. Lost again…
ekohl
September 12, 2023, 11:35am
8
Small note: you can use fenced code blocks (Extended Syntax | Markdown Guide ):
```
the text
```
That makes backtraces readable.
@lfu any idea what’s going on here?
1 Like
nixfu
September 12, 2023, 1:41pm
9
FYI this still exists with Foreman 3.6.2 and Katello 4.8.4 installed.
I think this might require a 4.8.5. Builds using discovery are now broken.
nixfu
September 12, 2023, 1:50pm
10
OK, just did some more checking and that fix is in the rubygem-katello. But there was never a 4.8.4 rubygem generated in the repo: Index of /katello/4.8/katello/el8/x86_64
Only rubygem-katello-4.8.3 exists in the repo, even though katello-4.8.4 exists in the repo.
Did 4.8.4 ever get fully released?
nixfu
September 13, 2023, 5:18pm
11
@tomzellner
FYI, the release team did a re-release of 4.8.4 and now all the 4.8.4 rpms are finally up on yum.theforeman.org , including the rubygem-katello-4.8.4 that had this fix.
I would update your system and see if this is fixed.
1 Like
After installing the new rpm and run foreman-installer again, the WebInterface won’t work anymore.
systemctl status httpd tells me:
AH00513: WARNING: MaxRequestWorkers of 150 is not an integer multiple of ThreadsPerChild of 16, decreasing to nearest multiple 144, for a maximum of 9 servers.
And now?
Regards,
Tom
Did the update again from the beginning. Foreman 3.5 to 3.6 incl. the current /katello/4.8/katello/el8/x86_64 repository.
I’m starting to despair. From one mistake to another… It’s really frustrating!
Oops, we’re sorry but something went wrong undefined method `assign_single_environment’ for nil:NilClass
Foreman version: 3.6.2
Plugins:
- foreman-tasks 7.2.1
- foreman_ansible 11.2.0
- foreman_bootdisk 21.0.4
- foreman_discovery 22.0.4
- foreman_remote_execution 9.1.0
- katello 4.8.4
2023-09-14T14:32:53 [I|app|9d7aae76] Started GET "/discovered_hosts/mac00155db2ce4e/edit?utf8=%E2%9C%93&host%5Bhostgroup_id%5D=1&host%5Borganization_id%5D=1&host%5Blocation_id%5D=2&quick_submit=Create+Host" for 10.5.178.37 at 2023-09-14 14:32:53 +0200
2023-09-14T14:32:53 [I|app|9d7aae76] Processing by DiscoveredHostsController#edit as HTML
2023-09-14T14:32:53 [I|app|9d7aae76] Parameters: {"utf8"=>"✓", "host"=>{"hostgroup_id"=>"1", "organization_id"=>"1", "location_id"=>"2"}, "quick_submit"=>"Create Host", "id"=>"mac00155db2ce4e"}
2023-09-14T14:32:53 [I|app|9d7aae76] Hostgroup has content view and lifecycle environment assigned; using those
2023-09-14T14:32:53 [W|app|9d7aae76] undefined method `assign_single_environment' for nil:NilClass
2023-09-14T14:32:53 [I|app|9d7aae76] Backtrace for 'undefined method `assign_single_environment' for nil:NilClass' error (NoMethodError): undefined method `assign_single_environment' for nil:NilClass
Hostgroup - ContentView problem still exists (ContentView lost after saving)