Bug 1734770
Summary: | Failure adding C&U configuration to RHV provider | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Victor Estival <vestival> | ||||
Component: | Providers | Assignee: | Roberto Ciatti <rciatti> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Nandini Chandra <nachandr> | ||||
Severity: | high | Docs Contact: | Red Hat CloudForms Documentation <cloudforms-docs> | ||||
Priority: | high | ||||||
Version: | 5.11.0 | CC: | bodnopoz, dmetzger, jfrey, jhardy, jrafanie, lavenel, mperina, nachandr, obarenbo, simaishi | ||||
Target Milestone: | GA | ||||||
Target Release: | 5.11.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | 5.11.0.18 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-12-13 14:57:13 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | Bug | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | RHEVM | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Please assess the impact of this issue and update the severity accordingly. Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition. If it's something like a tracker bug where it doesn't matter, please set the severity to Low. Actually the problem is shaded by a bug related to the use of PGError that should be updated after we switch to the version of ovirt_metrics ~> 3.0.0. But the real error message is "Credential validation was not successful: The version of PostgreSQL being connected to is incompatible with CFME (10 required)" and the cause of the bug is related to check that ManageIQ is doing when we use ActiveRecord connection. In production mode connections are restricted to version of postgres >= 10 and < 11 (thanks to Adam Grare for the hint) In this case the RHV environment is a 4.2.8 with postgresql version 9.5. We are working to identify a solution with the help also of Joe Rafaniello. Hi Victor, I do not see this issue in 5.11.0.17 while adding C&U DB credentials for RHV. I have tested this with RHV 43. After successfully validating the C&U credentials, I saw the error message reported in the BZ when I an entered incorrect passowrd while editing the credentials . "Credential validation was not successful: uninitialized constant ManageIQ::Providers::Redhat::InfraManager::ApiIntegration::PGError Could you verify if correct credentials were provided while adding the provider ? Hi Nandini, The error you reported as in my "comment 3" is due to a problem in managing the exception. The problem Victor is reporting happens in production mode on 5.11.0.17 when trying to add and RHV that has postgresql database of version under 10 (like the one Victor is trying to import). New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/b3f3f577fc11cccf7d19c8bbe406e74b2a1a6402 commit b3f3f577fc11cccf7d19c8bbe406e74b2a1a6402 Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Aug 1 16:16:00 2019 -0400 Commit: Joe Rafaniello <jrafanie> CommitDate: Thu Aug 1 16:16:00 2019 -0400 Allow ovirt to implement their own pg version check This doesn't fix the following bug but allows them to implement their own adapter that opts-out of the manageiq pg version check and instead implement their own via a check_version, something like this: ```ruby module ActiveRecord module ConnectionHandling # :nodoc: def ovirt_postgresql_connection(config) conn_params = config.symbolize_keys ...rest of the existing rails 5.1 pg adapter method until... ConnectionAdapters::OvirtPostgreSQLAdapter.new(nil, logger, conn_params, config) end end module ConnectionAdapters class OvirtPostgreSQLAdapter < PostgreSQLAdapter def check_version raise "AAAAA" if postgresql_version > XXX end end end end ``` https://bugzilla.redhat.com/show_bug.cgi?id=1734770 config/initializers/postgres_required_versions.rb | 3 + 1 file changed, 3 insertions(+) New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/493cf689e6ab227711e60e52ee1108d5b91fb012 commit 493cf689e6ab227711e60e52ee1108d5b91fb012 Author: Nick Carboni <ncarboni> AuthorDate: Fri Aug 2 16:23:53 2019 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Fri Aug 2 16:23:53 2019 -0400 Merge pull request #19090 from jrafanie/allow_ovirt_to_implement_their_own_pg_check_version Allow ovirt to implement their own pg version check (cherry picked from commit e5307965c15f1cc2eaccb26e9a4364556252eb1c) https://bugzilla.redhat.com/show_bug.cgi?id=1734770 config/initializers/postgres_required_versions.rb | 3 + 1 file changed, 3 insertions(+) New commit detected on ManageIQ/ovirt_metrics/master: https://github.com/ManageIQ/ovirt_metrics/commit/66eda042b6eb7fa0afc0e533556f2a26da7320db commit 66eda042b6eb7fa0afc0e533556f2a26da7320db Author: Roberto Ciatti <gekorob.github.com> AuthorDate: Fri Aug 2 11:11:55 2019 -0400 Commit: Roberto Ciatti <gekorob.github.com> CommitDate: Fri Aug 2 11:11:55 2019 -0400 ConnectionAdapter with check_version overriding New OvirtPostgreSQLAdapter that extends the default one adding a check_version method to override restrictions imposed by the manageiq postgresql_required_versions initializer. This modification, with the update of the initializer mentioned above should solve: https://bugzilla.redhat.com/show_bug.cgi?id=1734770 lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb | 30 + lib/ovirt_metrics.rb | 5 +- 2 files changed, 34 insertions(+), 1 deletion(-) * We'll need to cut a release of this after 19090 has been merged * We'll then need to bump the ovirt_metrics gem requirement in the gemspec/Gemfile in manageiq or the provider for backport to ivanchuk Submitted the PR https://github.com/ManageIQ/manageiq/pull/19100 with the ovirt_metrics bump to the 3.0.1. New commit detected on ManageIQ/manageiq/ivanchuk: https://github.com/ManageIQ/manageiq/commit/182b82dc8edae545dea8cb692240afca63a0884c commit 182b82dc8edae545dea8cb692240afca63a0884c Author: Joe Rafaniello <jrafanie.github.com> AuthorDate: Mon Aug 5 11:41:16 2019 -0400 Commit: Joe Rafaniello <jrafanie.github.com> CommitDate: Mon Aug 5 11:41:16 2019 -0400 Merge pull request #19100 from gekorob/ovirt_metrics_check_version Update ovirt_metrics for check_version (cherry picked from commit 62c141169452b6d24ef4c6004fe993bcc8e805b9) https://bugzilla.redhat.com/show_bug.cgi?id=1734770 Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) moving to post since the Gemfile version update was completed Verified in 5.11.0.18 The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days |
Created attachment 1595050 [details] Screenshot with the problem Description of problem: While adding a RHV provider (or editing it) information for C&U Database it fails with the message "Credential validation was not successful: uninitialized constant ManageIQ::Providers::Redhat::InfraManager::ApiIntegration::PGError Version-Release number of selected component (if applicable): 5.11.0.17 How reproducible: 100 Steps to Reproduce: 1. Add the RHV Provider 2. Add the C & Endpoint and credentials 3. Actual results: Fail Expected results: Success Additional info: