Solved

PXNotLoggedInException during Webhook execution.

  • 23 September 2022
  • 2 replies
  • 61 views

We’ve developed a webhook that receives push notifications and does entity creation work. All has been working fine until we moved to 2022R1, where we’re seeing odd behavior during the process that is kicked off by the webhook event.

The web hook kicks off a custom long running process before returning to the caller. The webhook returns correctly, but shortly after, the site goes down and we find a PXNotLoggedInException in our Windows event logs. This feels like an instance or installation related issue, rather than a code issue. Has anyone experienced this before?

PXNotLoggedInException Detail

 

icon

Best answer by mansonj70 5 October 2022, 16:39

View original

2 replies

Userlevel 7
Badge

Thank you for sharing your solution with the community @mansonj70 !

Answering my own question so that someone else may benefit.

Working with Acumatica, we found that there was an asynchronous method in the graph code that was causing the issue.

The webhook implementation is standard, and uses a custom graph to process incoming events in a Long Running Process.

Webhook Graph Instantiation and ProcessEvents() Call

That graph implements the processing method as as an overridden pair, with a simple public member and the meat of the work done by a protected member with the same name.

Since the work involves several HTTP API calls, those methods are implemented asynchronously, carrying the async requirement up to our protected method.

Removing the ‘async’ keyword from the protected method solved the issue. It is possible that ‘await’-ing the call in the public method would have the same effect. Of course, it was necessary to await the HTTP async calls inside the method using the ‘asynchronousCall().Result’ method, rather than ‘await’.

 

Hope this helps anyone running into this Not Logged In exception. Asynchronous methods can cause timing issues when PXGraph code is involved.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved