ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stewart Thomas J <>
Subject RE: CacheLoader returned null for key
Date Tue, 11 Apr 2017 17:22:30 GMT
That worked – thank you Rob!

From: Robert Levas []
Sent: Tuesday, April 11, 2017 11:19 AM
Subject: Re: CacheLoader returned null for key

Hi Tom…

I think I just ran into this as well. It wasn’t clear what caused it. Whether it is an Ambari
upgrade bug or whether some view was not properly removed before the upgrade – maybe related
to a stack upgrade?

In any case, check out the Ambari DB and see if there are any orphaned adminresource records.

SELECT adminresource.resource_id
 FROM adminresource LEFT OUTER JOIN viewinstance USING (resource_id)
 WHERE adminresource.resource_type_id > 5
 AND viewinstance.view_instance_id IS NULL;

If you get any records back, they are the orphaned adminresource records causing the issue.
 Once removed, you should be back in business.

You should backup your database before making any changes.  Then remove the relevant records
from the adminprivilege and adminresource tables:

delete from adminprivilege where resource_id in (<resource ids from the query above>);

delete from adminresource where resource_id in (<resource ids from the query above>);

Once the records are removed, restart Ambari and the issue should be fixed.


From: Stewart Thomas J <<>>
Reply-To: "<>" <<>>
Date: Tuesday, April 11, 2017 at 10:46 AM
To: "<>" <<>>
Subject: CacheLoader returned null for key

I upgraded to Ambari and I am getting this exception when an LDAP user tries to login.
The local admin user can login fine. My users/groups shows blank in user/group management
as well, however the users/groups tables in the Ambari database have data in them.

11 Apr 2017 09:17:39,517 ERROR [ambari-client-thread-53] ReadHandler:102 - Caught a runtime
exception executing a query$InvalidCacheLoadException: CacheLoader returned null for
key 153.
        at org.apache.ambari.server.controller.internal.UserPrivilegeResourceProvider.toResource(
        at org.apache.ambari.server.controller.internal.UserPrivilegeResourceProvider.getResources(
        at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ExtendedResourceProviderWrapper.queryForResources(
        at org.apache.ambari.server.controller.internal.ClusterControllerImpl.getResources(

I am assuming there is something mucked up in the tables, but need assistance on which ones
to investigate for this condition. That line in the code is doing:
  final ViewInstanceEntity viewInstanceEntity = viewInstanceCache.get().getUnchecked(privilegeEntity.getResource().getId())



View raw message