-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server restarts while loading modules #1378
Comments
Hey @phdavis, I've an idea as to what might be causing it based on the first exception, but need a lil' more info:
As a test, I can see you only want this to run once when the server starts? What happens if you replace the Schedule with |
Are there any other Pode functions called within the Add-PodeSchedule scriptblock? What happens if you try to import the pki module beforehand, similar to the AD one above?
Could you also log $_.ScriptStackTrace
Register-PodeEvent
|
I had some more time to try narrowing this down. It seems the worst of it is directly related to
I noticed it was We are still getting the |
I've just tried reproducing this myself, but I can't get it to throw any errors - all loads for me. While researching the error, I found that the If not, one option could be that I add a config item to force all Runspaces to load sequentially rather than parallel/async. That might resolve, or a least further reduce, the occurrence of the error 🤔 |
Thank you for digging! Based on what I can see it looks like these are getting loaded at start. These have been in use since day one more or less, so I can't really narrow it down to any in particular.
|
Describe the Bug
This seems to be a random bug that occurs only when restarting the server/service and doesn't happen every time. Usually, when we restart our API, it'll begin, get through a few tasks, then automatically restart and throw one of these exceptions. It will usually do this once or twice before finally deciding everything is loaded (?) then run normally without any further issues until we restart again.
I believe the issue is specifically while loading the
ActiveDirectory
module and/or thepki
module. I've seen other past issues similar to this, but they were much older and not necessarily the same.Steps To Reproduce
Steps to reproduce the behavior:
We're not entirely sure what's causing it, but at a high level we have a server setup like so running as a service with NSSM.
Expected Behavior
We would expect the server to either always have the exception, or never have the exception during startup. Ultimately the server does fire up fine, but when it does this it usually takes several extra minutes to straighten itself out.
At the very least we'd like to understand the root cause even if it's not resolvable on the Pode side.
Logs
Here's the main exception we see -
The other exceptions are more specific. They could be entirely unrelated but do seem to always occur around the same time during these restart cycles. I've chopped most off for brevity -
Platform
The text was updated successfully, but these errors were encountered: