Fixes #32599 - prevent to read facts without permissions #2076
Annotations
10 errors
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_test.rb#L56
Failure: test_altered_hypervisor_id
RuntimeError: Neutered Exception ForemanTasks::TaskError: Task c4ba8509-013a-426d-8128-bcf206371ef3: ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
foreman-tasks (10.0.0) lib/foreman_tasks.rb:56:in `block in sync_task'
foreman-tasks (10.0.0) lib/foreman_tasks.rb:55:in `tap'
foreman-tasks (10.0.0) lib/foreman_tasks.rb:55:in `sync_task'
katello/test/actions/katello/host/hypervisors_test.rb:94:in `test_altered_hypervisor_id'
katello/test/support/vcr.rb:24:in `block in run'
katello/test/support/vcr.rb:23:in `run'
|
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_test.rb#L56
Failure: test_duplicate_hostname
RuntimeError: Neutered Exception ForemanTasks::TaskError: Task 401b3ee3-7864-41dc-a504-a701e94004df: ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
foreman-tasks (10.0.0) lib/foreman_tasks.rb:56:in `block in sync_task'
foreman-tasks (10.0.0) lib/foreman_tasks.rb:55:in `tap'
foreman-tasks (10.0.0) lib/foreman_tasks.rb:55:in `sync_task'
katello/test/actions/katello/host/hypervisors_test.rb:75:in `test_duplicate_hostname'
katello/test/support/vcr.rb:24:in `block in run'
katello/test/support/vcr.rb:23:in `run'
|
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_update_test.rb#L140
Failure: test_existing_hypervisor_renamed
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:181:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:32:in `block (2 levels) in run'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `each'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `block in run'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/lib/actions/katello/host/hypervisors_update.rb:18:in `run'
katello/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
katello/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
katello/app/models/katello/concerns/user_extensions.rb:21:in `cp_config'
katello/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
katello/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
katello/app/lib/actions/middleware/remote_action.rb:16:in `run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:14:in `block in run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:13:in `run'
katello/test/actions/katello/host/hypervisors_update_test.rb:141:in `block in test_existing_hypervisor_renamed'
katello/test/actions/katello/host/hypervisors_update_test.rb:140:in `test_existing_hypervisor_renamed'
|
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_update_test.rb#L29
Failure: test_handle_new_hypervisor
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:181:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:32:in `block (2 levels) in run'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `each'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `block in run'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/lib/actions/katello/host/hypervisors_update.rb:18:in `run'
katello/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
katello/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
katello/app/models/katello/concerns/user_extensions.rb:21:in `cp_config'
katello/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
katello/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
katello/app/lib/actions/middleware/remote_action.rb:16:in `run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:14:in `block in run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:13:in `run'
katello/test/actions/katello/host/hypervisors_update_test.rb:56:in `test_handle_new_hypervisor'
|
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_update_test.rb#L29
Failure: test_existing_hypervisor_no_facet
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:181:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:32:in `block (2 levels) in run'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `each'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `block in run'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/lib/actions/katello/host/hypervisors_update.rb:18:in `run'
katello/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
katello/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
katello/app/models/katello/concerns/user_extensions.rb:21:in `cp_config'
katello/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
katello/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
katello/app/lib/actions/middleware/remote_action.rb:16:in `run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:14:in `block in run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:13:in `run'
katello/test/actions/katello/host/hypervisors_update_test.rb:125:in `test_existing_hypervisor_no_facet'
|
Run rake test:katello:
katello/test/actions/katello/host/hypervisors_update_test.rb#L29
Failure: test_update_guests_hypervisor
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:181:in `update_facts'
katello/app/lib/actions/katello/host/hypervisors_update.rb:32:in `block (2 levels) in run'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `each'
katello/app/lib/actions/katello/host/hypervisors_update.rb:31:in `block in run'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/lib/actions/katello/host/hypervisors_update.rb:18:in `run'
katello/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
katello/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
katello/app/models/katello/concerns/user_extensions.rb:21:in `cp_config'
katello/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
katello/app/lib/actions/middleware/remote_action.rb:39:in `as_remote_user'
katello/app/lib/actions/middleware/remote_action.rb:16:in `run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:14:in `block in run'
foreman-tasks (10.0.0) app/lib/actions/middleware/rails_executor_wrap.rb:13:in `run'
katello/test/actions/katello/host/hypervisors_update_test.rb:86:in `test_update_guests_hypervisor'
|
Run rake test:katello:
katello/test/controllers/api/rhsm/candlepin_proxies_controller_test.rb#L473
Failure: test_0001_can update the rhel lifecycle status
Expected response to be a <200: OK>, but was a <500: Internal Server Error>
Response body: {"displayMessage":"PG::AmbiguousColumn: ERROR: column reference \"name\" is ambiguous\nLINE 1: SELECT \"name\", \"fact_values\".\"value\", \"fact_values\".\"id\" FRO...\n ^\n","errors":["PG::AmbiguousColumn: ERROR: column reference \"name\" is ambiguous\nLINE 1: SELECT \"name\", \"fact_values\".\"value\", \"fact_values\".\"id\" FRO...\n ^\n"]}.
Expected: 200
Actual: 500
|
Run rake test:katello:
katello/test/services/katello/registration_manager_test.rb#L672
Failure: test_registration_activation_key
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/services/katello/registration_manager.rb:232:in `create_in_candlepin'
katello/app/services/katello/registration_manager.rb:186:in `block in register_host'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/services/katello/registration_manager.rb:184:in `register_host'
katello/test/services/katello/registration_manager_test.rb:239:in `test_registration_activation_key'
katello/test/support/vcr.rb:24:in `block in run'
katello/test/support/vcr.rb:23:in `run'
|
Run rake test:katello:
katello/test/services/katello/registration_manager_test.rb#L672
Failure: test_registration
ActiveRecord::StatementInvalid: PG::AmbiguousColumn: ERROR: column reference "name" is ambiguous
LINE 1: SELECT "name", "fact_values"."value", "fact_values"."id" FRO...
^
app/services/fact_importer.rb:140:in `update_facts'
app/services/fact_importer.rb:42:in `block in import!'
app/services/fact_importer.rb:40:in `import!'
app/services/host_fact_importer.rb:27:in `block in import_facts'
lib/foreman/telemetry_helper.rb:28:in `telemetry_duration_histogram'
app/services/host_fact_importer.rb:26:in `import_facts'
katello/app/models/katello/host/subscription_facet.rb:212:in `update_facts'
katello/app/services/katello/registration_manager.rb:232:in `create_in_candlepin'
katello/app/services/katello/registration_manager.rb:186:in `block in register_host'
app/models/concerns/foreman/thread_session.rb:108:in `as'
app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
katello/app/services/katello/registration_manager.rb:184:in `register_host'
katello/test/services/katello/registration_manager_test.rb:219:in `test_registration'
katello/test/support/vcr.rb:24:in `block in run'
katello/test/support/vcr.rb:23:in `run'
|
Run rake test:katello:
katello/test/services/katello/registration_manager_test.rb#L127
Failure: test_registration_existing_host
unexpected invocation: #<AnyInstance:Host::Managed(id: integer, name: string, last_compile: datetime, last_report: datetime, updated_at: datetime, created_at: datetime, root_pass: text, architecture_id: integer, operatingsystem_id: integer, ptable_id: integer, medium_id: integer, build: boolean, comment: text, disk: text, installed_at: datetime, model_id: integer, hostgroup_id: integer, owner_id: integer, owner_type: string, enabled: boolean, puppet_ca_proxy_id: integer, managed: boolean, use_image: boolean, image_file: string, uuid: string, compute_resource_id: integer, puppet_proxy_id: integer, certname: string, image_id: integer, organization_id: integer, location_id: integer, type: string, otp: string, realm_id: integer, compute_profile_id: integer, provision_method: string, grub_pass: string, global_status: integer, lookup_value_matcher: string, pxe_loader: string, initiated_at: datetime, build_errors: text, creator_id: integer)>.update_candlepin_associations()
unsatisfied expectations:
- expected exactly 3 times, invoked 4 times: #<AnyInstance:Host::Managed(id: integer, name: string, last_compile: datetime, last_report: datetime, updated_at: datetime, created_at: datetime, root_pass: text, architecture_id: integer, operatingsystem_id: integer, ptable_id: integer, medium_id: integer, build: boolean, comment: text, disk: text, installed_at: datetime, model_id: integer, hostgroup_id: integer, owner_id: integer, owner_type: string, enabled: boolean, puppet_ca_proxy_id: integer, managed: boolean, use_image: boolean, image_file: string, uuid: string, compute_resource_id: integer, puppet_proxy_id: integer, certname: string, image_id: integer, organization_id: integer, location_id: integer, type: string, otp: string, realm_id: integer, compute_profile_id: integer, provision_method: string, grub_pass: string, global_status: integer, lookup_value_matcher: string, pxe_loader: string, initiated_at: datetime, build_errors: text, creator_id: integer)>.update_candlepin_associations(any_parameters)
- expected exactly once, invoked never: Katello::Resources::Candlepin::Consumer.get("fake-uuid-from-katello")
- expected exactly twice, invoked once: #<AnyInstance:Katello::Host::SubscriptionFacet(id: integer, host_id: integer, uuid: string, last_checkin: datetime, service_level: string, release_version: string, autoheal: boolean, registered_at: datetime, registered_through: string, user_id: integer, hypervisor: boolean, hypervisor_host_id: integer, purpose_usage: text, purpose_role: text, dmi_uuid: string, convert2rhel_through_foreman: integer)>.update_guests(any_parameters)
- expected exactly twice, invoked once: #<AnyInstance:Katello::Host::SubscriptionFacet(id: integer, host_id: integer, uuid: string, last_checkin: datetime, service_level: string, release_version: string, autoheal: boolean, registered_at: datetime, registered_through: string, user_id: integer, hypervisor: boolean, hypervisor_host_id: integer, purpose_usage: text, purpose_role: text, dmi_uuid: string, convert2rhel_through_foreman: integer)>.update_hypervisor(any_parameters)
satisfied expectations:
- allowed any number of times, invoked never: #<AnyInstance:Resolv::DNS>.getaddresses(any_parameters)
- allowed any number of times, invoked never: #<AnyInstance:Resolv::DNS>.getaddress(any_parameters)
- allowed any number of times, invoked never: #<AnyInstance:Resolv::DNS>.getnames(any_parameters)
- allowed any number of times, invoked never: #<AnyInstance:Resolv::DNS>.getname(any_parameters)
- allowed any number of times, invoked never: #<AnyInstance:Katello::Pulp3::Repository>.test_remote_name(any_parameters)
- allowed any number of times, invoked never: Katello::Ping.ping(any_parameters)
- allowed any number of times, invoked never: Cert::Certs.ssl_client_key(any_parameters)
- allowed any number of times, invoked never: Cert::Certs.ssl_client_cert(any_parameters)
- allowed any number of times, invoked never: Cert::Certs.ca_cert(any_parameters)
- allowed any number of times, invoked never: #<AnyInstance:PuppetFactImporter>.ensure
|
Loading