Bug 1386473 - Openshift intergration with cloudforms database error
Summary: Openshift intergration with cloudforms database error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.8.0
Assignee: Ari Zellner
QA Contact: Einat Pacifici
URL:
Whiteboard: container
Depends On:
Blocks: 1392966
TreeView+ depends on / blocked
 
Reported: 2016-10-19 05:00 UTC by tachoi
Modified: 2023-09-14 03:32 UTC (History)
11 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1392966 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:28:16 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description tachoi 2016-10-19 05:00:13 UTC
Description of problem:
1. After connecting with Openshift provider,
2. Navigating to compute --> Containers --> Pods then clicking on the filter 'namespace / Container group'
3. browser returns following
"Unexpected error encountered
Errors in Management Engine can be caused by:

① Accessing Management Engine from multiple tabs or windows of the same browser on a single machine. Close any duplicate browser sessions, then select a menu option above.
② Pressing the back button during a session. 
      Close any duplicate browser sessions, then select a menu option above.
③ An internal system error. 
      Please contact your administrator for assistance.


Error text:

PG::UndefinedColumn: ERROR: column container_groups.namespace does not exist LINE 1: ...WHERE ((container_groups.deleted_on IS NULL) AND ("container... ^ : SELECT COUNT(DISTINCT "container_groups"."id") FROM "container_groups" LEFT OUTER JOIN "container_projects" ON "container_projects"."id" = "container_groups"."container_project_id" LEFT OUTER JOIN "ext_management_systems" ON "ext_management_systems"."id" = "container_groups"."ems_id" WHERE ((container_groups.deleted_on IS NULL) AND ("container_groups"."namespace" = 'default')) [container_group/show_list]"
4. Checked log and internal db schema, there is no namespace column on container_groups table.
5. Customer lab and production is having same issue.

Version-Release number of selected component (if applicable):
CFME 5.6.2.1(Customer lab env)
CFME 5.6.0.13(Customer production env)
OpenShift version 3.3

How reproducible:
1. Connect Openshift provider
2. Navigating to compute --> Containers --> Pods then clicking on the filter 'namespace / Container group'

Steps to Reproduce:
1.
2.
3.

Actual results:
Returns unexpected error to browser with "PG::UndefinedColumn: ERROR: column container_groups.namespace does not exist" 

Expected results:
we should see info based on filter

Additional info:

Comment 2 tachoi 2016-10-19 05:02:03 UTC
Log from UI appliance
#################################
[tachoi@tachoi log]$ grep -b2 -i "PG::UndefinedColumn" production.log
284099687-[----] D, [2016-10-19T15:14:00.827768 #5368:15cd57c] DEBUG -- :   MiqUserRole Inst Including Associations (0.3ms - 1rows)
284099809-[----] D, [2016-10-19T15:14:00.835352 #5368:15cd57c] DEBUG -- :    (1.4ms)  SELECT COUNT(DISTINCT "container_groups"."id") FROM "container_groups" LEFT OUTER JOIN "container_projects" ON "container_projects"."id" = "container_groups"."container_project_id" LEFT OUTER JOIN "ext_management_systems" ON "ext_management_systems"."id" = "container_groups"."ems_id" WHERE ((container_groups.deleted_on IS NULL) AND ("container_groups"."namespace" = 'default'))
284100265:[----] F, [2016-10-19T15:14:00.836074 #5368:15cd57c] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
284100454-LINE 1: ...WHERE ((container_groups.deleted_on IS NULL) AND ("container...

Comment 3 tachoi 2016-10-19 05:04:00 UTC
Log 1.
PG::UndefinedColumn: ERROR: column container_services.namespace does not exist LINE 1
#Checked lab db table structure but couldn't find namespace column from container_services 
##################################
vmdb_production=# select * from container_services  \x\g\x
Expanded display is on.
-[ RECORD 1 ]---------------+-------------------------------------
id                          | 1
ems_ref                     | cafd4331-6e0a-11e6-8e26-00163e36e921
name                        | docker-registry
ems_created_on              | 2016-08-29 17:05:31
resource_version            | 2119
session_affinity            | ClientIP
portal_ip                   | 172.30.149.174
ems_id                      | 6
container_project_id        | 1
service_type                | ClusterIP
container_image_registry_id | 
created_on                  | 2016-10-13 00:04:27.227478

Log 2
FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
#Checked lab db table structure but couldn't find namespace column from container_groups 
##################################
vmdb_production=# select * from container_groups \x\g\x
Expanded display is on.
-[ RECORD 1 ]------------+------------------------------------------------------------------
id                       | 1
ems_ref                  | ab6485bf-90d6-11e6-afff-00163e36e921
name                     | docker-registry-1-cax1g
ems_created_on           | 2016-10-12 23:50:35
resource_version         | 3529
restart_policy           | Always
dns_policy               | ClusterFirst
ems_id                   | 6
container_node_id        | 2
last_perf_capture_on     | 
container_replicator_id  | 1
ipaddress                | 
type                     | ManageIQ::Providers::Kubernetes::ContainerManager::ContainerGroup
container_project_id     | 1
phase                    | Pending
message                  | 
reason                   | 
container_build_pod_id   | 
created_on               | 2016-10-13 00:04:26.371143
deleted_on               | 
old_ems_id               | 
old_container_project_id |

Comment 6 tachoi 2016-10-26 23:37:44 UTC
Hi Gregg

I haven't got update on this case, can you please provide update on this case?

Regards,
Taeho

Comment 7 tachoi 2016-10-31 01:28:20 UTC
Hi Ari

Do you have any update on this issue?

Regards,
Taeho

Comment 8 Ari Zellner 2016-10-31 11:15:13 UTC
Hi, Ive seen this bug before but no one managed to define whats supposed to happen when you press that filter button. I think the real solution is just to remove it entirely.

Any objections?

Comment 9 Ari Zellner 2016-10-31 14:51:04 UTC
Upstream PR: https://github.com/ManageIQ/manageiq/pull/12302

Comment 10 Federico Simoncelli 2016-11-01 11:05:47 UTC
(In reply to Ari Zellner from comment #8)
> Hi, Ive seen this bug before but no one managed to define whats supposed to
> happen when you press that filter button. I think the real solution is just
> to remove it entirely.
> 
> Any objections?

Yes I don't think it's useful as it is now (We can remove it). BTW by removing it what happens in old installations? Is this still saved in their DB (and it won't disappear)?.

Comment 11 Ari Zellner 2016-11-01 11:17:29 UTC
(In reply to Federico Simoncelli from comment #10)
> (In reply to Ari Zellner from comment #8)
> > Hi, Ive seen this bug before but no one managed to define whats supposed to
> > happen when you press that filter button. I think the real solution is just
> > to remove it entirely.
> > 
> > Any objections?
> 
> Yes I don't think it's useful as it is now (We can remove it). BTW by
> removing it what happens in old installations? Is this still saved in their
> DB (and it won't disappear)?.

Yeah, I think youre right since I just remove it from the fixtures. Whats the protocol in this case?

Comment 12 Federico Simoncelli 2016-11-02 23:21:01 UTC
(In reply to Ari Zellner from comment #11)
> Yeah, I think youre right since I just remove it from the fixtures. Whats
> the protocol in this case?

Check with Gregg T or Greg B. I am concerned with the fact that this will keep failing going forward for old installations. I think we'll have to find a solution to avoid support requests or duplicated bugs, etc.

Comment 13 tachoi 2016-11-03 23:08:15 UTC
Hi Team

customer tried the patch in comment9 but still seeing same issue. no difference has been made.

[tachoi@tachoi log]$ grep "MIQ(EvmApplication.start) EVM Startup initiated" evm.log 
[----] I, [2016-11-01T14:44:55.974259 #13405:ae5998]  INFO -- : MIQ(EvmApplication.start) EVM Startup initiated
[tachoi@tachoi log]$ grep "column container_groups.namespace does" production.log 
[----] F, [2016-11-01T13:50:04.250028 #3243:1270064] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T14:51:53.876260 #13711:12b9cb4] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T14:52:02.539753 #13703:109ce90] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T14:53:58.157242 #13703:109d3f4] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T14:59:22.690978 #13711:12b43cc] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T15:01:02.688449 #13703:109ce90] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T15:45:31.484294 #13703:109d1c4] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist
[----] F, [2016-11-01T15:46:02.699063 #13711:12b9cb4] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column container_groups.namespace does not exist

Regards,
Taeho

Comment 15 tachoi 2016-11-07 00:36:52 UTC
Hi Team

Can I have update on this request?
Customer is asking for progress on this issue

Regards,
Taeho

Comment 16 Ari Zellner 2016-11-07 12:27:37 UTC
Right now it looks like we can prevent this from happening on new installations but not solve the issue on existing installations. 
Was your customer relying on this button? we plan to remove it.

Comment 17 CFME Bot 2016-11-07 20:56:04 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/bf7399b31f956f26c03aae1c0eda63d52ada2c8f

commit bf7399b31f956f26c03aae1c0eda63d52ada2c8f
Author:     Oleg Barenboim <chessbyte>
AuthorDate: Thu Nov 3 17:40:26 2016 -0400
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 7 15:53:05 2016 -0500

    Merge pull request #12302 from zeari/remove_filters
    
    Remove filters from container `show_list` pages
    (cherry picked from commit d77f49cf860eae796645bff42f743c3257ab6188)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1386473

 db/fixtures/miq_searches.yml | 30 ------------------------------
 1 file changed, 30 deletions(-)

Comment 18 Ari Zellner 2016-11-08 11:27:59 UTC
Moving to Post.
Tae, the best I can offer is a script that will fix this on existing installations. It would be a simple process. What it would do is delete the entry from MiqSearches so that filter button wont be available any more.

Comment 21 tachoi 2016-11-10 22:54:15 UTC
Hi Ari

This is the answer from customer.
"No plans on using that button, I think it can be removed"
Please let me know, once the removal script is ready.

Regards,
Taeho

Comment 22 tachoi 2016-11-15 21:55:17 UTC
Hi Team

Any update on the removing script ?

Taeho

Comment 26 Chen 2017-01-10 01:51:44 UTC
Hi Gregg,

Thank you for your reply.

Please allow me to double check the final workaround for existing CFME.

1. Remove the related records in miq_searches.

>delete from miq_searches where name in ('default_Namespace / ContainerGroup', 'default_Namespace / ContainerService');

2. Update the db/fixtures/miq_searches.yml according to https://github.com/ManageIQ/manageiq/pull/12302/files.

Best Regards,
Chen

Comment 29 Ari Zellner 2017-02-22 10:40:30 UTC
I also cant find the old filter. I think the bug could have been on an instance that was upgraded and an old filter remained.
either way, these filters were removed and so i dont think theres a problem here.

Comment 32 Mooli Tayer 2017-04-24 08:07:41 UTC
As I understand it this error happened on pressing a button which is now removed[1].

If the button is no longer available (and other similar buttons in other pages do not cause the bug) we can treat this as verified.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1386473#c10

Comment 33 Einat Pacifici 2017-04-24 17:32:28 UTC
Verified. filter button no longer exists.

Comment 34 Red Hat Bugzilla 2023-09-14 03:32:58 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.