jiwa Timeout expired

Discussions relating to plugin development, and the Jiwa API.

jiwa Timeout expired

Postby redpoint » Wed Jun 03, 2020 9:22 pm

We are running running debtor queries through api and sometimes getting this error.

jiwa Timeout expired.

I run the sp_who2 in the database, I can see 155 connections with the username JiwaUser, Command = Awaiting Command, ProgramName = Jiwa Financials xxxxxxxxxx

Can you please tell me how I can fix this issue.
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: jiwa Timeout expired

Postby Mike.Sheen » Thu Jun 04, 2020 1:04 pm

The cause of this is usually not explicitly logging off.

We do attempt to log off automatically when sessions expire, but found that to not be reliable, so we've made some changes to the session management in the next version which should address that.

In the meantime, you should be able to mitigate the problem by explicitly performing a GET on the /auth/logout route after your request(s).
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: jiwa Timeout expired

Postby redpoint » Thu Jun 04, 2020 4:12 pm

Thank you Mike,

One more issue related to webhook. I created a product and updated stock level.

But sometime the execution is perfectly fine but sometime it get delayed and the data remain under SY_WebhookMessage table. There is no error I can see under SY_WebhookSubscriptionRequestHeader.

I am integrated it with woocommerce.

Can you please explain the issue and how I can fix?

Thank you
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: jiwa Timeout expired

Postby Mike.Sheen » Thu Jun 04, 2020 5:56 pm

redpoint wrote:But sometime the execution is perfectly fine but sometime it get delayed and the data remain under SY_WebhookMessage table.


I think you'll find that it's supposed to stay in that table, but the Status value will change based on the result of sending or attempting to send the webhook.

redpoint wrote:There is no error I can see under SY_WebhookSubscriptionRequestHeader.


That table isn't where the responses are found - you want to look in SY_WebhookMessageResponse. SY_WebhookSubscriptionRequestHeader contains optional headers you might want to send along with the initial request.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: jiwa Timeout expired

Postby redpoint » Fri Jun 05, 2020 4:04 pm

Thank you Mike,

Let me explain my question in more detail,

We have added 3 webhooks to our test Jiwa server, inventory_created, inventory_updated, and inventory_stocklevel where each of these events are hooked to our API.

The problem is when we add/update a product in our test Jiwa server, those webhooks doesn't get executed immediately. Sometimes it takes more than hour to get executed. We have checked the database and we can see they are sitting there without being executed, also it worth mentioning that sometimes when we add a product, we don't see any record for the event in the database and it never gets executed, however, product exists in the test server.

Could you please advise us why webhooks are behaving this way as it is not reliable for us when we want to keep two systems synced.
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: jiwa Timeout expired

Postby Mike.Sheen » Fri Jun 05, 2020 4:51 pm

redpoint wrote:The problem is when we add/update a product in our test Jiwa server, those webhooks doesn't get executed immediately. Sometimes it takes more than hour to get executed.


That's not normal, and I cannot reproduce that behaviour.

In my tests webhooks are sent almost instantly. Only if there was an error sending the webhook does it get queued for retry after an interval as per the system setting WebhooksRetryInterval.

What do the entries in your SY_WebhookMessageResponse table look like for such a delayed webhook?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: jiwa Timeout expired

Postby Mike.Sheen » Fri Jun 05, 2020 4:55 pm

Have you set the WebhooksHostURL system setting? That must be an address accessible by the Jiwa clients - typically it would be the local (internal) address of the Jiwa REST API service.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: jiwa Timeout expired

Postby redpoint » Sun Jun 07, 2020 10:01 pm

Hello Mike,

Thanks, we are not seeing any response in the table name SY_WebhookMessageResponse

I created one subscription, inventory.created and in jiwa I created one 1 product, I can see that product is in SY_WebhookMessage but it's not executed.

Here is the screenshot of everything: https://prnt.sc/svbc8s

Can you please let me know where I am making mistake?

Thanks
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Re: jiwa Timeout expired

Postby Mike.Sheen » Mon Jun 08, 2020 10:57 am

Mike.Sheen wrote:Have you set the WebhooksHostURL system setting? That must be an address accessible by the Jiwa clients - typically it would be the local (internal) address of the Jiwa REST API service.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: jiwa Timeout expired

Postby redpoint » Tue Jun 09, 2020 9:06 am

Mike.Sheen wrote:
Mike.Sheen wrote:Have you set the WebhooksHostURL system setting? That must be an address accessible by the Jiwa clients - typically it would be the local (internal) address of the Jiwa REST API service.


Yes I did, it's there. But not sure, why it's happening.

If I try the same on Production server, and create 1 product in Jiwa, it's firing twice e.g. http://prntscr.com/sw62sc
redpoint
Occasional Contributor
Occasional Contributor
 
Posts: 16
Joined: Tue Feb 25, 2020 3:17 pm

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron