Asking this late on a Friday probably isn't ideal,...
# cfml-general
b
Asking this late on a Friday probably isn't ideal, but here we go. I have an application that generated an error in the log that a variable in the application scope wasn't defined. When I examine the logs, I can see that onApplicationStart wasn't run, indicating that it was already running. But if it was already running, that variable should have been defined. The application.cfc was called, and onSessionShart was run, again indicating that the app is already running. I have a reinitialization routine built in that, when executed, forces the application to restart and when it does, everything seems fine. Does anyone have any suggestions for diagnosing this apparent inconsistent state issue?
e
those are always fun... I don't have any specific advise beyond general troubleshooting/debugging steps... 1. Can you reproduce 2. How often does it happen 3. Any code that might remove that application var 4. Is this single server or cluster 5. Lucee or ACF and what version 6. Is the undefined error only encountered in 1 code location (is the app var accessed in multiple code locations) 7. Do you have the code on multiple servers and does the error happen everywhere or only 1 server
t
It might be that there was request that hasn't finish executing and then a reinitialization request came in & it kind of "reset" that application variable? So the previous request that didn't finish executing tried to access that application variable hence making the error?
b
My apologies for the delay in responding. We just switched over to new servers last week and there are a few issues, including this one. @Tomy Saman (Wu) Maybe. Although reinitialization requests should be rare. @Erin Brewer 1. I can reproduce it in the sense that it occurs regularly. Oddly, it just happened a few times today on both acceptance and production servers. 2. I'd say it happens a few times a day. 3. Looking at the instance where it happened today, the only time the variable is referenced is when it's initially set in the onApplicationStart and read during a file operation, so nothing could be removing it. 4. Currently it's single server. 5. ACF 2021 6. See 3 above. 7. Today the same error occurred on both the acceptance and production servers. Thanks in advance for any ideas!