Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

[phantom] Wait timeout of 5000ms expired, exiting. #22

Closed
Sc0th opened this issue Sep 12, 2017 · 10 comments
Closed

[phantom] Wait timeout of 5000ms expired, exiting. #22

Sc0th opened this issue Sep 12, 2017 · 10 comments

Comments

@Sc0th
Copy link

Sc0th commented Sep 12, 2017

Hi,

Thank you @carpii for looking at this, I have been out of town and was keen to get it up and running again.

Sadly, my lack of knowledge has me stuck again, every time I run it I get -

[error] [phantom] Wait timeout of 5000ms expired, exiting.
Wait timeout of 5000ms expired, exiting.

I tried increasing the casperjs timeout, same result, just takes longer to fail...

I have even spun up clean VM (CentOS7) and started from scratch, same results.

If you are able to offer any pointers as to where I am going wrong, would be much appreciated.

@carpii
Copy link
Contributor

carpii commented Sep 12, 2017

Hi @Sc0th

Are you sure you copied your config.js over to the new VM?

Try changing get_combined_ofx.js, so casper outputs more debug info...

var casper = require('casper').create({
    verbose: true,
    logLevel: 'debug',
    etc

This should give you an idea of which step is not progressing properly.
I've confirmed it is still working ok for me

@Sc0th
Copy link
Author

Sc0th commented Sep 13, 2017

Hey @carpii

config.js is present and correct, output from debug is as follows, hope this give you a clue as to what I have got wrong!

As an aside, I have checked the login manually using word & passcode, login without issue. I have also run a curl pull on the url below and can retrieve it successfully.

phantomjs - 1.9.6 (have also tried 2.2.1 with identical results)
casperjs - 1.1.4

[info]�[phantom] Starting...
[info]�[phantom] Running suite: 3 steps
[debug]�[phantom] opening url: https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do, HTTP GET
[debug]�[phantom] Navigation requested: url=https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do, type=Other, willNavigate=true, isMainFrame=true
[warning]�[phantom] Loading resource failed with status=fail: https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do
[debug]�[phantom] Successfully injected Casper client-side utilities
[debug]�[phantom] Login stage 1
[debug]�[phantom] Login stage 2 - Passcode and Memoerable word
[info]�[phantom] Step loginStageOne 2/3: done in 1044ms.
[info]�[phantom] Step _step 3/6: done in 1064ms.
[warning]�[phantom] Casper.waitFor() timeout
[error]�[phantom] Wait timeout of 5000ms expired, exiting.
�Wait timeout of 5000ms expired, exiting.�

@Sc0th
Copy link
Author

Sc0th commented Sep 13, 2017

looks to be something related to ssl, can't quite see how to set the '--ignore-ssl-errors=true' option, will keep poking about...

@Sc0th
Copy link
Author

Sc0th commented Sep 14, 2017

running with:

casperjs --ignore-ssl-errors=tue --ssl-protocol=any --debug=yes ./get_combined_ofx.js

provides:

[debug] [phantom] opening url: https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do, HTTP GET
[debug] [phantom] Navigation requested: url=https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do, type=Other, willNavigate=true, isMainFrame=true
2017-09-14T17:04:58 [DEBUG] Network - Resource request error: 6 ( "SSL handshake failed" ) URL: "https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do"
2017-09-14T17:04:58 [DEBUG] WebPage - updateLoadingProgress: 100
2017-09-14T17:04:58 [DEBUG] WebPage - evaluateJavaScript "(function() { return (function () {
return typeof utils === "object";
})(); })()"
2017-09-14T17:04:58 [DEBUG] WebPage - evaluateJavaScript result QVariant(bool, false)
[warning] [phantom] Loading resource failed with status=fail: https://bank.barclays.co.uk/olb/authlogin/loginAppContainer.do

@carpii
Copy link
Contributor

carpii commented Sep 14, 2017

What version of phantomjs and casperjs?

Im not seeing SSL issues, although I'm running on a Mac (with casperjs 1.1.4 and phantomjs 2.1.1)

--ignore-ssl-errors=tue 

This was just a typo?

@Sc0th
Copy link
Author

Sc0th commented Sep 14, 2017

Hi, yes it was a typo, does not work when my phat fingers get it right either.

[root@nox barclayscrape]# phantomjs --version
1.9.6
[root@nox barclayscrape]# casperjs --version
1.1.4
[root@nox barclayscrape]#

I have tried with 2.1.1 also, made no odds.

What is frustrating is that the arguments seem to be ignored, the head of the debug output states -

2017-09-14T18:58:35 [DEBUG] Phantom - execute: Configuration
2017-09-14T18:58:35 [DEBUG] 0 objectName : ""
2017-09-14T18:58:35 [DEBUG] 1 cookiesFile : ""
2017-09-14T18:58:35 [DEBUG] 2 diskCacheEnabled : "false"
2017-09-14T18:58:35 [DEBUG] 3 maxDiskCacheSize : "-1"
2017-09-14T18:58:35 [DEBUG] 4 ignoreSslErrors : "false"
2017-09-14T18:58:35 [DEBUG] 5 localToRemoteUrlAccessEnabled : "false"
2017-09-14T18:58:35 [DEBUG] 6 outputEncoding : "UTF-8"
2017-09-14T18:58:35 [DEBUG] 7 proxyType : "http"
2017-09-14T18:58:35 [DEBUG] 8 proxy : ":1080"
2017-09-14T18:58:35 [DEBUG] 9 proxyAuth : ":"
2017-09-14T18:58:35 [DEBUG] 10 scriptEncoding : "UTF-8"
2017-09-14T18:58:35 [DEBUG] 11 webSecurityEnabled : "true"
2017-09-14T18:58:35 [DEBUG] 12 offlineStoragePath : ""
2017-09-14T18:58:35 [DEBUG] 13 offlineStorageDefaultQuota : "-1"
2017-09-14T18:58:35 [DEBUG] 14 printDebugMessages : "true"
2017-09-14T18:58:35 [DEBUG] 15 javascriptCanOpenWindows : "true"
2017-09-14T18:58:35 [DEBUG] 16 javascriptCanCloseWindows : "true"
2017-09-14T18:58:35 [DEBUG] 17 sslProtocol : "sslv3"

I suspect getting the two ssl related variables to switch would fix the problem I am seeing. If I could figure out how... :)

@carpii
Copy link
Contributor

carpii commented Sep 14, 2017

Do you get a different error if you prevent it trying to choose sslv3?

--ssl-protocol=tlsv1

For whatever reason, when I run your command, the ignore-ssl option does seem to be getting passed through to phantomjs properly.
I'd stick with trying to get phantomjs 2.1.1 working, I seem to recall it contains other unrelated fixes which are needed.

casperjs --ignore-ssl-errors=true --ssl-protocol=any --debug=yes ./get_combined_ofx.js
2017-09-14T12:02:31 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=<filename>' to enable persistent cookie storage)
2017-09-14T12:02:32 [DEBUG] Set  "http"  proxy to:  "" : 1080
2017-09-14T12:02:32 [DEBUG] Phantom - execute: Configuration
2017-09-14T12:02:32 [DEBUG]      0 objectName : ""
2017-09-14T12:02:32 [DEBUG]      1 cookiesFile : ""
2017-09-14T12:02:32 [DEBUG]      2 diskCacheEnabled : "false"
2017-09-14T12:02:32 [DEBUG]      3 maxDiskCacheSize : "-1"
2017-09-14T12:02:32 [DEBUG]      4 diskCachePath : ""
2017-09-14T12:02:32 [DEBUG]      5 ignoreSslErrors : "true"

@Sc0th
Copy link
Author

Sc0th commented Sep 14, 2017

Woooo Hoooo!

Blew it all away, pulled fresh from git, updated phantomjs to 2.1.1, and it bloomin' well works,

Thank you so much for your help and guidance!

@carpii
Copy link
Contributor

carpii commented Sep 14, 2017

No probs. Glad you got it working, because I was just about out of ideas ;-D

@carpii
Copy link
Contributor

carpii commented Oct 22, 2017

@russss Could we close this ticket please?

@russss russss closed this as completed Oct 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants