Bug 1786415

Summary: Changing the location of hosts to 'Default Location' on Satellite GUI gives error: "Oops, we're sorry but something went wrong Validation failed: Taxonomy has already been taken"
Product: Red Hat Satellite Reporter: Diksha Chaudhari <dchaudha>
Component: Organizations and LocationsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Shweta Singh <shwsingh>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6.0CC: afeferku, hyu, inecas, kkinge, mhulan, oezr, swachira, vijsingh
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-02 15:19:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Diksha Chaudhari 2019-12-25 04:39:10 UTC
Description of problem: Changing the location of hosts to 'Default Location' on Satellite GUI gives error: "Oops, we're sorry but something went wrong Validation failed: Taxonomy has already been taken"


Version-Release number of selected component (if applicable): 6.6.1


How reproducible: Everytime


Steps to Reproduce:
   1. Change the location of a host which is in Default location to any other location.
   --> On Satellite GUI --> Hosts --> All Hosts --> Assign location --> select location from Drop-Down list --> tick-mark 'Fix Location on Mismatch' --> Submit

   2. Now try to change the location of the same host to Default Location will result in error "Oops, we're sorry but something went wrong Validation failed: Taxonomy has already been taken".
   
   3. Inspite of the error observed the location is getting updated for the host. 
Confirmed through: # hammer host info --id=host_id
 

Actual results: Error is observed and action is still performed


Expected results: Error should not be displayed and the action should be performed. 


Additional info: Tried updating the location using hammer as well but observed that it was giving following error:
~~~~
# hammer host update --location-id=3 --id=154 --organization-id=1
Could not update the host:
  Resource host not found by id '154'
~~~

Seems that this is a regression of bug # 1679300

Comment 5 Amir 2021-05-06 09:06:47 UTC
verified.

