Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-08-28 Thread Chaminda Jayawardena
Hi All,

Getting same when login to APIM Store(2.0.0) as a tenant user, on Greg5.0.0
Beta testing. Attached the log here with. Is there any proper way to
overcome this?




*TID: [1] [] [2015-08-28 10:07:54,516] @tenant1.com <http://tenant1.com>
[1] [Greg]ERROR {org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO} -
Failed to add resource to path /. Referential integrity constraint
violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
REG_TENANT_ID)"; SQL statement:INSERT INTO REG_RESOURCE (REG_PATH_ID,
REG_NAME, REG_MEDIA_TYPE, REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR,
REG_LAST_UPDATED_TIME, REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?,
?, ?, ?, ?, ?, ?, ?, ?, ?) [23002-140]
{org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO}org.h2.jdbc.JdbcSQLException:
Referential integrity constraint violation: "REG_RESOURCE_FK_BY_PATH_ID:
PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES
PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL statement:INSERT INTO
REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE, REG_CREATOR,
REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME, REG_DESCRIPTION,
REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23002-140]*

On Thu, Aug 13, 2015 at 3:37 PM, Dhanuka Ranasinghe 
wrote:

> For me this Error got disappeared when the tenant got unloaded.
>
> *Dhanuka Ranasinghe*
>
> Senior Software Engineer
> WSO2 Inc. ; http://wso2.com
> lean . enterprise . middleware
>
> phone : +94 715381915
>
> On Wed, Aug 12, 2015 at 10:00 PM, Evanthika Amarasiri 
> wrote:
>
>> We have missed this email. Sorry about it. We will provide logs tomorrow
>> after trying out the scenario once again.
>>
>> Regards,
>> Evanthika Amarasiri
>> Senior Technical Lead  - Quality Assurance
>> Mobile: +94773125935
>> Blog: evanthika.blogspot.com
>>
>> wso2.com lean.enterprise.middleware
>>
>> On Wed, Aug 12, 2015 at 7:55 PM, KasunG Gajasinghe 
>> wrote:
>>
>>> Hi,
>>>
>>> Did we get these logs? We'd like to have a look at it.
>>>
>>> Thanks
>>>
>>> On Thu, Jun 18, 2015 at 6:21 AM, Evanthika Amarasiri >> > wrote:
>>>
>>>> Hello Senaka,
>>>>
>>>> On Thursday, June 18, 2015, Senaka Fernando  wrote:
>>>>
>>>>> Hi Evanthika,
>>>>>
>>>>> Oh! after all these years, :). I believe we can forget about this and
>>>>> you'll not get it for the next 2 years? :).
>>>>>
>>>>> I doubt it :)
>>>>
>>>>
>>>>> Anyway lets see what can be done here. Can you'll please do a favor?
>>>>> Can you'll turn on the JDBC logs (with the log4jdbc driver) and then share
>>>>> those log files please? As Sumedha said last, we'll need to see what gets
>>>>> passed onto the DB when this happens and logs can give a lot of insight.
>>>>>
>>>> Sure. We'll do that and share the logs with you.
>>>>
>>>> Regards,
>>>> Evanthika
>>>>
>>>>
>>>>> Thanks,
>>>>> Senaka.
>>>>>
>>>>> On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri <
>>>>> evanth...@wso2.com> wrote:
>>>>>
>>>>>> Observed the same issue with AM 1.9.0 packs today when the local DBs
>>>>>> were pointed to H2 (with absolute paths). Any reason why this is 
>>>>>> happening?
>>>>>>
>>>>>> Regards,
>>>>>> Evanthika
>>>>>>
>>>>>> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe >>>>> > wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> The same error could be reproduced on the ESB 4.9.0 Test setup (1
>>>>>>> Manager and 2 worker nodes fronted by Nginx, DB - Oracle ) when 
>>>>>>> invoking a
>>>>>>> proxy service.
>>>>>>>
>>>>>>> When the issue was reproduced
>>>>>>> 1. The local registry was pointed to the default H2 DB
>>>>>>> 2. Database URL was defined with the absolute path as suggested
>>>>>>> under [1]
>>>>>>>
>>>>>>> Could get rid of the error by pointing the local registry to an
>>>>>>> Oracle DB as suggested in this thread
>>>>

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-08-13 Thread Dhanuka Ranasinghe
For me this Error got disappeared when the tenant got unloaded.

*Dhanuka Ranasinghe*

Senior Software Engineer
WSO2 Inc. ; http://wso2.com
lean . enterprise . middleware

phone : +94 715381915

On Wed, Aug 12, 2015 at 10:00 PM, Evanthika Amarasiri 
wrote:

