Hi Imesh,

Some updates:

Just noticed that the jira mentions the commit id and checked, it’s there but 
it is not working. It’s worthwhile to mention that we are not using the UI but 
directly the RestApi.

I checked tenant creation using the stratos cli and it doesn’t seem to generate 
an error :

stratos> add-tenant -d cloud2.qmog.cisco.com -e [email protected] -f cloud -l 
two -p abcd1234 -u admin2
ENDPOINT_ADD_TENANT:json:{"admin":"admin2","firstName":"cloud","lastName":"two","adminPassword":"abcd1234","tenantDomain":"cloud2.qmog.cisco.com","tenantId":0,"email":"[email protected]","active":false,"createdDate":0}
url:
https://127.0.0.1:9443
Tenant added successfully: cloud2.qmog.cisco.com
stratos> list-tenants
Tenants:
+-----------------------+-----------+------------------+-----------+------------------------------+
| Domain                | Tenant ID | Email            | State     | Created 
Date                 |
+-----------------------+-----------+------------------+-----------+------------------------------+
| cloud1.qmog.cisco.com | 1         | [email protected] | De-active | Sat May 16 
16:36:55 UTC 2015 |
+-----------------------+-----------+------------------+-----------+------------------------------+
| cloud2.qmog.cisco.com | 2         | [email protected] | Active    | Sat May 16 
16:48:34 UTC 2015 |













d9ef8c4c644d5f7d86ece2e972a59fa90847ea24 :

commit d9ef8c4c644d5f7d86ece2e972a59fa90847ea24
Author: Imesh Gunaratne <[email protected]>
Date:   Fri May 15 12:08:23 2015 +0530

    Fixing tenant page field order in the web u

From: Martin Eppel (meppel)
Sent: Friday, May 15, 2015 9:29 PM
To: [email protected]
Subject: RE: Testing stratos 4.1: issue with adding a tenant ?

Hi Imesh,

Thanks for the response, I pulled the latest master:


commit 0bbd3cae7119f6ca66c1a883db5052b0fb9caf12
Author: anuruddhal <[email protected]<mailto:[email protected]>>
Date:   Fri May 15 18:19:38 2015 +0530

    Fixing cartridge category type

However, I still see the issue, which commit is supposed to fix the issue ?

ERROR: POST error from https://127.0.0.1:9443/api/tenants using {
        "admin": "admin",
        "firstname": "cloud",
        "lastname": "one",
        "adminPassword": "abcd1234",
        "tenantDomain": "cloud1.qmog.cisco.com",
        "email": "[email protected]<mailto:[email protected]>",
        "active": "true"


TID: [0] [STRATOS] [2015-05-16 04:16:59,676] DEBUG 
{org.apache.stratos.autoscaler.applications.ApplicationHolder} -  Read lock 
released
TID: [0] [STRATOS] [2015-05-16 04:17:00,017]  INFO 
{org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Mgt Console URL  : 
https://172.16.2.207:9443/carbon/
TID: [0] [STRATOS] [2015-05-16 04:17:04,246] ERROR 
{org.wso2.carbon.tenant.mgt.util.TenantMgtUtil} -  Error in adding claims to 
the user.org.wso2.carbon.user.core.UserStoreException: 
org.wso2.carbon.user.core.UserStoreException: Invalid data provided
        at 
org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager.doSetUserClaimValues(JDBCUserStoreManager.java:1845)
        at 
org.wso2.carbon.user.core.common.AbstractUserStoreManager.setUserClaimValues(AbstractUserStoreManager.java:923)
        at 
org.wso2.carbon.tenant.mgt.util.TenantMgtUtil.addClaimsToUserStoreManager(TenantMgtUtil.java:323)
        at 
org.apache.stratos.rest.endpoint.api.StratosApiV41Utils.addTenant(StratosApiV41Utils.java:2900)
        at 
org.apache.stratos.rest.endpoint.api.StratosApiV41.addTenant(StratosApiV41.java:1427)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at


Also, running the stratos unit test cases fails:

[2015-05-15 20:53:07,651]  INFO 
{org.wso2.carbon.integration.framework.utils.InputStreamHandler} -  [2015-05-15 
20:53:07,651]  INFO {org.wso2.carbon.core.init.CarbonServerManager} -  Halting 
JVM
[2015-05-15 20:53:07,652]  INFO 
{org.wso2.carbon.integration.framework.utils.ServerUtils} -  Server stopped 
successfully...

Results :

Failed tests:   
testSingleCartridgeApplication(org.apache.stratos.integration.tests.SampleApplicationsTest):
 Application is not found: [application-id] single-cartridge-app

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]