full trace:
activerecord (6.0.3.4) lib/active_record/validations.rb:80:in `raise_validation_error' 
activerecord (6.0.3.4) lib/active_record/validations.rb:53:in `save!' 
activerecord (6.0.3.4) lib/active_record/transactions.rb:318:in `block in save!' 
activerecord (6.0.3.4) lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status' 
activerecord (6.0.3.4) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction' 
activerecord (6.0.3.4) lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction' 
activesupport (6.0.3.4) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize' 
activesupport (6.0.3.4) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt' 
activesupport (6.0.3.4) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize' 
activesupport (6.0.3.4) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt' 
activesupport (6.0.3.4) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize' 
activerecord (6.0.3.4) lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction' 
activerecord (6.0.3.4) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction' 
activerecord (6.0.3.4) lib/active_record/transactions.rb:212:in `transaction' 
activerecord (6.0.3.4) lib/active_record/transactions.rb:366:in `with_transaction_returning_status' 
activerecord (6.0.3.4) lib/active_record/transactions.rb:318:in `save!' 
activerecord (6.0.3.4) lib/active_record/suppressor.rb:48:in `save!' 
activerecord (6.0.3.4) lib/active_record/persistence.rb:55:in `create!' 
app/services/tax_host.rb:102:in `block in import_missing_ids' 
app/services/tax_host.rb:95:in `each' 
app/services/tax_host.rb:95:in `import_missing_ids' 
app/models/taxonomy.rb:61:in `import_missing_ids' 
app/controllers/concerns/foreman/controller/taxonomy_multiple.rb:43:in `update_multiple_taxonomies' 
/home/vagrant/katello/app/controllers/katello/concerns/hosts_controller_extensions.rb:35:in `update_multiple_taxonomies' 
app/controllers/concerns/foreman/controller/taxonomy_multiple.rb:25:in `update_multiple_location' 
actionpack (6.0.3.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action' 
actionpack (6.0.3.4) lib/abstract_controller/base.rb:195:in `process_action' 
actionpack (6.0.3.4) lib/action_controller/metal/rendering.rb:30:in `process_action' 
actionpack (6.0.3.4) lib/abstract_controller/callbacks.rb:42:in `block in process_action' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:112:in `block in run_callbacks' 
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
audited (4.9.0) lib/audited/sweeper.rb:14:in `around' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
audited (4.9.0) lib/audited/sweeper.rb:14:in `around' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:139:in `run_callbacks' 
actionpack (6.0.3.4) lib/abstract_controller/callbacks.rb:41:in `process_action' 
actionpack (6.0.3.4) lib/action_controller/metal/rescue.rb:22:in `process_action' 
actionpack (6.0.3.4) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action' 
activesupport (6.0.3.4) lib/active_support/notifications.rb:180:in `block in instrument' 
activesupport (6.0.3.4) lib/active_support/notifications/instrumenter.rb:24:in `instrument' 
activesupport (6.0.3.4) lib/active_support/notifications.rb:180:in `instrument' 
actionpack (6.0.3.4) lib/action_controller/metal/instrumentation.rb:32:in `process_action' 
actionpack (6.0.3.4) lib/action_controller/metal/params_wrapper.rb:245:in `process_action' 
activerecord (6.0.3.4) lib/active_record/railties/controller_runtime.rb:27:in `process_action' 
actionpack (6.0.3.4) lib/abstract_controller/base.rb:136:in `process' 
actionview (6.0.3.4) lib/action_view/rendering.rb:39:in `process' 
actionpack (6.0.3.4) lib/action_controller/metal.rb:190:in `dispatch' 
actionpack (6.0.3.4) lib/action_controller/metal.rb:254:in `dispatch' 
actionpack (6.0.3.4) lib/action_dispatch/routing/route_set.rb:50:in `dispatch' 
actionpack (6.0.3.4) lib/action_dispatch/routing/route_set.rb:33:in `serve' 
actionpack (6.0.3.4) lib/action_dispatch/journey/router.rb:49:in `block in serve' 
actionpack (6.0.3.4) lib/action_dispatch/journey/router.rb:32:in `each' 
actionpack (6.0.3.4) lib/action_dispatch/journey/router.rb:32:in `serve' 
actionpack (6.0.3.4) lib/action_dispatch/routing/route_set.rb:834:in `call' 
/home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/static.rb:126:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/static.rb:126:in `call' 
apipie-dsl (2.3.0) lib/apipie_dsl/static_dispatcher.rb:67:in `call' 
apipie-rails (0.5.18) lib/apipie/static_dispatcher.rb:66:in `call' 
bullet (6.1.2) lib/bullet/rack.rb:15:in `call' 
apipie-rails (0.5.18) lib/apipie/extractor/recorder.rb:137:in `call' 
lib/foreman/middleware/telemetry.rb:10:in `call' 
apipie-rails (0.5.18) lib/apipie/middleware/checksum_in_headers.rb:27:in `call' 
lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call' 
rack-openid (1.4.2) lib/rack/openid.rb:98:in `call' 
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call' 
rack (2.2.3) lib/rack/etag.rb:27:in `call' 
rack (2.2.3) lib/rack/conditional_get.rb:40:in `call' 
rack (2.2.3) lib/rack/head.rb:12:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/http/content_security_policy.rb:18:in `call' 
lib/foreman/middleware/logging_context_session.rb:22:in `call' 
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context' 
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/cookies.rb:648:in `call' 
activerecord (6.0.3.4) lib/active_record/migration.rb:567:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call' 
activesupport (6.0.3.4) lib/active_support/callbacks.rb:101:in `run_callbacks' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/callbacks.rb:26:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' 
railties (6.0.3.4) lib/rails/rack/logger.rb:37:in `call_app' 
railties (6.0.3.4) lib/rails/rack/logger.rb:28:in `call' 
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call' 
lib/foreman/middleware/logging_context_request.rb:11:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/request_id.rb:27:in `call' 
/home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call' 
rack (2.2.3) lib/rack/method_override.rb:24:in `call' 
rack (2.2.3) lib/rack/runtime.rb:22:in `call' 
activesupport (6.0.3.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/static.rb:126:in `call' 
rack (2.2.3) lib/rack/sendfile.rb:110:in `call' 
actionpack (6.0.3.4) lib/action_dispatch/middleware/host_authorization.rb:82:in `call' 
secure_headers (6.3.1) lib/secure_headers/middleware.rb:11:in `call' 
railties (6.0.3.4) lib/rails/engine.rb:527:in `call' 
railties (6.0.3.4) lib/rails/railtie.rb:190:in `public_send' 
railties (6.0.3.4) lib/rails/railtie.rb:190:in `method_missing' 
rack (2.2.3) lib/rack/urlmap.rb:74:in `block in call' 
rack (2.2.3) lib/rack/urlmap.rb:58:in `each' 
rack (2.2.3) lib/rack/urlmap.rb:58:in `call' 
puma (5.2.0) lib/puma/configuration.rb:247:in `call' 
puma (5.2.0) lib/puma/request.rb:76:in `block in handle_request' 
puma (5.2.0) lib/puma/thread_pool.rb:337:in `with_force_shutdown' 
puma (5.2.0) lib/puma/request.rb:75:in `handle_request' 
puma (5.2.0) lib/puma/server.rb:432:in `process_client' 
puma (5.2.0) lib/puma/thread_pool.rb:145:in `block in spawn_thread' 
logging (2.3.0) lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'

Comment 6 Ondřej Ezr 2021-05-06 11:09:17 UTC
Created redmine issue https://projects.theforeman.org/issues/32544 from this bug

Comment 11 Mike McCune 2022-07-08 17:15:31 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 12 Brad Buckingham 2022-09-02 20:09:36 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.