> We have missed this email. Sorry about it. We will provide logs tomorrow
> after trying out the scenario once again.
>
> Regards,
> Evanthika Amarasiri
> Senior Technical Lead  - Quality Assurance
> Mobile: +94773125935
> Blog: evanthika.blogspot.com
>
> wso2.com lean.enterprise.middleware
>
> On Wed, Aug 12, 2015 at 7:55 PM, KasunG Gajasinghe 
> wrote:
>
>> Hi,
>>
>> Did we get these logs? We'd like to have a look at it.
>>
>> Thanks
>>
>> On Thu, Jun 18, 2015 at 6:21 AM, Evanthika Amarasiri 
>> wrote:
>>
>>> Hello Senaka,
>>>
>>> On Thursday, June 18, 2015, Senaka Fernando  wrote:
>>>
>>>> Hi Evanthika,
>>>>
>>>> Oh! after all these years, :). I believe we can forget about this and
>>>> you'll not get it for the next 2 years? :).
>>>>
>>>> I doubt it :)
>>>
>>>
>>>> Anyway lets see what can be done here. Can you'll please do a favor?
>>>> Can you'll turn on the JDBC logs (with the log4jdbc driver) and then share
>>>> those log files please? As Sumedha said last, we'll need to see what gets
>>>> passed onto the DB when this happens and logs can give a lot of insight.
>>>>
>>> Sure. We'll do that and share the logs with you.
>>>
>>> Regards,
>>> Evanthika
>>>
>>>
>>>> Thanks,
>>>> Senaka.
>>>>
>>>> On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri <
>>>> evanth...@wso2.com> wrote:
>>>>
>>>>> Observed the same issue with AM 1.9.0 packs today when the local DBs
>>>>> were pointed to H2 (with absolute paths). Any reason why this is 
>>>>> happening?
>>>>>
>>>>> Regards,
>>>>> Evanthika
>>>>>
>>>>> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> The same error could be reproduced on the ESB 4.9.0 Test setup (1
>>>>>> Manager and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking 
>>>>>> a
>>>>>> proxy service.
>>>>>>
>>>>>> When the issue was reproduced
>>>>>> 1. The local registry was pointed to the default H2 DB
>>>>>> 2. Database URL was defined with the absolute path as suggested under
>>>>>> [1]
>>>>>>
>>>>>> Could get rid of the error by pointing the local registry to an
>>>>>> Oracle DB as suggested in this thread
>>>>>>
>>>>>>
>>>>>> [1] https://wso2.org/jira/browse/CARBON-14224
>>>>>>
>>>>>> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri <
>>>>>> evanth...@wso2.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> Evanthika Amarasiri
>>>>>>> Senior Technical Lead  - Quality Assurance
>>>>>>> Mobile: +94773125935
>>>>>>> Blog: evanthika.blogspot.com
>>>>>>>
>>>>>>> wso2.com lean.enterprise.middleware
>>>>>>>
>>>>>>> -- Forwarded message --
>>>>>>> From: Senaka Fernando 
>>>>>>> Date: Tue, Sep 10, 2013 at 4:25 PM
>>>>>>> Subject: Re: [Dev] Getting a Constraint Violation Exception when
>>>>>>> invoking an API in the gateway worker
>>>>>>> To: Sumedha Rubasinghe 
>>>>>>> Cc: Evanthika Amarasiri , WSO2 Developers' List
>>>>>>> 
>>>>>>>
>>>>>>>
>>>>>>> Hi Sumedha,
>>>>>>>
>>>>>>> Yes, but why would this work on one DB and not on another? That's
>>>>>>> what's puzzling.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Senaka.
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe <
>>

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-08-12 Thread Evanthika Amarasiri
We have missed this email. Sorry about it. We will provide logs tomorrow
after trying out the scenario once again.

Regards,
Evanthika Amarasiri
Senior Technical Lead  - Quality Assurance
Mobile: +94773125935
Blog: evanthika.blogspot.com

wso2.com lean.enterprise.middleware

On Wed, Aug 12, 2015 at 7:55 PM, KasunG Gajasinghe  wrote:

> Hi,
>
> Did we get these logs? We'd like to have a look at it.
>
> Thanks
>
> On Thu, Jun 18, 2015 at 6:21 AM, Evanthika Amarasiri 
> wrote:
>
>> Hello Senaka,
>>
>> On Thursday, June 18, 2015, Senaka Fernando  wrote:
>>
>>> Hi Evanthika,
>>>
>>> Oh! after all these years, :). I believe we can forget about this and
>>> you'll not get it for the next 2 years? :).
>>>
>>> I doubt it :)
>>
>>
>>> Anyway lets see what can be done here. Can you'll please do a favor? Can
>>> you'll turn on the JDBC logs (with the log4jdbc driver) and then share
>>> those log files please? As Sumedha said last, we'll need to see what gets
>>> passed onto the DB when this happens and logs can give a lot of insight.
>>>
>> Sure. We'll do that and share the logs with you.
>>
>> Regards,
>> Evanthika
>>
>>
>>> Thanks,
>>> Senaka.
>>>
>>> On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri >> > wrote:
>>>
>>>> Observed the same issue with AM 1.9.0 packs today when the local DBs
>>>> were pointed to H2 (with absolute paths). Any reason why this is happening?
>>>>
>>>> Regards,
>>>> Evanthika
>>>>
>>>> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> The same error could be reproduced on the ESB 4.9.0 Test setup (1
>>>>> Manager and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a
>>>>> proxy service.
>>>>>
>>>>> When the issue was reproduced
>>>>> 1. The local registry was pointed to the default H2 DB
>>>>> 2. Database URL was defined with the absolute path as suggested under
>>>>> [1]
>>>>>
>>>>> Could get rid of the error by pointing the local registry to an Oracle
>>>>> DB as suggested in this thread
>>>>>
>>>>>
>>>>> [1] https://wso2.org/jira/browse/CARBON-14224
>>>>>
>>>>> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri <
>>>>> evanth...@wso2.com> wrote:
>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Evanthika Amarasiri
>>>>>> Senior Technical Lead  - Quality Assurance
>>>>>> Mobile: +94773125935
>>>>>> Blog: evanthika.blogspot.com
>>>>>>
>>>>>> wso2.com lean.enterprise.middleware
>>>>>>
>>>>>> -- Forwarded message --
>>>>>> From: Senaka Fernando 
>>>>>> Date: Tue, Sep 10, 2013 at 4:25 PM
>>>>>> Subject: Re: [Dev] Getting a Constraint Violation Exception when
>>>>>> invoking an API in the gateway worker
>>>>>> To: Sumedha Rubasinghe 
>>>>>> Cc: Evanthika Amarasiri , WSO2 Developers' List <
>>>>>> dev@wso2.org>
>>>>>>
>>>>>>
>>>>>> Hi Sumedha,
>>>>>>
>>>>>> Yes, but why would this work on one DB and not on another? That's
>>>>>> what's puzzling.
>>>>>>
>>>>>> Thanks,
>>>>>> Senaka.
>>>>>>
>>>>>>
>>>>>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe <
>>>>>> sume...@wso2.com> wrote:
>>>>>>
>>>>>>> We should take a look @ data going into the insert & decide if those
>>>>>>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> Now that's a convincing issue as to H2 not having proper stability.
>>>>>>>> If this is consistently reproducible, we should probably get in contact
>>&

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-08-12 Thread KasunG Gajasinghe
Hi,

Did we get these logs? We'd like to have a look at it.

Thanks

On Thu, Jun 18, 2015 at 6:21 AM, Evanthika Amarasiri 
wrote:

> Hello Senaka,
>
> On Thursday, June 18, 2015, Senaka Fernando  wrote:
>
>> Hi Evanthika,
>>
>> Oh! after all these years, :). I believe we can forget about this and
>> you'll not get it for the next 2 years? :).
>>
>> I doubt it :)
>
>
>> Anyway lets see what can be done here. Can you'll please do a favor? Can
>> you'll turn on the JDBC logs (with the log4jdbc driver) and then share
>> those log files please? As Sumedha said last, we'll need to see what gets
>> passed onto the DB when this happens and logs can give a lot of insight.
>>
> Sure. We'll do that and share the logs with you.
>
> Regards,
> Evanthika
>
>
>> Thanks,
>> Senaka.
>>
>> On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri 
>> wrote:
>>
>>> Observed the same issue with AM 1.9.0 packs today when the local DBs
>>> were pointed to H2 (with absolute paths). Any reason why this is happening?
>>>
>>> Regards,
>>> Evanthika
>>>
>>> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe 
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> The same error could be reproduced on the ESB 4.9.0 Test setup (1
>>>> Manager and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a
>>>> proxy service.
>>>>
>>>> When the issue was reproduced
>>>> 1. The local registry was pointed to the default H2 DB
>>>> 2. Database URL was defined with the absolute path as suggested under
>>>> [1]
>>>>
>>>> Could get rid of the error by pointing the local registry to an Oracle
>>>> DB as suggested in this thread
>>>>
>>>>
>>>> [1] https://wso2.org/jira/browse/CARBON-14224
>>>>
>>>> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri <
>>>> evanth...@wso2.com> wrote:
>>>>
>>>>>
>>>>> Regards,
>>>>> Evanthika Amarasiri
>>>>> Senior Technical Lead  - Quality Assurance
>>>>> Mobile: +94773125935
>>>>> Blog: evanthika.blogspot.com
>>>>>
>>>>> wso2.com lean.enterprise.middleware
>>>>>
>>>>> -- Forwarded message --
>>>>> From: Senaka Fernando 
>>>>> Date: Tue, Sep 10, 2013 at 4:25 PM
>>>>> Subject: Re: [Dev] Getting a Constraint Violation Exception when
>>>>> invoking an API in the gateway worker
>>>>> To: Sumedha Rubasinghe 
>>>>> Cc: Evanthika Amarasiri , WSO2 Developers' List <
>>>>> dev@wso2.org>
>>>>>
>>>>>
>>>>> Hi Sumedha,
>>>>>
>>>>> Yes, but why would this work on one DB and not on another? That's
>>>>> what's puzzling.
>>>>>
>>>>> Thanks,
>>>>> Senaka.
>>>>>
>>>>>
>>>>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe >>>> > wrote:
>>>>>
>>>>>> We should take a look @ data going into the insert & decide if those
>>>>>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Now that's a convincing issue as to H2 not having proper stability.
>>>>>>> If this is consistently reproducible, we should probably get in contact
>>>>>>> with the H2 folks and get their feedback and see how to resolve this, 
>>>>>>> but
>>>>>>> we should also make it a point to update the production guidelines.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Senaka.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri <
>>>>>>> evanth...@wso2.com> wrote:
>>>>>>>
>>>>>>>> We've seen this as well with H2. See [1]. Once we moved to mySQL,
>>>>>>>> we did not encounter the same.
>>>>>>>>
>>>>>>>

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-06-17 Thread Evanthika Amarasiri
Hello Senaka,

On Thursday, June 18, 2015, Senaka Fernando  wrote:

> Hi Evanthika,
>
> Oh! after all these years, :). I believe we can forget about this and
> you'll not get it for the next 2 years? :).
>
> I doubt it :)


> Anyway lets see what can be done here. Can you'll please do a favor? Can
> you'll turn on the JDBC logs (with the log4jdbc driver) and then share
> those log files please? As Sumedha said last, we'll need to see what gets
> passed onto the DB when this happens and logs can give a lot of insight.
>
Sure. We'll do that and share the logs with you.

Regards,
Evanthika


> Thanks,
> Senaka.
>
> On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri  > wrote:
>
>> Observed the same issue with AM 1.9.0 packs today when the local DBs were
>> pointed to H2 (with absolute paths). Any reason why this is happening?
>>
>> Regards,
>> Evanthika
>>
>> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe > > wrote:
>>
>>> Hi,
>>>
>>> The same error could be reproduced on the ESB 4.9.0 Test setup (1
>>> Manager and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a
>>> proxy service.
>>>
>>> When the issue was reproduced
>>> 1. The local registry was pointed to the default H2 DB
>>> 2. Database URL was defined with the absolute path as suggested under
>>> [1]
>>>
>>> Could get rid of the error by pointing the local registry to an Oracle
>>> DB as suggested in this thread
>>>
>>>
>>> [1] https://wso2.org/jira/browse/CARBON-14224
>>>
>>> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri >> > wrote:
>>>
>>>>
>>>> Regards,
>>>> Evanthika Amarasiri
>>>> Senior Technical Lead  - Quality Assurance
>>>> Mobile: +94773125935
>>>> Blog: evanthika.blogspot.com
>>>>
>>>> wso2.com lean.enterprise.middleware
>>>>
>>>> -- Forwarded message --
>>>> From: Senaka Fernando >>> >
>>>> Date: Tue, Sep 10, 2013 at 4:25 PM
>>>> Subject: Re: [Dev] Getting a Constraint Violation Exception when
>>>> invoking an API in the gateway worker
>>>> To: Sumedha Rubasinghe >>> >
>>>> Cc: Evanthika Amarasiri >>> >, WSO2
>>>> Developers' List >>> >
>>>>
>>>>
>>>> Hi Sumedha,
>>>>
>>>> Yes, but why would this work on one DB and not on another? That's
>>>> what's puzzling.
>>>>
>>>> Thanks,
>>>> Senaka.
>>>>
>>>>
>>>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe >>> > wrote:
>>>>
>>>>> We should take a look @ data going into the insert & decide if those
>>>>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>>>>
>>>>>
>>>>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando >>>> > wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Now that's a convincing issue as to H2 not having proper stability.
>>>>>> If this is consistently reproducible, we should probably get in contact
>>>>>> with the H2 folks and get their feedback and see how to resolve this, but
>>>>>> we should also make it a point to update the production guidelines.
>>>>>>
>>>>>> Thanks,
>>>>>> Senaka.
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri <
>>>>>> evanth...@wso2.com
>>>>>> > wrote:
>>>>>>
>>>>>>> We've seen this as well with H2. See [1]. Once we moved to mySQL, we
>>>>>>> did not encounter the same.
>>>>>>>
>>>>>>> [1] - https://wso2.org/jira/browse/CARBON-14224
>>>>>>>
>>>>>>> Evanthika Amarasiri
>>>>>>> Senior Technical Lead - Quality Assurance
>>>>>>> Mobile: +94773125935
>>>>>>>
>>>>>>> wso2.com Lean Enterprise Middleware
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando >>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi Shelan,

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-06-17 Thread Senaka Fernando
Hi Evanthika,

Oh! after all these years, :). I believe we can forget about this and
you'll not get it for the next 2 years? :).

Anyway lets see what can be done here. Can you'll please do a favor? Can
you'll turn on the JDBC logs (with the log4jdbc driver) and then share
those log files please? As Sumedha said last, we'll need to see what gets
passed onto the DB when this happens and logs can give a lot of insight.

Thanks,
Senaka.

On Wed, Jun 17, 2015 at 7:11 PM, Evanthika Amarasiri 
wrote:

> Observed the same issue with AM 1.9.0 packs today when the local DBs were
> pointed to H2 (with absolute paths). Any reason why this is happening?
>
> Regards,
> Evanthika
>
> On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe 
> wrote:
>
>> Hi,
>>
>> The same error could be reproduced on the ESB 4.9.0 Test setup (1 Manager
>> and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a proxy
>> service.
>>
>> When the issue was reproduced
>> 1. The local registry was pointed to the default H2 DB
>> 2. Database URL was defined with the absolute path as suggested under [1]
>>
>> Could get rid of the error by pointing the local registry to an Oracle DB
>> as suggested in this thread
>>
>>
>> [1] https://wso2.org/jira/browse/CARBON-14224
>>
>> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri 
>> wrote:
>>
>>>
>>> Regards,
>>> Evanthika Amarasiri
>>> Senior Technical Lead  - Quality Assurance
>>> Mobile: +94773125935
>>> Blog: evanthika.blogspot.com
>>>
>>> wso2.com lean.enterprise.middleware
>>>
>>> -- Forwarded message --
>>> From: Senaka Fernando 
>>> Date: Tue, Sep 10, 2013 at 4:25 PM
>>> Subject: Re: [Dev] Getting a Constraint Violation Exception when
>>> invoking an API in the gateway worker
>>> To: Sumedha Rubasinghe 
>>> Cc: Evanthika Amarasiri , WSO2 Developers' List <
>>> dev@wso2.org>
>>>
>>>
>>> Hi Sumedha,
>>>
>>> Yes, but why would this work on one DB and not on another? That's what's
>>> puzzling.
>>>
>>> Thanks,
>>> Senaka.
>>>
>>>
>>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe 
>>> wrote:
>>>
>>>> We should take a look @ data going into the insert & decide if those
>>>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>>>
>>>>
>>>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando 
>>>> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Now that's a convincing issue as to H2 not having proper stability. If
>>>>> this is consistently reproducible, we should probably get in contact with
>>>>> the H2 folks and get their feedback and see how to resolve this, but we
>>>>> should also make it a point to update the production guidelines.
>>>>>
>>>>> Thanks,
>>>>> Senaka.
>>>>>
>>>>>
>>>>> On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri <
>>>>> evanth...@wso2.com> wrote:
>>>>>
>>>>>> We've seen this as well with H2. See [1]. Once we moved to mySQL, we
>>>>>> did not encounter the same.
>>>>>>
>>>>>> [1] - https://wso2.org/jira/browse/CARBON-14224
>>>>>>
>>>>>> Evanthika Amarasiri
>>>>>> Senior Technical Lead - Quality Assurance
>>>>>> Mobile: +94773125935
>>>>>>
>>>>>> wso2.com Lean Enterprise Middleware
>>>>>>
>>>>>>
>>>>>> On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Shelan, Amila,
>>>>>>>
>>>>>>> Well it might be H2, but it also might be the sequence of steps that
>>>>>>> lead to this. We probably can ensure all DBs are cleaned or try the 
>>>>>>> same in
>>>>>>> a similar setup with no data in any DB (UM, Remote Registry DB and Local
>>>>>>> Registry DB).
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Senaka.
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera 
>>>>>>> wrote:
>>>>&g

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-06-17 Thread Evanthika Amarasiri
Observed the same issue with AM 1.9.0 packs today when the local DBs were
pointed to H2 (with absolute paths). Any reason why this is happening?

Regards,
Evanthika

On Wed, Jun 17, 2015 at 3:41 PM, Asanthi Kulasinghe 
wrote:

> Hi,
>
> The same error could be reproduced on the ESB 4.9.0 Test setup (1 Manager
> and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a proxy
> service.
>
> When the issue was reproduced
> 1. The local registry was pointed to the default H2 DB
> 2. Database URL was defined with the absolute path as suggested under [1]
>
> Could get rid of the error by pointing the local registry to an Oracle DB
> as suggested in this thread
>
>
> [1] https://wso2.org/jira/browse/CARBON-14224
>
> On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri 
> wrote:
>
>>
>> Regards,
>> Evanthika Amarasiri
>> Senior Technical Lead  - Quality Assurance
>> Mobile: +94773125935
>> Blog: evanthika.blogspot.com
>>
>> wso2.com lean.enterprise.middleware
>>
>> ------ Forwarded message --
>> From: Senaka Fernando 
>> Date: Tue, Sep 10, 2013 at 4:25 PM
>> Subject: Re: [Dev] Getting a Constraint Violation Exception when invoking
>> an API in the gateway worker
>> To: Sumedha Rubasinghe 
>> Cc: Evanthika Amarasiri , WSO2 Developers' List <
>> dev@wso2.org>
>>
>>
>> Hi Sumedha,
>>
>> Yes, but why would this work on one DB and not on another? That's what's
>> puzzling.
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe 
>> wrote:
>>
>>> We should take a look @ data going into the insert & decide if those
>>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>>
>>>
>>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando 
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Now that's a convincing issue as to H2 not having proper stability. If
>>>> this is consistently reproducible, we should probably get in contact with
>>>> the H2 folks and get their feedback and see how to resolve this, but we
>>>> should also make it a point to update the production guidelines.
>>>>
>>>> Thanks,
>>>> Senaka.
>>>>
>>>>
>>>> On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri <
>>>> evanth...@wso2.com> wrote:
>>>>
>>>>> We've seen this as well with H2. See [1]. Once we moved to mySQL, we
>>>>> did not encounter the same.
>>>>>
>>>>> [1] - https://wso2.org/jira/browse/CARBON-14224
>>>>>
>>>>> Evanthika Amarasiri
>>>>> Senior Technical Lead - Quality Assurance
>>>>> Mobile: +94773125935
>>>>>
>>>>> wso2.com Lean Enterprise Middleware
>>>>>
>>>>>
>>>>> On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando 
>>>>> wrote:
>>>>>
>>>>>> Hi Shelan, Amila,
>>>>>>
>>>>>> Well it might be H2, but it also might be the sequence of steps that
>>>>>> lead to this. We probably can ensure all DBs are cleaned or try the same 
>>>>>> in
>>>>>> a similar setup with no data in any DB (UM, Remote Registry DB and Local
>>>>>> Registry DB).
>>>>>>
>>>>>> Thanks,
>>>>>> Senaka.
>>>>>>
>>>>>>
>>>>>> On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Amila,
>>>>>>>
>>>>>>> Could you please try using mysql database (another database)
>>>>>>> replacing H2 and try. We have seen this behavior with H2 database in 
>>>>>>> some
>>>>>>> setups and did not appear when moved to mysql. (So we can be sure that 
>>>>>>> this
>>>>>>> is not a problem of H2)
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva 
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando 
>>>>>>>> wrote

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2015-06-17 Thread Asanthi Kulasinghe
Hi,

The same error could be reproduced on the ESB 4.9.0 Test setup (1 Manager
and 2 worker nodes fronted by Nginx, DB - Oracle ) when invoking a proxy
service.

When the issue was reproduced
1. The local registry was pointed to the default H2 DB
2. Database URL was defined with the absolute path as suggested under [1]

Could get rid of the error by pointing the local registry to an Oracle DB
as suggested in this thread


[1] https://wso2.org/jira/browse/CARBON-14224

On Wed, Jun 17, 2015 at 3:23 PM, Evanthika Amarasiri 
wrote:

>
> Regards,
> Evanthika Amarasiri
> Senior Technical Lead  - Quality Assurance
> Mobile: +94773125935
> Blog: evanthika.blogspot.com
>
> wso2.com lean.enterprise.middleware
>
> -- Forwarded message --
> From: Senaka Fernando 
> Date: Tue, Sep 10, 2013 at 4:25 PM
> Subject: Re: [Dev] Getting a Constraint Violation Exception when invoking
> an API in the gateway worker
> To: Sumedha Rubasinghe 
> Cc: Evanthika Amarasiri , WSO2 Developers' List <
> dev@wso2.org>
>
>
> Hi Sumedha,
>
> Yes, but why would this work on one DB and not on another? That's what's
> puzzling.
>
> Thanks,
> Senaka.
>
>
> On Tue, Sep 10, 2013 at 10:16 AM, Sumedha Rubasinghe 
> wrote:
>
>> We should take a look @ data going into the insert & decide if those
>> actually violate 'REG_RESOURCE_FK_BY_PATH_ID' constraint.
>>
>>
>> On Mon, Sep 9, 2013 at 10:39 PM, Senaka Fernando  wrote:
>>
>>> Hi all,
>>>
>>> Now that's a convincing issue as to H2 not having proper stability. If
>>> this is consistently reproducible, we should probably get in contact with
>>> the H2 folks and get their feedback and see how to resolve this, but we
>>> should also make it a point to update the production guidelines.
>>>
>>> Thanks,
>>> Senaka.
>>>
>>>
>>> On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri >> > wrote:
>>>
>>>> We've seen this as well with H2. See [1]. Once we moved to mySQL, we
>>>> did not encounter the same.
>>>>
>>>> [1] - https://wso2.org/jira/browse/CARBON-14224
>>>>
>>>> Evanthika Amarasiri
>>>> Senior Technical Lead - Quality Assurance
>>>> Mobile: +94773125935
>>>>
>>>> wso2.com Lean Enterprise Middleware
>>>>
>>>>
>>>> On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando 
>>>> wrote:
>>>>
>>>>> Hi Shelan, Amila,
>>>>>
>>>>> Well it might be H2, but it also might be the sequence of steps that
>>>>> lead to this. We probably can ensure all DBs are cleaned or try the same 
>>>>> in
>>>>> a similar setup with no data in any DB (UM, Remote Registry DB and Local
>>>>> Registry DB).
>>>>>
>>>>> Thanks,
>>>>> Senaka.
>>>>>
>>>>>
>>>>> On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera  wrote:
>>>>>
>>>>>> Hi Amila,
>>>>>>
>>>>>> Could you please try using mysql database (another database)
>>>>>> replacing H2 and try. We have seen this behavior with H2 database in some
>>>>>> setups and did not appear when moved to mysql. (So we can be sure that 
>>>>>> this
>>>>>> is not a problem of H2)
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva 
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Amila,
>>>>>>>>
>>>>>>>> Configuration looks good. Got a few questions regarding the
>>>>>>>> worker's setup.
>>>>>>>>
>>>>>>>> 1. Did you first create the tenant on the manager and then setup
>>>>>>>> the worker?
>>>>>>>>
>>>>>>> Tenant was created after setting up both the worker and manager.
>>>>>>> However the tenant was created in the key manager, which also have the 
>>>>>>> same
>>>>>>> mounting configs.
>>>>>>>
>>>>>>>&

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-09 Thread Senaka Fernando
Hi all,

Now that's a convincing issue as to H2 not having proper stability. If this
is consistently reproducible, we should probably get in contact with the H2
folks and get their feedback and see how to resolve this, but we should
also make it a point to update the production guidelines.

Thanks,
Senaka.


On Mon, Sep 9, 2013 at 10:25 AM, Evanthika Amarasiri wrote:

> We've seen this as well with H2. See [1]. Once we moved to mySQL, we did
> not encounter the same.
>
> [1] - https://wso2.org/jira/browse/CARBON-14224
>
> Evanthika Amarasiri
> Senior Technical Lead - Quality Assurance
> Mobile: +94773125935
> *
> *
> wso2.com Lean Enterprise Middleware
>
>
> On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando  wrote:
>
>> Hi Shelan, Amila,
>>
>> Well it might be H2, but it also might be the sequence of steps that lead
>> to this. We probably can ensure all DBs are cleaned or try the same in a
>> similar setup with no data in any DB (UM, Remote Registry DB and Local
>> Registry DB).
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera  wrote:
>>
>>> Hi Amila,
>>>
>>> Could you please try using mysql database (another database) replacing
>>> H2 and try. We have seen this behavior with H2 database in some setups and
>>> did not appear when moved to mysql. (So we can be sure that this is not a
>>> problem of H2)
>>>
>>> Thanks
>>>
>>>
>>> On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva  wrote:
>>>



 On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando wrote:

> Hi Amila,
>
> Configuration looks good. Got a few questions regarding the worker's
> setup.
>
> 1. Did you first create the tenant on the manager and then setup the
> worker?
>
 Tenant was created after setting up both the worker and manager.
 However the tenant was created in the key manager, which also have the same
 mounting configs.

> 2. Did you take a copy of the manager's DB and setup the worker (for
> the local H2 database)?
>
 A fresh APIM pack was used for creating the worker. The first few times
 this error was encountered, the local H2 db was deleted and re-created.

> 3. Was the config/governance registry Database previously or parallely
> used for some other deployment?
>
 These databases are exclusively used this particular setup.

>
>

> Also, please look into what Sumedha is mentioning.
>
> Thanks,
> Senaka.
>
>
> On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva wrote:
>
>> Hi Senaka,
>> Mounts were created for both Config and Governance spaces. I have
>> attached the configurations files of the failing node.
>>
>> AmilaD
>>
>>
>> On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando wrote:
>>
>>> Hi Amila,
>>>
>>> This is most probably a result of improper mounting configurations.
>>> Can you please explain how the mounts were setup and how the registry
>>> databases were configured?
>>>
>>> Thanks,
>>> Senaka.
>>>
>>>
>>> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva wrote:
>>>
 Hi,
 I'm getting the following exception when invoking an API in a
 distributed APIM setup. In the deployment, we have two gateway nodes, 
 one
 serving as a manager and the other as the worker. Published APIs are 
 first
 deployed on the manager node and then propagated to the worker node
  through the svn deployment synchronizer.
 This was only observed when invoking an API created by a tenant.

 [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add
 resource to path /. Referential integrity constraint violation:
 "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN 
 KEY(REG_PATH_ID,
 REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, 
 REG_TENANT_ID)"; SQL
 statement:
 INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
 REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
 REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, 
 ?,
 ?, ?) [23002-140]
 org.h2.jdbc.JdbcSQLException: Referential integrity constraint
 violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
 KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
 REG_TENANT_ID)"; SQL statement:
 INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
 REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
 REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, 
 ?,
 ?, ?) [23002-140]
  at
 org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
 at org.h2.message.DbException.get(DbException.java:167)
  at org.h2.message.

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-08 Thread Evanthika Amarasiri
We've seen this as well with H2. See [1]. Once we moved to mySQL, we did
not encounter the same.

[1] - https://wso2.org/jira/browse/CARBON-14224

Evanthika Amarasiri
Senior Technical Lead - Quality Assurance
Mobile: +94773125935
*
*
wso2.com Lean Enterprise Middleware


On Sun, Sep 8, 2013 at 11:44 PM, Senaka Fernando  wrote:

> Hi Shelan, Amila,
>
> Well it might be H2, but it also might be the sequence of steps that lead
> to this. We probably can ensure all DBs are cleaned or try the same in a
> similar setup with no data in any DB (UM, Remote Registry DB and Local
> Registry DB).
>
> Thanks,
> Senaka.
>
>
> On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera  wrote:
>
>> Hi Amila,
>>
>> Could you please try using mysql database (another database) replacing H2
>> and try. We have seen this behavior with H2 database in some setups and did
>> not appear when moved to mysql. (So we can be sure that this is not a
>> problem of H2)
>>
>> Thanks
>>
>>
>> On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva  wrote:
>>
>>>
>>>
>>>
>>> On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando  wrote:
>>>
 Hi Amila,

 Configuration looks good. Got a few questions regarding the worker's
 setup.

 1. Did you first create the tenant on the manager and then setup the
 worker?

>>> Tenant was created after setting up both the worker and manager. However
>>> the tenant was created in the key manager, which also have the same
>>> mounting configs.
>>>
 2. Did you take a copy of the manager's DB and setup the worker (for
 the local H2 database)?

>>> A fresh APIM pack was used for creating the worker. The first few times
>>> this error was encountered, the local H2 db was deleted and re-created.
>>>
 3. Was the config/governance registry Database previously or parallely
 used for some other deployment?

>>> These databases are exclusively used this particular setup.
>>>


>>>
 Also, please look into what Sumedha is mentioning.

 Thanks,
 Senaka.


 On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva wrote:

> Hi Senaka,
> Mounts were created for both Config and Governance spaces. I have
> attached the configurations files of the failing node.
>
> AmilaD
>
>
> On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando wrote:
>
>> Hi Amila,
>>
>> This is most probably a result of improper mounting configurations.
>> Can you please explain how the mounts were setup and how the registry
>> databases were configured?
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva wrote:
>>
>>> Hi,
>>> I'm getting the following exception when invoking an API in a
>>> distributed APIM setup. In the deployment, we have two gateway nodes, 
>>> one
>>> serving as a manager and the other as the worker. Published APIs are 
>>> first
>>> deployed on the manager node and then propagated to the worker node
>>>  through the svn deployment synchronizer.
>>> This was only observed when invoking an API created by a tenant.
>>>
>>> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add
>>> resource to path /. Referential integrity constraint violation:
>>> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN 
>>> KEY(REG_PATH_ID,
>>> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; 
>>> SQL
>>> statement:
>>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, 
>>> ?,
>>> ?, ?) [23002-140]
>>> org.h2.jdbc.JdbcSQLException: Referential integrity constraint
>>> violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
>>> KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
>>> REG_TENANT_ID)"; SQL statement:
>>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, 
>>> ?,
>>> ?, ?) [23002-140]
>>>  at
>>> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>>> at org.h2.message.DbException.get(DbException.java:167)
>>>  at org.h2.message.DbException.get(DbException.java:144)
>>> at
>>> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>>>  at
>>> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
>>> at org.h2.table.Table.fireConstraints(Table.java:801)
>>>  at org.h2.table.Table.fireAfterRow(Table.java:818)
>>> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>>>  at org.h2.command.dml.Insert.update(Insert.java:82)
>>> at org.h2.co

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-08 Thread Senaka Fernando
Hi Shelan, Amila,

Well it might be H2, but it also might be the sequence of steps that lead
to this. We probably can ensure all DBs are cleaned or try the same in a
similar setup with no data in any DB (UM, Remote Registry DB and Local
Registry DB).

Thanks,
Senaka.


On Sun, Sep 8, 2013 at 9:58 PM, Shelan Perera  wrote:

> Hi Amila,
>
> Could you please try using mysql database (another database) replacing H2
> and try. We have seen this behavior with H2 database in some setups and did
> not appear when moved to mysql. (So we can be sure that this is not a
> problem of H2)
>
> Thanks
>
>
> On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva  wrote:
>
>>
>>
>>
>> On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando  wrote:
>>
>>> Hi Amila,
>>>
>>> Configuration looks good. Got a few questions regarding the worker's
>>> setup.
>>>
>>> 1. Did you first create the tenant on the manager and then setup the
>>> worker?
>>>
>> Tenant was created after setting up both the worker and manager. However
>> the tenant was created in the key manager, which also have the same
>> mounting configs.
>>
>>> 2. Did you take a copy of the manager's DB and setup the worker (for the
>>> local H2 database)?
>>>
>> A fresh APIM pack was used for creating the worker. The first few times
>> this error was encountered, the local H2 db was deleted and re-created.
>>
>>> 3. Was the config/governance registry Database previously or parallely
>>> used for some other deployment?
>>>
>> These databases are exclusively used this particular setup.
>>
>>>
>>>
>>
>>> Also, please look into what Sumedha is mentioning.
>>>
>>> Thanks,
>>> Senaka.
>>>
>>>
>>> On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva  wrote:
>>>
 Hi Senaka,
 Mounts were created for both Config and Governance spaces. I have
 attached the configurations files of the failing node.

 AmilaD


 On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando wrote:

> Hi Amila,
>
> This is most probably a result of improper mounting configurations.
> Can you please explain how the mounts were setup and how the registry
> databases were configured?
>
> Thanks,
> Senaka.
>
>
> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva wrote:
>
>> Hi,
>> I'm getting the following exception when invoking an API in a
>> distributed APIM setup. In the deployment, we have two gateway nodes, one
>> serving as a manager and the other as the worker. Published APIs are 
>> first
>> deployed on the manager node and then propagated to the worker node
>>  through the svn deployment synchronizer.
>> This was only observed when invoking an API created by a tenant.
>>
>> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add
>> resource to path /. Referential integrity constraint violation:
>> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
>> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; 
>> SQL
>> statement:
>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) [23002-140]
>> org.h2.jdbc.JdbcSQLException: Referential integrity constraint
>> violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
>> KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
>> REG_TENANT_ID)"; SQL statement:
>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) [23002-140]
>>  at
>> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>>  at org.h2.message.DbException.get(DbException.java:144)
>> at
>> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>>  at
>> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
>> at org.h2.table.Table.fireConstraints(Table.java:801)
>>  at org.h2.table.Table.fireAfterRow(Table.java:818)
>> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>>  at org.h2.command.dml.Insert.update(Insert.java:82)
>> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>>  at org.h2.command.Command.executeUpdate(Command.java:199)
>> at
>> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>>  at
>> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
>> at
>> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
>>  at
>> org.wso2.carbon.registry.cor

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-08 Thread Shelan Perera
Hi Amila,

Could you please try using mysql database (another database) replacing H2
and try. We have seen this behavior with H2 database in some setups and did
not appear when moved to mysql. (So we can be sure that this is not a
problem of H2)

Thanks


On Sun, Sep 8, 2013 at 8:57 PM, Amila De Silva  wrote:

>
>
>
> On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando  wrote:
>
>> Hi Amila,
>>
>> Configuration looks good. Got a few questions regarding the worker's
>> setup.
>>
>> 1. Did you first create the tenant on the manager and then setup the
>> worker?
>>
> Tenant was created after setting up both the worker and manager. However
> the tenant was created in the key manager, which also have the same
> mounting configs.
>
>> 2. Did you take a copy of the manager's DB and setup the worker (for the
>> local H2 database)?
>>
> A fresh APIM pack was used for creating the worker. The first few times
> this error was encountered, the local H2 db was deleted and re-created.
>
>> 3. Was the config/governance registry Database previously or parallely
>> used for some other deployment?
>>
> These databases are exclusively used this particular setup.
>
>>
>>
>
>> Also, please look into what Sumedha is mentioning.
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva  wrote:
>>
>>> Hi Senaka,
>>> Mounts were created for both Config and Governance spaces. I have
>>> attached the configurations files of the failing node.
>>>
>>> AmilaD
>>>
>>>
>>> On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando wrote:
>>>
 Hi Amila,

 This is most probably a result of improper mounting configurations. Can
 you please explain how the mounts were setup and how the registry databases
 were configured?

 Thanks,
 Senaka.


 On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva wrote:

> Hi,
> I'm getting the following exception when invoking an API in a
> distributed APIM setup. In the deployment, we have two gateway nodes, one
> serving as a manager and the other as the worker. Published APIs are first
> deployed on the manager node and then propagated to the worker node
>  through the svn deployment synchronizer.
> This was only observed when invoking an API created by a tenant.
>
> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add
> resource to path /. Referential integrity constraint violation:
> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; 
> SQL
> statement:
> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) [23002-140]
> org.h2.jdbc.JdbcSQLException: Referential integrity constraint
> violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
> KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
> REG_TENANT_ID)"; SQL statement:
> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) [23002-140]
>  at
> org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at
> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>  at
> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
> at org.h2.table.Table.fireConstraints(Table.java:801)
>  at org.h2.table.Table.fireAfterRow(Table.java:818)
> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>  at org.h2.command.dml.Insert.update(Insert.java:82)
> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>  at org.h2.command.Command.executeUpdate(Command.java:199)
> at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>  at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
> at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
>  at
> org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
>  at
> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
> at
> o

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-08 Thread Amila De Silva
On Sun, Sep 8, 2013 at 7:44 PM, Senaka Fernando  wrote:

> Hi Amila,
>
> Configuration looks good. Got a few questions regarding the worker's setup.
>
> 1. Did you first create the tenant on the manager and then setup the
> worker?
>
Tenant was created after setting up both the worker and manager. However
the tenant was created in the key manager, which also have the same
mounting configs.

> 2. Did you take a copy of the manager's DB and setup the worker (for the
> local H2 database)?
>
A fresh APIM pack was used for creating the worker. The first few times
this error was encountered, the local H2 db was deleted and re-created.

> 3. Was the config/governance registry Database previously or parallely
> used for some other deployment?
>
These databases are exclusively used this particular setup.

>
>

> Also, please look into what Sumedha is mentioning.
>
> Thanks,
> Senaka.
>
>
> On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva  wrote:
>
>> Hi Senaka,
>> Mounts were created for both Config and Governance spaces. I have
>> attached the configurations files of the failing node.
>>
>> AmilaD
>>
>>
>> On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando  wrote:
>>
>>> Hi Amila,
>>>
>>> This is most probably a result of improper mounting configurations. Can
>>> you please explain how the mounts were setup and how the registry databases
>>> were configured?
>>>
>>> Thanks,
>>> Senaka.
>>>
>>>
>>> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva  wrote:
>>>
 Hi,
 I'm getting the following exception when invoking an API in a
 distributed APIM setup. In the deployment, we have two gateway nodes, one
 serving as a manager and the other as the worker. Published APIs are first
 deployed on the manager node and then propagated to the worker node
  through the svn deployment synchronizer.
 This was only observed when invoking an API created by a tenant.

 [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add
 resource to path /. Referential integrity constraint violation:
 "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
 REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
 statement:
 INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
 REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
 REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
 ?, ?) [23002-140]
 org.h2.jdbc.JdbcSQLException: Referential integrity constraint
 violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
 KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
 REG_TENANT_ID)"; SQL statement:
 INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
 REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
 REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
 ?, ?) [23002-140]
  at
 org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
 at org.h2.message.DbException.get(DbException.java:167)
  at org.h2.message.DbException.get(DbException.java:144)
 at
 org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
  at
 org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
 at org.h2.table.Table.fireConstraints(Table.java:801)
  at org.h2.table.Table.fireAfterRow(Table.java:818)
 at org.h2.command.dml.Insert.insertRows(Insert.java:122)
  at org.h2.command.dml.Insert.update(Insert.java:82)
 at org.h2.command.CommandContainer.update(CommandContainer.java:70)
  at org.h2.command.Command.executeUpdate(Command.java:199)
 at
 org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
  at
 org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
 at
 org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
  at
 org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
  at
 org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
  at
 org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
 at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
  at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
 at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
  at
 org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantC

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-08 Thread Senaka Fernando
Hi Amila,

Configuration looks good. Got a few questions regarding the worker's setup.

1. Did you first create the tenant on the manager and then setup the worker?
2. Did you take a copy of the manager's DB and setup the worker (for the
local H2 database)?
3. Was the config/governance registry Database previously or parallely used
for some other deployment?

Also, please look into what Sumedha is mentioning.

Thanks,
Senaka.


On Sun, Sep 8, 2013 at 10:11 AM, Amila De Silva  wrote:

