Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Blockingproxy: TypeError: Cannot read property 'toString' of null #38

Closed
rodrigc opened this issue Sep 8, 2017 · 5 comments
Closed

Comments

@rodrigc
Copy link

rodrigc commented Sep 8, 2017

Originally reported here: angular/protractor#4473

I have been using some protractor scripts which have been running fine for a few months.

In the past week, I upgraded to:

  • Node Version: v8.4.0
  • Protractor Version: version 5.1.2
  • Browser(s): Chrome 61.0.3163.79
  • Chromedriver: 2.32
  • selenium standalone server: 3.5.3
  • Operating System and Version MacOS X and Windows

and suddenly I am getting this error in BlockingProxy:

BlockingProxy error: E/BlockingProxy - (node:26020) TypeError: Cannot read property 'toString' of null

I added the node --trace-warnings flag and got a stack trace:

 E/BlockingProxy - (node:26296) TypeError: Cannot read property 'toString' of null
    at replyWithError (/Users/c-craigr/work1/es-automation-test/ui-tests/node_modules/blocking-proxy/built/lib/webdriver_proxy.js:42:35)
    at WebDriverProxy.<anonymous> (/Users/c-craigr/work1/es-automation-test/ui-tests/node_modules/blocking-proxy/built/lib/webdriver_proxy.js:53:17)
    at Generator.throw (<anonymous>)
    at rejected (/Users/c-craigr/work1/es-automation-test/ui-tests/node_modules/blocking-proxy/built/lib/webdriver_proxy.js:5:62)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I tracked the problem down to this code in BlockingProxy:

https://github.com/angular/blocking-proxy/blob/master/lib/webdriver_proxy.ts#L29

 let replyWithError = (err) => {
      response.writeHead(500);
      response.write(err.toString());
      response.end();
    };

In this case err is null, so that causes an exception to be thrown.

Does anybody have an idea why err is null?

@rodrigc
Copy link
Author

rodrigc commented Sep 8, 2017

The problem seems to be in BlockingProxy, which is available in Protractor 5.1.0 and higher.
Disabling BlockingProxy made things work for me.
I put this in my exports.config:

useBlockingProxy: false

and removed the webDriverLogDir setting.

@rodrigc
Copy link
Author

rodrigc commented Sep 8, 2017

Similar problem reported here: angular/protractor#4448

@rodrigc
Copy link
Author

rodrigc commented Sep 8, 2017

In the past month, I noticed that there have been new releases of:

I'm not sure, but maybe the Selenium Standalone Server is communicating errors
in a different way to the BlockingProxy, thus triggering this error.

@heathkit
Copy link
Contributor

Thanks, sorry about this. Yes, the issue is protocol changes in selenium standalone server 3.5.x. I have a fix on the way, but it won't get picked up until the next Protractor release.

@rodrigc
Copy link
Author

rodrigc commented Oct 18, 2017

@heathkit thanks

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

2 participants