Thanks

Martin



From: Imesh Gunaratne [mailto:[email protected]]
Sent: Friday, May 15, 2015 7:56 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: Testing stratos 4.1: issue with adding a tenant ?

Hi Martin,

We fixed this isuue yesterday. Would you mind testing this on the latest commit 
revision.

Thanks

On Saturday, May 16, 2015, Martin Eppel (meppel) 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

I see an exception when a tenant is added, (however, it seems that the tenant 
is added anyway, see log snippets further down). This seems to be similar to 
the issue reported in https://issues.apache.org/jira/browse/STRATOS-1405.

POST error from https://127.0.0.1:9443/api/tenants …

Exception in stratos logs  is:

The exception is (see also attached log file) :

TID: [0] [STRATOS] [2015-05-16 00:15:24,325] DEBUG 
{org.apache.stratos.autoscaler.applications.ApplicationHolder} -  Read lock 
released
TID: [0] [STRATOS] [2015-05-16 00:15:24,680]  INFO 
{org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Mgt Console URL  : 
https://172.16.2.207:9443/carbon/
TID: [0] [STRATOS] [2015-05-16 00:15:36,143] ERROR 
{org.wso2.carbon.tenant.mgt.util.TenantMgtUtil} -  Error in adding claims to 
the user.
org.wso2.carbon.user.core.UserStoreException: 
org.wso2.carbon.user.core.UserStoreException: Invalid data provided
               at 
org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager.doSetUserClaimValues(JDBCUserStoreManager.java:1845)
               at 
org.wso2.carbon.user.core.common.AbstractUserStoreManager.setUserClaimValues(AbstractUserStoreManager.java:923)
               at 
org.wso2.carbon.tenant.mgt.util.TenantMgtUtil.addClaimsToUserStoreManager(TenantMgtUtil.java:323)
               at 
org.apache.stratos.rest.endpoint.api.StratosApiV41Utils.addTenant(StratosApiV41Utils.java:2893)
               at 
org.apache.stratos.rest.endpoint.api.StratosApiV41.addTenant(StratosApiV41.java:1426)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
               at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
               at java.lang.reflect.Method.invoke(Method.java:606)
               at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
               at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
               at 
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:194)
               at 
org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100)
               at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
               at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93)
               at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
               at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
               at 
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
               at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
               at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
               at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
               at 
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159)
               at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
               at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

However, other log entries seem to indicate the tenant was added anyway:
…
TID: [0] [STRATOS] [2015-05-16 00:17:24,123] DEBUG 
{org.apache.stratos.manager.messaging.publisher.synchronizer.TenantEventSynchronizer}
 -  Tenant found: [tenant-id] 1 [tenant-domain] 
cloud1.qmog.cisco.com<http://cloud1.qmog.cisco.com>
TID: [0] [STRATOS] [2015-05-16 00:17:24,152] DEBUG 
{org.apache.stratos.cloud.controller.messaging.publisher.TopologyEventSynchronizer}
 -  Executing topology synchronizer

…
When query e.g application status the following log messages are printed:
..
TID: [0] [STRATOS] [2015-05-16 01:07:47,265]  WARN 
{org.wso2.carbon.core.util.AnonymousSessionUtil} -  Failed to retrieve Realm 
for the inactive tenant : cloud1.qmog.cisco.com<http://cloud1.qmog.cisco.com>
TID: [0] [STRATOS] [2015-05-16 01:07:47,265] ERROR 
{org.apache.stratos.rest.endpoint.handlers.StratosAuthenticationHandler} -  
Invalid domain or unactivated tenant login
..

Any idea what might wrong or causing this and how to debug it (which debug logs 
need to be turned on) ?

Thanks

Martin


--
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Reply via email to