Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security exception occurred when try to create a tenant with deleted tenant's domain name #1878

Open
Thumimku opened this issue Dec 3, 2018 · 1 comment
Labels

Comments

@Thumimku
Copy link

Thumimku commented Dec 3, 2018

Error:
TID: [80] [] [2018-11-15 13:11:42,205] @testTenant.com [80] [IS]ERROR {org.wso2.carbon.ndatasource.core.DataSourceAxis2ConfigurationContextObserver} - Error in initializing data sources for tenant: 80 - Error in getting all data sources from repository: Illegal access attempt to cache ] owned by tenant {[testTenant.com],[79]} by tenant {[testTenant.com],[80]}

Description:
When we delete a tenant(with existing methods) we didn't the caches and the entry in globalCacheManagerMap. So when ever we try to create a new tenant with same domain name it checks with map and instead of creating new cache managers it returns existing entry value which owns by previous tenant. This is the reason for the error.

CacheManagerFactoryImpl class we have method named "close()" to shut down all the caches for a tenant, but in that method we didn't remove the entry for that particular domain from the globalCacheManagerMap.
If the entry exists after shutdown all the caches, it throws security exception when we try to create new Tenant.

Related Issues:
Since this error encountered while improving tenant deletion.
Improve Tenant Deletion via Tenant deletion Admin Service.

@Thumimku Thumimku changed the title Remove entry from globalCacheManagerMap while shutdown CacheManagers Security exception occurred when try to create a tenant with deleted tenant's domain name Dec 3, 2018
@Thumimku
Copy link
Author

Thumimku commented Dec 3, 2018

Use JDBC Tenant Manager's deleteTenant method to clear the caches
This class has method to delete a tenant. But it doesn't delete all the caches for that particular tenant. We need to improve that method to delete all caches.

We can call above close method to delete the caches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants