I've instrumented a web application in Dynatrace, and all of my applications automatically inject the ruxitagentjs file with a snippet like this:
But then on only one of my applications I get this injected immediately after the above snippet:
When this secondary dtjsagent is injected, we get a console log like this:
Duplicate agent injection detected, turning off redundant initConfig.
Initconfig not found or agent already initialized! This is an injection issue.
Duplicate agent injection detected or no initCode available, turning off redundant core.
WARNING: Module "2" already enabled!
WARNING: Module "7" already enabled!
WARNING: Module "V" already enabled!
WARNING: Module "d" already enabled!
WARNING: Module "f" already enabled!
WARNING: Module "j" already enabled!
WARNING: Module "q" already enabled!
WARNING: Module "r" already enabled!
WARNING: Module "x" already enabled!
When the application has a double injection like this, NO USER ACTIONS or RUM occurs.
Here's the really weird part: The first time a user loads this app everything is fine and works normally. Afterwards, when the user refreshes or loads another page, the duplicate injection occurs. If the user clears their cookies or opens an incognito/private browser the injection is fine. It's only starting with the 2nd page load action during a session that a duplicate injection occurs.
I'm so confused! Has anyone else encountered this type of situation?
Solved! Go to Solution.
The question is: do you have manual injection on tho single application with double agents? Is it still available when you disable rum for this application? Are you sure that only this application is covering requests from it’s uri pattern?
Negative, no manual injection.
Yes, sure that no other applications match this uri. However, when I disable RUM on the application the ruxitagentjs is still injected. I continue to get duplicate injection. Not sure how or why, but maybe a cache is preventing the injection from leaving?
Ok another idea. Please confirm if I am correct. You have some application process working on tomcat for example and then you have nginx/apache as reverse proxy? If yes than go to process group related to tomcat and disable injecting rum on this level. This should help 🙂
Yes, we've got nginx serving as a reverse proxy for tomcat. However, that's the setup for _all_ of the applications, and they're actually powered by the exact same nginx/tomcat with domain names causing tomcat to load a different context path. Why would this only affect 1 webapp and not all 5 of them?
It may be case for support, but I've seen such issue before in this context.
So, it's been about 12 hours since I disabled the RUM on the problem app, and now that some caches have had a chance to clear I am no longer seeing any injection in the problem app. I haven't restarted any processes or disabled RUM anywhere else.
RUM injection still working perfectly for all other apps served by the same host.
I had faced almost a similar issue with an application in the past. I found that the same application was instrumented by AppMon and UEM feature was enabled on it.
Once I disabled the UEM from the AppMon then duplication of scripts gone and UEM started work accordingly.
Ah, unfortunately we're not using AppMon but rather Dynatrace. These are, evidently, separate products. But thanks for the input!