Skip to main content
Solved

PXNotLoggedInException during Webhook execution.

  • September 23, 2022
  • 2 replies
  • 77 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

 

Best answer by 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.

View original
Did this topic help you find an answer to your question?

2 replies

  • Author
  • Freshman II
  • 2 replies
  • Answer
  • October 5, 2022

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.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2751 replies
  • October 5, 2022

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings