selenodium / selenodium-grid

Selenium Hub/Grid reimplementation in NodeJS
Apache License 2.0
8 stars 3 forks source link

Node 0.12 and io.js support #13

Open TheFifthFreedom opened 9 years ago

TheFifthFreedom commented 9 years ago

First of all, I'm glad to see someone finally open-sourcing a serious and well-maintained re-implementeation of the Selenium Grid using NodeJS: thanks @arikon ! Now since it seems that selenodium-grid is not in the npm registry as of yet, instead of running npm -g install selenodium-grid, I tried to install it manually. However when running npm install (with an updated npm otherwise the ˆ signs in package.son will not be interpreted properly) I encountered an error when trying to rebuild node-gyp:

> gaze@0.6.4 install /Users/lmazou/Downloads/selenodium-grid-dev/node_modules/luster-guard/node_modules/gaze
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
  CXX(target) Release/obj.target/pathwatcher/src/main.o
In file included from ../src/main.cc:21:
In file included from ../src/common.h:26:
../node_modules/nan/nan.h:339:13: error: no member named 'New' in 'v8::String'
    return  _NAN_ERROR(v8::Exception::Error, errmsg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'ThrowException' in
      namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:343:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::Error, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:348:9: error: no type named 'ThrowException' in
      namespace 'v8'
    v8::ThrowException(error);
    ~~~~^
../node_modules/nan/nan.h:355:65: error: no member named 'New' in 'v8::String'
    v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(msg));
                                                    ~~~~~~~~~~~~^
../node_modules/nan/nan.h:357:26: error: no member named 'New' in 'v8::String'
    obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber));
             ~~~~~~~~~~~~^
../node_modules/nan/nan.h:369:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::TypeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'ThrowException' in
      namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:373:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:377:12: error: no member named 'New' in 'v8::String'
    return _NAN_ERROR(v8::Exception::RangeError, errmsg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'ThrowException' in
      namespace 'v8'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:11: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
      ~~~~^
../node_modules/nan/nan.h:381:5: error: no member named 'New' in 'v8::String'
    _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:324:26: note: expanded from macro '_NAN_THROW_ERROR'
      v8::ThrowException(_NAN_ERROR(fun, errmsg));                             \
                         ^~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:50: note: expanded from macro '_NAN_ERROR'
# define _NAN_ERROR(fun, errmsg) fun(v8::String::New(errmsg))
                                     ~~~~~~~~~~~~^
../node_modules/nan/nan.h:727:49: error: too few arguments to function call,
      single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/lmazou/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:3: note: 'New' declared
      here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../src/main.cc:21:
In file included from ../src/common.h:26:
../node_modules/nan/nan.h:733:49: error: too few arguments to function call,
      single argument 'isolate' was not specified
    v8::Local<v8::Object> obj = v8::Object::New();
                                ~~~~~~~~~~~~~~~ ^
/Users/lmazou/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:3: note: 'New' declared
      here
  static Local<Object> New(Isolate* isolate);
  ^
In file included from ../src/main.cc:21:
In file included from ../src/common.h:26:
../node_modules/nan/nan.h:740:12: error: no member named 'Dispose' in
      'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Dispose();
    ~~~~~~ ^
../node_modules/nan/nan.h:741:12: error: no member named 'Clear' in
      'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    handle.Clear();
    ~~~~~~ ^
../node_modules/nan/nan.h:746:39: error: no member named 'NewSymbol' in
      'v8::String'; did you mean 'IsSymbol'?
    NanPersistentToLocal(handle)->Set(NanSymbol("callback"), fn);
                                      ^~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:181:38: note: expanded from macro 'NanSymbol'
#define NanSymbol(value) v8::String::NewSymbol(value)
                         ~~~~~~~~~~~~^
/Users/lmazou/.node-gyp/0.12.0/deps/v8/include/v8.h:1379:8: note: 'IsSymbol'
      declared here
  bool IsSymbol() const;
       ^
In file included from ../src/main.cc:21:
In file included from ../src/common.h:26:
../node_modules/nan/nan.h:746:39: error: call to non-static member function
      without an object argument
    NanPersistentToLocal(handle)->Set(NanSymbol("callback"), fn);
                                      ^~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:181:38: note: expanded from macro 'NanSymbol'
#define NanSymbol(value) v8::String::NewSymbol(value)
                         ~~~~~~~~~~~~^~~~~~~~~
../node_modules/nan/nan.h:750:46: error: no member named 'NewSymbol' in
      'v8::String'; did you mean 'IsSymbol'?
    return NanPersistentToLocal(handle)->Get(NanSymbol("callback"))
                                             ^~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:181:38: note: expanded from macro 'NanSymbol'
#define NanSymbol(value) v8::String::NewSymbol(value)
                         ~~~~~~~~~~~~^
/Users/lmazou/.node-gyp/0.12.0/deps/v8/include/v8.h:1379:8: note: 'IsSymbol'
      declared here
  bool IsSymbol() const;
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/pathwatcher/src/main.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/lmazou/Downloads/selenodium-grid-dev/node_modules/luster-guard/node_modules/gaze
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.7.1
npm ERR! code ELIFECYCLE

npm ERR! gaze@0.6.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gaze@0.6.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the gaze package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls gaze
npm ERR! There is likely additional logging output above.

After a bit of digging around, I correlated this issue with this one: https://github.com/TooTallNate/node-gyp/issues/489. This seems to happen on OS X with NodeJS versions beyond 0.10 (I'm running Yosemite 10.10.2 with NodeJS 0.12.0). Just like the issue suggests, downgrading to NodeJS 0.10.X does the trick. So not something you can do much about @arikon, but I thought I'd let you know!

arikon commented 9 years ago

@TheFifthFreedom Thanks for the report!

Yes, the problem is with gaze and node-gyp. I've also hit it.

First of all, I'm glad to see someone finally open-sourcing a serious and well-maintained re-implementation of the Selenium Grid using NodeJS

It is still a work in progress. I will be glad if someone could join the forces to make it a really good reimplementation.

For now I'm in a stage of reimplementing registry and store so it:

TheFifthFreedom commented 9 years ago

Well I'd be glad to help in any way I can - it will just take me a bit of time to get acclimated with your implementation first. One other thing I've noticed is that once I've installed the necessary dependencies via npm install after downgrading NodeJS version, I run ./bin/selenodium-grid as you described in your readme, but as soon as I try to attach a node using the Selenium Standalone Server using java -jar selenium-server-standalone-2.45.0.jar -role node -hub http://127.0.0.1:4444/grid/register, the node can't connect to the hub somehow:

Hub log

17:02:02.92 log.js:45 [info]: Hub is listening on http://localhost:4444
17:02:54.62 log.js:45 [info]: ::ffff:127.0.0.1:59114 -->     GET /grid/api/hub HTTP/1.1
17:02:54.68 log.js:45 [info]: ::ffff:127.0.0.1:59114 <== 200 GET /grid/api/hub HTTP/1.1 -
17:02:54.91 log.js:45 [info]: ::ffff:127.0.0.1:59114 -->     POST /grid/register HTTP/1.1
17:02:54.92 log.js:45 [info]: ::ffff:127.0.0.1:59114 <== 400 POST /grid/register HTTP/1.1 -
17:02:59.99 log.js:45 [info]: ::ffff:127.0.0.1:59115 -->     GET /grid/api/proxy?id=http://10.211.100.178:5555 HTTP/1.1
17:02:59.100 log.js:45 [info]: ::ffff:127.0.0.1:59115 <== 404 GET /grid/api/proxy?id=http://10.211.100.178:5555 HTTP/1.1 -
17:03:05.08 log.js:45 [info]: ::ffff:127.0.0.1:59117 -->     GET /grid/api/proxy?id=http://10.211.100.178:5555 HTTP/1.1
17:03:05.15 log.js:45 [info]: ::ffff:127.0.0.1:59117 <== 404 GET /grid/api/proxy?id=http://10.211.100.178:5555 HTTP/1.1 -
^C17:03:08.71 log.js:45 [info]: Stopping grid

Node log

17:02:52.442 INFO - Launching a selenium grid node
17:02:54.141 INFO - Java: Oracle Corporation 24.71-b01
17:02:54.141 INFO - OS: Mac OS X 10.10.2 x86_64
17:02:54.163 INFO - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
17:02:54.451 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: MAC
17:02:54.530 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
17:02:54.531 INFO - Version Jetty/5.1.x
17:02:54.542 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
17:02:54.543 INFO - Started HttpContext[/selenium-server,/selenium-server]
17:02:54.543 INFO - Started HttpContext[/,/]
17:02:54.768 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@5e3c782
17:02:54.768 INFO - Started HttpContext[/wd,/wd]
17:02:54.780 INFO - Started SocketListener on 0.0.0.0:5555
17:02:54.780 INFO - Started org.openqa.jetty.jetty.Server@658762b1
17:02:54.893 INFO - using the json request : {"class":"org.openqa.grid.common.RegistrationRequest","configuration":{"register":true,"port":5555,"host":"10.211.100.178","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":5,"role":"node","hubHost":"127.0.0.1","registerCycle":5000,"hub":"http://127.0.0.1:4444/grid/register","hubPort":4444,"url":"http://10.211.100.178:5555","remoteHost":"http://10.211.100.178:5555"},"capabilities":[{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*googlechrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*iexplore","maxInstances":1},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"chrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"internet explorer","maxInstances":1}]}
17:02:54.894 INFO - Starting auto register thread. Will try to register every 5000 ms.
17:02:54.894 INFO - Registering the node to hub :http://127.0.0.1:4444/grid/register
17:02:54.917 INFO - couldn't register this node : Error sending the registration request.
17:03:00.000 INFO - couldn't register this node : Hub is down or not responding: Hub is down or not responding.
17:03:05.018 INFO - couldn't register this node : Hub is down or not responding: Hub is down or not responding.
^C17:03:06.268 INFO - Shutting down...

Would you happen to know what's going on? (I'm running the dev branch code)

TheFifthFreedom commented 9 years ago

It looks like the issue happens when the Selenium node is sending a POST request which is routed to /grid/register - as per register.js:

module.exports = function(req, res) {
    if (!req.data) {
        return q.reject(apps.content('Invalid parameters', 'text/plain', 400));
    }

    return q.invoke(registry, 'addNode', req.data)
        .catch(function() {
            return q.reject(apps.content('Invalid parameters', 'text/plain', 400));
        })
        .then(function(success) {
            if (success) {
                log.info('Register new node: %s', JSON.stringify(req.data));
                return apps.content('ok');
            }
            return q.reject(apps.content('Invalid parameters', 'text/plain', 400));
        });
};

the code is trying to access req.data which doesn't exist. I did try to print the JSON request the server receives from the Selenium node:

{ version: [ 1, 1 ],
  method: 'POST',
  path: '/grid/register',
  _pathInfo: null,
  scriptName: '',
  scheme: 'http',
  hostname: 'localhost',
  port: 4444,
  host: 'localhost:4444',
  remoteHost: '::ffff:127.0.0.1',
  remotePort: 55047,
  url: 'http://localhost:4444/grid/register',
  body: 
   { read: [Function],
     forEach: [Function],
     close: [Function],
     node: 
      { _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        socket: [Object],
        connection: [Object],
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        trailers: {},
        _pendings: [],
        _pendingIndex: 0,
        url: '/grid/register',
        method: 'POST',
        statusCode: null,
        client: [Object],
        _consuming: true,
        _dumped: false,
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        upgrade: false,
        pipe: [Function],
        addListener: [Function],
        on: [Function],
        pause: [Function],
        resume: [Function],
        read: [Function] } },
  headers: 
   { 'content-length': '970',
     'content-type': 'text/plain; charset=UTF-8',
     host: 'localhost:4444',
     connection: 'Keep-Alive',
     'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',
     'accept-encoding': 'gzip,deflate' },
  node: 
   { _readableState: 
      { highWaterMark: 16384,
        buffer: [],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: false,
        ended: true,
        endEmitted: false,
        reading: false,
        calledRead: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        objectMode: false,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: true,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events: 
      { error: [Object],
        end: [Object],
        data: [Function],
        readable: [Function],
        close: [Function] },
     _maxListeners: 10,
     socket: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     connection: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     httpVersion: '1.1',
     complete: true,
     headers: 
      { 'content-length': '970',
        'content-type': 'text/plain; charset=UTF-8',
        host: 'localhost:4444',
        connection: 'Keep-Alive',
        'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',
        'accept-encoding': 'gzip,deflate' },
     trailers: {},
     _pendings: [],
     _pendingIndex: 0,
     url: '/grid/register',
     method: 'POST',
     statusCode: null,
     client: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     _consuming: true,
     _dumped: false,
     httpVersionMajor: 1,
     httpVersionMinor: 1,
     upgrade: false,
     pipe: [Function],
     addListener: [Function],
     on: [Function],
     pause: [Function],
     resume: [Function],
     read: [Function] },
  nodeRequest: 
   { _readableState: 
      { highWaterMark: 16384,
        buffer: [],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: false,
        ended: true,
        endEmitted: false,
        reading: false,
        calledRead: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        objectMode: false,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: true,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events: 
      { error: [Object],
        end: [Object],
        data: [Function],
        readable: [Function],
        close: [Function] },
     _maxListeners: 10,
     socket: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     connection: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     httpVersion: '1.1',
     complete: true,
     headers: 
      { 'content-length': '970',
        'content-type': 'text/plain; charset=UTF-8',
        host: 'localhost:4444',
        connection: 'Keep-Alive',
        'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',
        'accept-encoding': 'gzip,deflate' },
     trailers: {},
     _pendings: [],
     _pendingIndex: 0,
     url: '/grid/register',
     method: 'POST',
     statusCode: null,
     client: 
      { _connecting: false,
        _handle: [Object],
        _readableState: [Object],
        readable: true,
        domain: null,
        _events: [Object],
        _maxListeners: 10,
        _writableState: [Object],
        writable: true,
        allowHalfOpen: true,
        onend: [Function],
        destroyed: false,
        errorEmitted: false,
        bytesRead: 1430,
        _bytesDispatched: 440,
        _pendingData: null,
        _pendingEncoding: '',
        server: [Object],
        _idleTimeout: 60000,
        _idleNext: [Object],
        _idlePrev: [Object],
        _idleStart: 1426795070410,
        parser: [Object],
        ondata: [Function],
        _peername: [Object],
        _httpMessage: [Object] },
     _consuming: true,
     _dumped: false,
     httpVersionMajor: 1,
     httpVersionMinor: 1,
     upgrade: false,
     pipe: [Function],
     addListener: [Function],
     on: [Function],
     pause: [Function],
     resume: [Function],
     read: [Function] },
  nodeConnection: 
   { _connecting: false,
     _handle: 
      { fd: 14,
        writeQueueSize: 0,
        owner: [Circular],
        onread: [Function: onread],
        reading: true },
     _readableState: 
      { highWaterMark: 16384,
        buffer: [],
        length: 0,
        pipes: null,
        pipesCount: 0,
        flowing: false,
        ended: false,
        endEmitted: false,
        reading: true,
        calledRead: true,
        sync: false,
        needReadable: true,
        emittedReadable: false,
        readableListening: false,
        objectMode: false,
        defaultEncoding: 'utf8',
        ranOut: false,
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events: 
      { end: [Object],
        finish: [Function: onSocketFinish],
        _socketEnd: [Function: onSocketEnd],
        drain: [Function: ondrain],
        timeout: [Object],
        error: [Function],
        close: [Object] },
     _maxListeners: 10,
     _writableState: 
      { highWaterMark: 16384,
        objectMode: false,
        needDrain: false,
        ending: false,
        ended: false,
        finished: false,
        decodeStrings: false,
        defaultEncoding: 'utf8',
        length: 0,
        writing: false,
        sync: false,
        bufferProcessing: false,
        onwrite: [Function],
        writecb: null,
        writelen: 0,
        buffer: [] },
     writable: true,
     allowHalfOpen: true,
     onend: [Function],
     destroyed: false,
     errorEmitted: false,
     bytesRead: 1430,
     _bytesDispatched: 440,
     _pendingData: null,
     _pendingEncoding: '',
     server: 
      { domain: null,
        _events: [Object],
        _maxListeners: 10,
        _connections: 1,
        connections: [Getter/Setter],
        _handle: [Object],
        _usingSlaves: false,
        _slaves: [],
        allowHalfOpen: true,
        httpAllowHalfOpen: true,
        timeout: 120000,
        destroy: [Function],
        _connectionKey: '6::::4444' },
     _idleTimeout: 60000,
     _idleNext: { _idleNext: [Circular], _idlePrev: [Circular] },
     _idlePrev: { _idleNext: [Circular], _idlePrev: [Circular] },
     _idleStart: 1426795070410,
     parser: 
      { _headers: [],
        _url: '',
        onHeaders: [Function: parserOnHeaders],
        onHeadersComplete: [Function: parserOnHeadersComplete],
        onBody: [Function: parserOnBody],
        onMessageComplete: [Function: parserOnMessageComplete],
        socket: [Circular],
        incoming: [Object],
        maxHeaderPairs: 2000,
        onIncoming: [Function] },
     ondata: [Function],
     _peername: { address: '::ffff:127.0.0.1', family: 'IPv6', port: 55047 },
     _httpMessage: 
      { domain: null,
        _events: [Object],
        _maxListeners: 10,
        output: [],
        outputEncodings: [],
        writable: true,
        _last: false,
        chunkedEncoding: false,
        shouldKeepAlive: true,
        useChunkedEncodingByDefault: true,
        sendDate: true,
        _hasBody: true,
        _trailer: '',
        finished: false,
        _hangupClose: false,
        socket: [Circular],
        connection: [Circular] } },
  query: {},
  handleJsonResponse: [Function] }

and there's indeed no data to be found, which explains the node rejection. What I believe the server is expecting is something along those lines:

{"class":"org.openqa.grid.common.RegistrationRequest","configuration":{"register":true,"port":5555,"host":"10.211.100.178","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","maxSession":5,"role":"node","hubHost":"localhost","registerCycle":5000,"hub":"http://localhost:4444/grid/register","hubPort":4444,"url":"http://10.211.100.178:5555","remoteHost":"http://10.211.100.178:5555"},"capabilities":[{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*googlechrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"Selenium","browserName":"*iexplore","maxInstances":1},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"firefox","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"chrome","maxInstances":5},{"platform":"MAC","seleniumProtocol":"WebDriver","browserName":"internet explorer","maxInstances":1}]}

which is standard Selenium Grid request format. I haven't figured out yet why that happens - could it have something to do with the http server implementation that is used here, which comes from q-io?

arikon commented 9 years ago

@TheFifthFreedom It was fixed here https://github.com/selenodium/selenodium-grid/pull/14.

Try the latest commit from dev.

arikon commented 9 years ago

Reopening for the gyp-rebuild

arikon commented 9 years ago

@TheFifthFreedom Please open separate issue the next time, to not mix things up ;)

TheFifthFreedom commented 9 years ago

You're right - my mistake, sorry about that!

arikon commented 9 years ago

@TheFifthFreedom Have you figured out how to launch selenodium-grid?

arikon commented 9 years ago

@TheFifthFreedom I've created a bunch of issues if you want to help. For now all the modifications should be made to the feature/new-registry branch.

eranimo commented 9 years ago

Any update on this? I still have problems on latest version of node

arikon commented 9 years ago

@eranimo No updates for now.

The problem is in the luster-guard https://github.com/nodules/luster-guard dependency gaze https://github.com/shama/gaze

Any help is welcomed.

arikon commented 9 years ago

https://github.com/shama/gaze/issues/173