> Hi Senaka,
> Mounts were created for both Config and Governance spaces. I have attached
> the configurations files of the failing node.
>
> AmilaD
>
>
> On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando  wrote:
>
>> Hi Amila,
>>
>> This is most probably a result of improper mounting configurations. Can
>> you please explain how the mounts were setup and how the registry databases
>> were configured?
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva  wrote:
>>
>>> Hi,
>>> I'm getting the following exception when invoking an API in a
>>> distributed APIM setup. In the deployment, we have two gateway nodes, one
>>> serving as a manager and the other as the worker. Published APIs are first
>>> deployed on the manager node and then propagated to the worker node
>>>  through the svn deployment synchronizer.
>>> This was only observed when invoking an API created by a tenant.
>>>
>>> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add resource
>>> to path /. Referential integrity constraint violation:
>>> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
>>> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
>>> statement:
>>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) [23002-140]
>>> org.h2.jdbc.JdbcSQLException: Referential integrity constraint
>>> violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
>>> KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
>>> REG_TENANT_ID)"; SQL statement:
>>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) [23002-140]
>>>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>>> at org.h2.message.DbException.get(DbException.java:167)
>>>  at org.h2.message.DbException.get(DbException.java:144)
>>> at
>>> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>>>  at
>>> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
>>> at org.h2.table.Table.fireConstraints(Table.java:801)
>>>  at org.h2.table.Table.fireAfterRow(Table.java:818)
>>> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>>>  at org.h2.command.dml.Insert.update(Insert.java:82)
>>> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>>>  at org.h2.command.Command.executeUpdate(Command.java:199)
>>> at
>>> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>>>  at
>>> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
>>> at
>>> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
>>>  at
>>> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
>>> at
>>> org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
>>>  at
>>> org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
>>> at
>>> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
>>>  at
>>> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
>>> at
>>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
>>>  at
>>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
>>> at
>>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
>>>  at
>>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
>>> at
>>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
>>>  at
>>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
>>> at
>>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
>>>  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>> at
>>> org.apache.synapse.transport.passthru.ServerWorker.process

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-07 Thread Sumedha Rubasinghe
It seems there is a registry write happening during API invocation.
If this is related to erroneous mounting configuration & goes away after
that, then no issue. If not, we need to check why a write operation is
happening for an API invocation.
Amila, pls note.




On Sat, Sep 7, 2013 at 10:07 PM, Senaka Fernando  wrote:

> Hi Amila,
>
> This is most probably a result of improper mounting configurations. Can
> you please explain how the mounts were setup and how the registry databases
> were configured?
>
> Thanks,
> Senaka.
>
>
> On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva  wrote:
>
>> Hi,
>> I'm getting the following exception when invoking an API in a distributed
>> APIM setup. In the deployment, we have two gateway nodes, one serving as a
>> manager and the other as the worker. Published APIs are first deployed on
>> the manager node and then propagated to the worker node  through the svn
>> deployment synchronizer.
>> This was only observed when invoking an API created by a tenant.
>>
>> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add resource
>> to path /. Referential integrity constraint violation:
>> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
>> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
>> statement:
>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) [23002-140]
>> org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation:
>> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
>> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
>> statement:
>> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
>> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
>> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) [23002-140]
>>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>>  at org.h2.message.DbException.get(DbException.java:144)
>> at
>> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>>  at
>> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
>> at org.h2.table.Table.fireConstraints(Table.java:801)
>>  at org.h2.table.Table.fireAfterRow(Table.java:818)
>> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>>  at org.h2.command.dml.Insert.update(Insert.java:82)
>> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>>  at org.h2.command.Command.executeUpdate(Command.java:199)
>> at
>> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>>  at
>> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
>> at
>> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
>>  at
>> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
>> at
>> org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
>>  at
>> org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
>> at
>> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
>>  at
>> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
>> at
>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
>>  at
>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
>> at
>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
>>  at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
>> at
>> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
>>  at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
>> at
>> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
>>  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>> at
>> org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
>>  at
>> org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
>> at
>> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
>>  at
>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>>  at java.util.concurrent.Thr

Re: [Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-07 Thread Senaka Fernando
Hi Amila,

This is most probably a result of improper mounting configurations. Can you
please explain how the mounts were setup and how the registry databases
were configured?

Thanks,
Senaka.


On Sat, Sep 7, 2013 at 12:40 AM, Amila De Silva  wrote:

> Hi,
> I'm getting the following exception when invoking an API in a distributed
> APIM setup. In the deployment, we have two gateway nodes, one serving as a
> manager and the other as the worker. Published APIs are first deployed on
> the manager node and then propagated to the worker node  through the svn
> deployment synchronizer.
> This was only observed when invoking an API created by a tenant.
>
> [2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add resource
> to path /. Referential integrity constraint violation:
> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
> statement:
> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) [23002-140]
> org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation:
> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
> REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
> statement:
> INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
> REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
> REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) [23002-140]
>  at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
>  at org.h2.message.DbException.get(DbException.java:144)
> at
> org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
>  at
> org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
> at org.h2.table.Table.fireConstraints(Table.java:801)
>  at org.h2.table.Table.fireAfterRow(Table.java:818)
> at org.h2.command.dml.Insert.insertRows(Insert.java:122)
>  at org.h2.command.dml.Insert.update(Insert.java:82)
> at org.h2.command.CommandContainer.update(CommandContainer.java:70)
>  at org.h2.command.Command.executeUpdate(Command.java:199)
> at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
>  at
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
> at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
>  at
> org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
>  at
> org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
> at
> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
>  at
> org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
> at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
>  at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
> at
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
>  at
> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
> at
> org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
>  at
> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
> at
> org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
>  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
> at
> org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
>  at
> org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
> at
> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
>  at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> [2013-09-06 18:41:29,656] FATAL - UserRegistry Failed to add the root
> collection to the coreRegistry.
> org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to add
> resource to path /. Referential integrity constraint violation:
> "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
> REG_TENANT_

[Dev] Getting a Constraint Violation Exception when invoking an API in the gateway worker

2013-09-06 Thread Amila De Silva
Hi,
I'm getting the following exception when invoking an API in a distributed
APIM setup. In the deployment, we have two gateway nodes, one serving as a
manager and the other as the worker. Published APIs are first deployed on
the manager node and then propagated to the worker node  through the svn
deployment synchronizer.
This was only observed when invoking an API created by a tenant.

[2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add resource to
path /. Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at
org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
at
org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
at org.h2.table.Table.fireConstraints(Table.java:801)
at org.h2.table.Table.fireAfterRow(Table.java:818)
at org.h2.command.dml.Insert.insertRows(Insert.java:122)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:70)
at org.h2.command.Command.executeUpdate(Command.java:199)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
at
org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
at
org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
at
org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:226)
at
org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:205)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[2013-09-06 18:41:29,656] FATAL - UserRegistry Failed to add the root
collection to the coreRegistry.
org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to add
resource to path /. Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1410)
at
org.wso2.carbon.reg