Project

General

Profile

Actions

Bug #36031

closed

Can't set Release Version in Activation Key

Added by Yuk! . about 1 year ago. Updated about 1 year ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Activation Key
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When I set 9 in Release Version and click Save I got:

Error
An error occurred saving the Activation Key: undefined method `library' for nil:NilClass

production.log:

2023-02-01T16:19:18 [I|app|8f0e43eb] Started PUT "/katello/api/v2/activation_keys/4?organization_id=5" for 10.201.208.30 at 2023-02-01 16:19:18 +0100
2023-02-01T16:19:18 [I|app|8f0e43eb] Processing by Katello::Api::V2::ActivationKeysController#update as HTML
2023-02-01T16:19:18 [I|app|8f0e43eb] Parameters: {"service_level"=>nil, "content_overrides"=>[{"content_label"=>"codeready-builder-for-rhel-9-x86_64-rpms", "name"=>"enabled", "value"=>"[FILTERED]"}, {"content_label"=>"rhel-9-for-x86_64-supplementary-rpms", "name"=>"enabled", "value"=>"[FILTERED]"}], "id"=>"4", "name"=>"AK-RHEL9-VMWARE", "description"=>nil, "unlimited_hosts"=>true, "auto_attach"=>true, "content_view_id"=>nil, "environment_id"=>nil, "usage_count"=>1, "user_id"=>5, "max_hosts"=>nil, "release_version"=>"9", "purpose_usage"=>nil, "purpose_role"=>nil, "organization_id"=>"5", "organization"=>{"name"=>"Sistemi Distribuiti", "label"=>"SistemiDistribuiti", "id"=>5}, "created_at"=>"2023-01-27 12:14:54 +0100", "updated_at"=>"2023-01-27 12:21:01 +0100", "content_view"=>nil, "environment"=>nil, "products"=>[], "host_collections"=>[], "purpose_addons"=>[], "permissions"=>{"view_activation_keys"=>true, "edit_activation_keys"=>true, "destroy_activation_keys"=>true}, "api_version"=>"v2", "activation_key"=>{"id"=>"4", "name"=>"AK-RHEL9-VMWARE", "description"=>nil, "organization_id"=>"5", "environment_id"=>nil, "created_at"=>"2023-01-27 12:14:54 +0100", "updated_at"=>"2023-01-27 12:21:01 +0100", "user_id"=>5, "max_hosts"=>nil, "content_view_id"=>nil, "release_version"=>"9", "unlimited_hosts"=>true, "auto_attach"=>true, "purpose_role"=>nil, "purpose_usage"=>nil, "service_level"=>nil, "purpose_addons"=>[]}}
2023-02-01T16:19:18 [E|app|8f0e43eb] NoMethodError: undefined method `library' for nil:NilClass
8f0e43eb | /usr/share/gems/gems/katello-4.7.1/app/controllers/katello/api/v2/activation_keys_controller.rb:344:in `validate_release_version'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `block in invoke_before'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `each'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:512:in `invoke_before'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:115:in `block in run_callbacks'
8f0e43eb | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
8f0e43eb | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
8f0e43eb | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
8f0e43eb | /usr/share/gems/gems/audited-5.0.2/lib/audited/sweeper.rb:16:in `around'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
8f0e43eb | /usr/share/gems/gems/audited-5.0.2/lib/audited/sweeper.rb:16:in `around'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:137:in `run_callbacks'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/abstract_controller/callbacks.rb:41:in `process_action'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal/rescue.rb:22:in `process_action'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/notifications.rb:203:in `block in instrument'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/notifications.rb:203:in `instrument'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
8f0e43eb | /usr/share/gems/gems/activerecord-6.1.7/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
8f0e43eb | /usr/share/gems/gems/katello-4.7.1/app/controllers/katello/concerns/api/api_controller.rb:50:in `process_action'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/abstract_controller/base.rb:165:in `process'
8f0e43eb | /usr/share/gems/gems/actionview-6.1.7/lib/action_view/rendering.rb:39:in `process'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal.rb:190:in `dispatch'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_controller/metal.rb:254:in `dispatch'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/route_set.rb:33:in `serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/mapper.rb:49:in `serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:50:in `block in serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:32:in `each'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:32:in `serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/route_set.rb:842:in `call'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/engine.rb:539:in `call'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/mapper.rb:49:in `serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:50:in `block in serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:32:in `each'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/journey/router.rb:32:in `serve'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/routing/route_set.rb:842:in `call'
8f0e43eb | /usr/share/gems/gems/katello-4.7.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
8f0e43eb | /usr/share/gems/gems/katello-4.7.1/lib/katello/middleware/event_daemon.rb:10:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
8f0e43eb | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/static_dispatcher.rb:68:in `call'
8f0e43eb | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/extractor/recorder.rb:137:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/static.rb:24:in `call'
8f0e43eb | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
8f0e43eb | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
8f0e43eb | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/tempfile_reaper.rb:15:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/etag.rb:27:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/conditional_get.rb:40:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/head.rb:12:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
8f0e43eb | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:266:in `context'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:260:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/cookies.rb:689:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:98:in `run_callbacks'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/rack/logger.rb:37:in `call_app'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/rack/logger.rb:28:in `call'
8f0e43eb | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
8f0e43eb | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/request_id.rb:26:in `call'
8f0e43eb | /usr/share/gems/gems/katello-4.7.1/lib/katello/prevent_json_parsing.rb:12:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/method_override.rb:24:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/runtime.rb:22:in `call'
8f0e43eb | /usr/share/gems/gems/activesupport-6.1.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/sendfile.rb:110:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/ssl.rb:77:in `call'
8f0e43eb | /usr/share/gems/gems/actionpack-6.1.7/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
8f0e43eb | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/engine.rb:539:in `call'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `public_send'
8f0e43eb | /usr/share/gems/gems/railties-6.1.7/lib/rails/railtie.rb:207:in `method_missing'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:74:in `block in call'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:58:in `each'
8f0e43eb | /usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:58:in `call'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/configuration.rb:252:in `call'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:77:in `block in handle_request'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:76:in `handle_request'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/server.rb:443:in `process_client'
8f0e43eb | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
8f0e43eb | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-02-01T16:19:18 [I|app|8f0e43eb] Completed 500 Internal Server Error in 10ms (Views: 0.3ms | ActiveRecord: 1.4ms | Allocations: 3422)


Related issues 1 (0 open1 closed)

Is duplicate of Katello - Bug #35236: Hammer Allows Invalid Release Version to be Set on Activation KeyClosedLucy FuActions
Actions #1

Updated by Partha Aji about 1 year ago

  • Status changed from New to Need more information

This is likely fixed by this PR => https://github.com/Katello/katello/pull/10414 (Redmine: https://projects.theforeman.org/issues/35236)
Can you try applying this patch on 4.7 and let us know if it solves your issue.

Actions #2

Updated by Yuk! . about 1 year ago

Partha Aji wrote:

This is likely fixed by this PR => https://github.com/Katello/katello/pull/10414 (Redmine: https://projects.theforeman.org/issues/35236)
Can you try applying this patch on 4.7 and let us know if it solves your issue.

It works! Thank you very much!

Actions #3

Updated by Ian Ballou about 1 year ago

  • Status changed from Need more information to Duplicate
  • Target version set to Katello Recycle Bin
  • Triaged changed from No to Yes
Actions #4

Updated by Ian Ballou about 1 year ago

  • Is duplicate of Bug #35236: Hammer Allows Invalid Release Version to be Set on Activation Key added
Actions

Also available in: Atom PDF