Bug 1677744

Summary: Self Service UI: There was an error fetching this service. [object Object]
Product: Red Hat CloudForms Management Engine Reporter: Tuan <tuado>
Component: APIAssignee: drew uhlmann <duhlmann>
Status: CLOSED CURRENTRELEASE QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.9.7CC: bmidwood, dmetzger, duhlmann, hkataria, jocarter, jprause, lavenel, mpovolny, nansari, obarenbo, rmanes, simaishi, yrudman
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1702080 (view as bug list) Environment:
Last Closed: 2019-12-13 15:09:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1702080    

Comment 1 Tuan 2019-02-15 19:30:53 UTC
*** Bug 1677745 has been marked as a duplicate of this bug. ***

Comment 12 drew uhlmann 2019-02-19 16:18:04 UTC
I have three possible ideas for options at this point, barring anything Tina and GT came up with. 

1) The easy, kind of hacky solution (works but is fixing the symptom):  

changing the get_user method in the mixin to this: 

  def get_user
    if @user || User.in_my_region.find_by(:userid => userid)
      @user ||= User.in_my_region.find_by(:userid => userid).tap do |u|
        u.current_group_by_description = options[:requester_group] if options[:requester_group]
      end
    else
      @user = User.find_by(:userid => "admin")
    end
  end
  alias_method :tenant_identity, :get_user

However, the better solution to this is either 2) figuring out how we still have options[:requester_group] set to something that's linked to the user that got deleted, or 3) a complete overhaul of how we delete users (problems of this sort would be helped by changing our user deletion to be soft deletes only.) I don't know what the right solution to this is, if a quick fix is necessary, the first solution should work fine.

Comment 14 drew uhlmann 2019-02-19 20:05:51 UTC
The reproducer listed by Robb above has my changes and isn't failing, so I'm not sure what to tell you, Yuri.

Comment 17 Yuri Rudman 2019-03-22 13:42:57 UTC
PR to not allow to delete user if  he/she referred to from other models: https://github.com/ManageIQ/manageiq/pull/18472

Comment 18 Yuri Rudman 2019-04-17 18:25:21 UTC
PR to fix error: https://github.com/ManageIQ/manageiq/pull/18483

Comment 19 Yuri Rudman 2019-04-17 19:12:19 UTC
Drew, I think work around you proposed in #Comment 12 will help.

PR I referred to in #Comment 17 would not help here

Comment 21 Yuri Rudman 2019-04-22 11:07:17 UTC
PR: https://github.com/ManageIQ/manageiq/pull/18663

Comment 25 Niyaz Akhtar Ansari 2019-05-14 17:27:22 UTC
Verified in Version: 5.11.0.3.20190507174347_a77bd90