I’ve instrumented a web application in Dynatrace, and all of my applications automatically inject the ruxitagentjs file with a snippet like this:
<script type="text/javascript" src="/ruxitagentjs_27SVdfjqrux_10171190702121620.js" data-dtconfig="app=aa1423c5ea7c8b7d|srms=1,1,,,|uxrgcm=100,25,300,3;100,25,300,3|featureHash=27SVdfjqrux|lastModification=1562124269798|srsr=25000|dtVersion=10171190702121620|tp=500,50,0,1|rdnt=1|uxrgce=1|uxdcw=1500|bp=2|agentUri=/ruxitagentjs_27SVdfjqrux_10171190702121620.js|reportUrl=/rb_bf71503msz|rid=RID_1447354126|rpid=-851053352|domain=syscolabs.com"></script>
But then on only one of my applications I get this injected immediately after the above snippet:
<script id="dtjsagent" type="text/javascript" src="/ruxitagentjs_27SVdfjqrux_10171190702121620.js"></script>
When this secondary dtjsagent is injected, we get a console log like this:
Duplicate agent injection detected, turning off redundant initConfig.<br>Initconfig not found or agent already initialized! This is an injection issue.<br>Duplicate agent injection detected or no initCode available, turning off redundant core.<br>WARNING: Module "2" already enabled!<br>WARNING: Module "7" already enabled!<br>WARNING: Module "V" already enabled!<br>WARNING: Module "d" already enabled!<br>WARNING: Module "f" already enabled!<br>WARNING: Module "j" already enabled!<br>WARNING: Module "q" already enabled!<br>WARNING: Module "r" already enabled!<br>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?