Imesh,

The problem is that we are seeing the issue without using the UI (as pointed 
out) and the fix included.

I checked the commit and I am not clear what has changed ?

     },
-    "required":["admin","adminPassword","email", "firstname", "lastname", 
"tenantDomain"],
+    "required":["admin","adminPassword","email", "firstName", "lastName", 
"tenantDomain"],
     "properties":{
-        "firstname": {
+        "firstName": {
             "type":"string",
-            "id": "root/firstname",
+            "id": "root/firstName",
             "default": "Frank",
             "title": "First Name",
             "name": "First Name"
         },
-        "lastname": {
+       "lastName": {
             "type":"string",
-            "id": "root/lastname",
+            "id": "root/lastName",
             "default": "Myers",
             "title": "Last Name"

From: Imesh Gunaratne [mailto:im...@apache.org]
Sent: Saturday, May 16, 2015 11:46 AM
To: dev
Cc: Shaheedur Haque (shahhaqu)
Subject: Re: Testing stratos 4.1: issue with adding a tenant ?

Hi Martin,

Yes the problem was there in the UI in the Tenant JSON schema. This was fixed 
in the following commit revision:
73d50a72a596b9d96d4889314aad07bb66ce1159

https://github.com/apache/stratos/commits/master/components/org.apache.stratos.manager.console/console/controllers/forms/schema/users/tenants.json

Thanks

On Sat, May 16, 2015 at 11:29 PM, Martin Eppel (meppel) 
<mep...@cisco.com<mailto:mep...@cisco.com>> wrote:
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<http://cloud2.qmog.cisco.com> -e 
clo...@cisco.com<mailto:clo...@cisco.com> -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<http://cloud2.qmog.cisco.com>","tenantId":0,"email":"clo...@cisco.com<mailto:clo...@cisco.com>","active":false,"createdDate":0}
url:
https://127.0.0.1:9443
Tenant added successfully: cloud2.qmog.cisco.com<http://cloud2.qmog.cisco.com>
stratos> list-tenants
Tenants:
+-----------------------+-----------+------------------+-----------+------------------------------+
| Domain                | Tenant ID | Email            | State     | Created 
Date                 |
+-----------------------+-----------+------------------+-----------+------------------------------+
| cloud1.qmog.cisco.com<http://cloud1.qmog.cisco.com> | 1         | 
clo...@cisco.com<mailto:clo...@cisco.com> | De-active | Sat May 16 16:36:55 UTC 
2015 |
+-----------------------+-----------+------------------+-----------+------------------------------+
| cloud2.qmog.cisco.com<http://cloud2.qmog.cisco.com> | 2         | 
clo...@cisco.com<mailto:clo...@cisco.com> | Active    | Sat May 16 16:48:34 UTC 
2015 |













d9ef8c4c644d5f7d86ece2e972a59fa90847ea24 :

commit d9ef8c4c644d5f7d86ece2e972a59fa90847ea24
Author: Imesh Gunaratne <im...@apache.org<mailto:im...@apache.org>>
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: dev@stratos.apache.org<mailto:dev@stratos.apache.org>
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 <anuruddha...@gmail.com<mailto:anuruddha...@gmail.com>>
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<http://cloud1.qmog.cisco.com>",
        "email": "clo...@cisco.com<mailto:clo...@cisco.com>",
        "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:im...@apache.org]
Sent: Friday, May 15, 2015 7:56 PM
To: dev@stratos.apache.org<mailto:dev@stratos.apache.org>
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) 
<mep...@cisco.com<mailto:mep...@cisco.com>> 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




--
Imesh Gunaratne

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

Reply via email to