"PhantomJS has crashed" when running against Office 365 OWA

222 views
Skip to first unread message

Duncan Hepple

unread,
Apr 7, 2015, 7:50:25 AM4/7/15
to phan...@googlegroups.com
Hi All,

I'm experiencing a really odd issue with a CasperJS script that I have created.  I developed a check that simulates a login to my company's Office 365 OWA using a test account, looking for a DIV element before finally logging off to clear the session.  The idea behind this script is to improve on the monitoring solutions that Microsoft have provided us (which are pretty dense) and see if a service outage is actually affecting our O365 tenancy/userbase.  So I run this script every 5 minutes with a test account and do not cache cookies/files/sessions - and this always works well for a couple of days before I start seeing this error:

PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/2c144f8a-4481-78d0-0fe445e9-2c1a4a10.dmp

No matter how long I leave it before running the script again, I always see the same "Phantomjs has crashed" outcome when running this script.  On further inspection, the debug mode shows the following at the end of the script execution:

2015-04-07T10:53:48 [DEBUG] Network - Resource request error: 299 ( "Error downloading https://outlook.office365.com/owa/?exsvurl=1&wa=wsignin1.0 - server replied: Login Timeout" ) URL: "https://outlook.office365.com/owa/?exsvurl=1&wa=wsignin1.0"
2015-04-07T10:53:48 [DEBUG] WebPage - setupFrame ""
2015-04-07T10:53:48 [DEBUG] WebPage - updateLoadingProgress: 50
2015-04-07T10:53:48 [DEBUG] WebPage - updateLoadingProgress: 100
2015-04-07T10:53:48 [DEBUG] WebPage - updateLoadingProgress: 10
PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/24d08463-39ec-9d4f-340e4ed9-1af691f0.dmp


Has anyone seen this sort of behaviour before?  It appears that the resource that I receive from outlook.office365.com causes a 299 error (does anyone know what this means?).  Strangely, if I take the same script but run it on a different machine it will work but the same then happens.  On further inspection, it even appeared that I could run the same script on the same box but as a different user and not see PhantomJS crash

I suspect that my check is being detected by Microsoft as some sort of malicious use of their service, but I'm baffled as to how I can then run the same check on the same box but as a different user.  Does this mean that PhantomJS caches results or session data in someway for a particular user?

I am using PhantomJS 1.9.8 and CasperJS 1.1.0-beta3 on CentOS 5.10 (I know it's old).  I have the seen the same problem occur on PhantomJS2.0 and CasperJS 1.0.4. on Ubuntu 14.04.  Any help would be greatly appreciated.

Cheers,

Duncan

Duncan Hepple

unread,
Apr 13, 2015, 6:47:39 AM4/13/15
to phan...@googlegroups.com
For anyone that's interested, a colleague of mine resolved this by running an STRACE on the script and finding it was creating and using cached folders under ~/.qws/share/data/Ofi\ Labs/PhantomJS/

So it wasn't Microsoft detecting PhantomJS after all, it was purely some kind of corruption from the local cache it was using under the .qws directory..  I have now put my tin foil hat away

Cheers
Reply all
Reply to author
Forward
0 new messages