Page 1 of 2
jiwa Timeout expired

Posted:
Wed Jun 03, 2020 9:22 pm
by redpoint
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.
Re: jiwa Timeout expired

Posted:
Thu Jun 04, 2020 1:04 pm
by Mike.Sheen
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).
Re: jiwa Timeout expired

Posted:
Thu Jun 04, 2020 4:12 pm
by redpoint
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
Re: jiwa Timeout expired

Posted:
Thu Jun 04, 2020 5:56 pm
by Mike.Sheen
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.
Re: jiwa Timeout expired

Posted:
Fri Jun 05, 2020 4:04 pm
by redpoint
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.
Re: jiwa Timeout expired

Posted:
Fri Jun 05, 2020 4:51 pm
by Mike.Sheen
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?
Re: jiwa Timeout expired

Posted:
Fri Jun 05, 2020 4:55 pm
by Mike.Sheen
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.
Re: jiwa Timeout expired

Posted:
Sun Jun 07, 2020 10:01 pm
by redpoint
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/svbc8sCan you please let me know where I am making mistake?
Thanks
Re: jiwa Timeout expired

Posted:
Mon Jun 08, 2020 10:57 am
by Mike.Sheen
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.
Re: jiwa Timeout expired

Posted:
Tue Jun 09, 2020 9:06 am
by redpoint
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