{"action":"created","issue":{"url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/30","labels_url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/30/comments","events_url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/30/events","html_url":"https://github.com/selenodium/selenodium-grid/issues/30","id":66226703,"number":30,"title":"Could not create session because of error: [object Object]","user":{"login":"TheFifthFreedom","id":6109621,"avatar_url":"https://avatars.githubusercontent.com/u/6109621?v=3","gravatar_id":"","url":"https://api.github.com/users/TheFifthFreedom","html_url":"https://github.com/TheFifthFreedom","followers_url":"https://api.github.com/users/TheFifthFreedom/followers","following_url":"https://api.github.com/users/TheFifthFreedom/following{/other_user}","gists_url":"https://api.github.com/users/TheFifthFreedom/gists{/gist_id}","starred_url":"https://api.github.com/users/TheFifthFreedom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheFifthFreedom/subscriptions","organizations_url":"https://api.github.com/users/TheFifthFreedom/orgs","repos_url":"https://api.github.com/users/TheFifthFreedom/repos","events_url":"https://api.github.com/users/TheFifthFreedom/events{/privacy}","received_events_url":"https://api.github.com/users/TheFifthFreedom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/selenodium/selenodium-grid/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/selenodium/selenodium-grid/milestones/1","html_url":"https://github.com/selenodium/selenodium-grid/milestones/1.0","labels_url":"https://api.github.com/repos/selenodium/selenodium-grid/milestones/1/labels","id":1050815,"number":1,"title":"1.0","description":"","creator":{"login":"arikon","id":75247,"avatar_url":"https://avatars.githubusercontent.com/u/75247?v=3","gravatar_id":"","url":"https://api.github.com/users/arikon","html_url":"https://github.com/arikon","followers_url":"https://api.github.com/users/arikon/followers","following_url":"https://api.github.com/users/arikon/following{/other_user}","gists_url":"https://api.github.com/users/arikon/gists{/gist_id}","starred_url":"https://api.github.com/users/arikon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikon/subscriptions","organizations_url":"https://api.github.com/users/arikon/orgs","repos_url":"https://api.github.com/users/arikon/repos","events_url":"https://api.github.com/users/arikon/events{/privacy}","received_events_url":"https://api.github.com/users/arikon/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":8,"state":"open","created_at":"2015-04-02T18:53:41Z","updated_at":"2015-04-22T07:32:02Z","due_on":null,"closed_at":null},"comments":24,"created_at":"2015-04-03T20:58:20Z","updated_at":"2015-04-22T18:15:28Z","closed_at":null,"body":"Sorry I didn't check-in with you sooner @arikon - https://github.com/selenodium/selenodium-grid/pull/14 did indeed fix the node registration issue I was experiencing! I've been fiddling around since then trying to run a very basic test against a browser via selenodium:\r\n\r\n```python\r\nfrom selenium import webdriver\r\nfrom selenium.webdriver.common.keys import Keys\r\nfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilities\r\n\r\ndriver = webdriver.Remote(\r\n    command_executor='http://localhost:4444/wd/hub',\r\n    desired_capabilities=DesiredCapabilities.CHROME)\r\ndriver.get('http://www.google.com')\r\nhtml = driver.page_source\r\nprint (html)\r\ndriver.close()\r\n```\r\nafter having registered a node using Selenium's standalone server. However it seems that selenodium is unable to create a new session after placing a request to the `requestServlet`. I traced the session creation calls from there (`Registry.js` -> `SessionQueue.js` -> `NodeSet.js` -> `Node.js` -> `NodeSlot.js`) which gets me to this piece of code:\r\n\r\n```javascript\r\ngetNewSession: function(req) {\r\n        var self = this;\r\n        if (self.isLocked()) {\r\n            log.debug('Slot on node with ID=%s is locked, skip', self.node.getId());\r\n            return q(null);\r\n        }\r\n\r\n        // match capabilities\r\n        var caps = req.capabilities;\r\n        if (!self.hasCapability(caps)) {\r\n            log.debug('Capabilities for slot on node with ID=%s do not match', self.node.getId());\r\n            log.debug('* desired capabilities: %j', caps);\r\n            log.debug('* slot capabilities: %j', self.caps);\r\n            return q(null);\r\n        }\r\n\r\n        this.lock();\r\n\r\n        req = extend({retries: 2}, req);\r\n        return self.getDriver().getNewSessionFromNode(req, self.node)\r\n            .catch(function(err) {\r\n                // unlock node on session opening error\r\n                self.unlock();\r\n                return q.reject(err);\r\n            })\r\n            .then(function(res) {\r\n                // save session on success\r\n                self.session = new Session(self, res.sessionId, res.capabilities, res.desiredCapabilities);\r\n                return self.session;\r\n            });\r\n    },\r\n```\r\nNow it appears the session declaration and allocation is never taken, which leads me to believe that `getNewSessionFromNode` is not fulfilled. That function is called in `CommonImpl.js`:\r\n```javascript\r\ngetNewSessionFromNode: function(req, node) {\r\n        var self = this,\r\n            caps = self.getRequestCapabilities(req);\r\n\r\n        // send open session request\r\n        return self.proxyRequestToNode(req, node)\r\n            .then(function(res) {\r\n                // process response\r\n                console.log('hello');\r\n                return self.parseProxyResponse(res);\r\n            })\r\n            .spread(function(sessionId, resCaps) {\r\n                return {\r\n                    sessionId: sessionId,\r\n                    capabilities: resCaps,\r\n                    desiredCapabilities: caps\r\n                }\r\n            })\r\n            .catch(function(err) {\r\n                log.debug('Error ocured during session opening on node with ID=%s', node.getId());\r\n                log.debug(err.stack || err);\r\n                return q.reject(err);\r\n            });\r\n    },\r\n```\r\nAnd again, here it looks like it's `self.proxyRequestToNode(req, node)` that isn't being fulfilled. But the only thing that this function does is call `apps.processJsonBody` from `http-apps.js`, and nothing something to be wrong there, as it returns exactly what it should:\r\n\r\n```\r\n{ version: [ 1, 1 ],\r\n  method: 'GET',\r\n  path: '/grid/api/proxy?id=http://10.211.101.57:5555',\r\n  _pathInfo: null,\r\n  scriptName: '',\r\n  scheme: 'http',\r\n  hostname: '10.211.101.57',\r\n  port: 4444,\r\n  host: '10.211.101.57:4444',\r\n  remoteHost: '::ffff:10.211.101.57',\r\n  remotePort: 54457,\r\n  url: 'http://10.211.101.57:4444/grid/api/proxy?id=http://10.211.101.57:5555',\r\n  body: \r\n   { read: [Function],\r\n     forEach: [Function],\r\n     close: [Function],\r\n     node: \r\n      { _readableState: [Object],\r\n        readable: false,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        socket: [Object],\r\n        connection: [Object],\r\n        httpVersion: '1.1',\r\n        complete: true,\r\n        headers: [Object],\r\n        trailers: {},\r\n        _pendings: [],\r\n        _pendingIndex: 0,\r\n        url: '/grid/api/proxy?id=http://10.211.101.57:5555',\r\n        method: 'GET',\r\n        statusCode: null,\r\n        client: [Object],\r\n        _consuming: true,\r\n        _dumped: false,\r\n        httpVersionMajor: 1,\r\n        httpVersionMinor: 1,\r\n        upgrade: false,\r\n        pipe: [Function],\r\n        addListener: [Function],\r\n        on: [Function],\r\n        pause: [Function],\r\n        resume: [Function],\r\n        read: [Function] } },\r\n  headers: \r\n   { host: '10.211.101.57:4444',\r\n     connection: 'Keep-Alive',\r\n     'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',\r\n     'accept-encoding': 'gzip,deflate' },\r\n  node: \r\n   { _readableState: \r\n      { highWaterMark: 16384,\r\n        buffer: [],\r\n        length: 0,\r\n        pipes: null,\r\n        pipesCount: 0,\r\n        flowing: false,\r\n        ended: true,\r\n        endEmitted: true,\r\n        reading: false,\r\n        calledRead: true,\r\n        sync: false,\r\n        needReadable: true,\r\n        emittedReadable: false,\r\n        readableListening: false,\r\n        objectMode: false,\r\n        defaultEncoding: 'utf8',\r\n        ranOut: false,\r\n        awaitDrain: 0,\r\n        readingMore: false,\r\n        decoder: null,\r\n        encoding: null },\r\n     readable: false,\r\n     domain: null,\r\n     _events: \r\n      { error: [Object],\r\n        end: [Object],\r\n        data: [Function],\r\n        readable: [Function],\r\n        close: [Function] },\r\n     _maxListeners: 10,\r\n     socket: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     connection: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     httpVersion: '1.1',\r\n     complete: true,\r\n     headers: \r\n      { host: '10.211.101.57:4444',\r\n        connection: 'Keep-Alive',\r\n        'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',\r\n        'accept-encoding': 'gzip,deflate' },\r\n     trailers: {},\r\n     _pendings: [],\r\n     _pendingIndex: 0,\r\n     url: '/grid/api/proxy?id=http://10.211.101.57:5555',\r\n     method: 'GET',\r\n     statusCode: null,\r\n     client: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     _consuming: true,\r\n     _dumped: false,\r\n     httpVersionMajor: 1,\r\n     httpVersionMinor: 1,\r\n     upgrade: false,\r\n     pipe: [Function],\r\n     addListener: [Function],\r\n     on: [Function],\r\n     pause: [Function],\r\n     resume: [Function],\r\n     read: [Function] },\r\n  nodeRequest: \r\n   { _readableState: \r\n      { highWaterMark: 16384,\r\n        buffer: [],\r\n        length: 0,\r\n        pipes: null,\r\n        pipesCount: 0,\r\n        flowing: false,\r\n        ended: true,\r\n        endEmitted: true,\r\n        reading: false,\r\n        calledRead: true,\r\n        sync: false,\r\n        needReadable: true,\r\n        emittedReadable: false,\r\n        readableListening: false,\r\n        objectMode: false,\r\n        defaultEncoding: 'utf8',\r\n        ranOut: false,\r\n        awaitDrain: 0,\r\n        readingMore: false,\r\n        decoder: null,\r\n        encoding: null },\r\n     readable: false,\r\n     domain: null,\r\n     _events: \r\n      { error: [Object],\r\n        end: [Object],\r\n        data: [Function],\r\n        readable: [Function],\r\n        close: [Function] },\r\n     _maxListeners: 10,\r\n     socket: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     connection: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     httpVersion: '1.1',\r\n     complete: true,\r\n     headers: \r\n      { host: '10.211.101.57:4444',\r\n        connection: 'Keep-Alive',\r\n        'user-agent': 'Apache-HttpClient/4.3.6 (java 1.5)',\r\n        'accept-encoding': 'gzip,deflate' },\r\n     trailers: {},\r\n     _pendings: [],\r\n     _pendingIndex: 0,\r\n     url: '/grid/api/proxy?id=http://10.211.101.57:5555',\r\n     method: 'GET',\r\n     statusCode: null,\r\n     client: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 190,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Object],\r\n        _idleStart: 1428094579248,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     _consuming: true,\r\n     _dumped: false,\r\n     httpVersionMajor: 1,\r\n     httpVersionMinor: 1,\r\n     upgrade: false,\r\n     pipe: [Function],\r\n     addListener: [Function],\r\n     on: [Function],\r\n     pause: [Function],\r\n     resume: [Function],\r\n     read: [Function] },\r\n  nodeConnection: \r\n   { _connecting: false,\r\n     _handle: \r\n      { fd: 17,\r\n        writeQueueSize: 0,\r\n        owner: [Circular],\r\n        onread: [Function: onread],\r\n        reading: true },\r\n     _readableState: \r\n      { highWaterMark: 16384,\r\n        buffer: [],\r\n        length: 0,\r\n        pipes: null,\r\n        pipesCount: 0,\r\n        flowing: false,\r\n        ended: false,\r\n        endEmitted: false,\r\n        reading: true,\r\n        calledRead: true,\r\n        sync: false,\r\n        needReadable: true,\r\n        emittedReadable: false,\r\n        readableListening: false,\r\n        objectMode: false,\r\n        defaultEncoding: 'utf8',\r\n        ranOut: false,\r\n        awaitDrain: 0,\r\n        readingMore: false,\r\n        decoder: null,\r\n        encoding: null },\r\n     readable: true,\r\n     domain: null,\r\n     _events: \r\n      { end: [Object],\r\n        finish: [Function: onSocketFinish],\r\n        _socketEnd: [Function: onSocketEnd],\r\n        drain: [Function: ondrain],\r\n        timeout: [Object],\r\n        error: [Function],\r\n        close: [Object] },\r\n     _maxListeners: 10,\r\n     _writableState: \r\n      { highWaterMark: 16384,\r\n        objectMode: false,\r\n        needDrain: false,\r\n        ending: false,\r\n        ended: false,\r\n        finished: false,\r\n        decodeStrings: false,\r\n        defaultEncoding: 'utf8',\r\n        length: 0,\r\n        writing: false,\r\n        sync: true,\r\n        bufferProcessing: false,\r\n        onwrite: [Function],\r\n        writecb: null,\r\n        writelen: 0,\r\n        buffer: [] },\r\n     writable: true,\r\n     allowHalfOpen: true,\r\n     onend: [Function],\r\n     destroyed: false,\r\n     errorEmitted: false,\r\n     bytesRead: 190,\r\n     _bytesDispatched: 0,\r\n     _pendingData: null,\r\n     _pendingEncoding: '',\r\n     server: \r\n      { domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _connections: 3,\r\n        connections: [Getter/Setter],\r\n        _handle: [Object],\r\n        _usingSlaves: false,\r\n        _slaves: [],\r\n        allowHalfOpen: true,\r\n        httpAllowHalfOpen: true,\r\n        timeout: 120000,\r\n        destroy: [Function],\r\n        _connectionKey: '6::::4444' },\r\n     _idleTimeout: 60000,\r\n     _idleNext: \r\n      { _connecting: false,\r\n        _handle: [Object],\r\n        _readableState: [Object],\r\n        readable: true,\r\n        domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        _writableState: [Object],\r\n        writable: true,\r\n        allowHalfOpen: true,\r\n        onend: [Function],\r\n        destroyed: false,\r\n        errorEmitted: false,\r\n        bytesRead: 336,\r\n        _bytesDispatched: 0,\r\n        _pendingData: null,\r\n        _pendingEncoding: '',\r\n        server: [Object],\r\n        _idleTimeout: 60000,\r\n        _idleNext: [Object],\r\n        _idlePrev: [Circular],\r\n        _idleStart: 1428094576218,\r\n        parser: [Object],\r\n        ondata: [Function],\r\n        _peername: [Object],\r\n        _httpMessage: [Object] },\r\n     _idlePrev: { _idleNext: [Circular], _idlePrev: [Object] },\r\n     _idleStart: 1428094579248,\r\n     parser: \r\n      { _headers: [],\r\n        _url: '',\r\n        onHeaders: [Function: parserOnHeaders],\r\n        onHeadersComplete: [Function: parserOnHeadersComplete],\r\n        onBody: [Function: parserOnBody],\r\n        onMessageComplete: [Function: parserOnMessageComplete],\r\n        socket: [Circular],\r\n        incoming: [Object],\r\n        maxHeaderPairs: 2000,\r\n        onIncoming: [Function] },\r\n     ondata: [Function],\r\n     _peername: { address: '::ffff:10.211.101.57', family: 'IPv6', port: 54457 },\r\n     _httpMessage: \r\n      { domain: null,\r\n        _events: [Object],\r\n        _maxListeners: 10,\r\n        output: [],\r\n        outputEncodings: [],\r\n        writable: true,\r\n        _last: false,\r\n        chunkedEncoding: false,\r\n        shouldKeepAlive: true,\r\n        useChunkedEncodingByDefault: true,\r\n        sendDate: true,\r\n        _hasBody: true,\r\n        _trailer: '',\r\n        finished: false,\r\n        _hangupClose: false,\r\n        socket: [Circular],\r\n        connection: [Circular] } },\r\n  query: { id: 'http://10.211.101.57:5555' },\r\n  pathname: '/grid/api/proxy' }\r\n```\r\nDo you have any ideas @arikon ?"},"comment":{"url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/comments/95289221","html_url":"https://github.com/selenodium/selenodium-grid/issues/30#issuecomment-95289221","issue_url":"https://api.github.com/repos/selenodium/selenodium-grid/issues/30","id":95289221,"user":{"login":"arikon","id":75247,"avatar_url":"https://avatars.githubusercontent.com/u/75247?v=3","gravatar_id":"","url":"https://api.github.com/users/arikon","html_url":"https://github.com/arikon","followers_url":"https://api.github.com/users/arikon/followers","following_url":"https://api.github.com/users/arikon/following{/other_user}","gists_url":"https://api.github.com/users/arikon/gists{/gist_id}","starred_url":"https://api.github.com/users/arikon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikon/subscriptions","organizations_url":"https://api.github.com/users/arikon/orgs","repos_url":"https://api.github.com/users/arikon/repos","events_url":"https://api.github.com/users/arikon/events{/privacy}","received_events_url":"https://api.github.com/users/arikon/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T18:15:28Z","updated_at":"2015-04-22T18:15:28Z","body":"I think the problem is somewhere near `q-io/http` modules. But can't figure where it is exactly."}}