Bug 1317027

Summary: rh-nodejs4-nodejs-mongodb unable to connect to mongodb24
Product: Red Hat Software Collections Reporter: Miroslav Hradílek <mhradile>
Component: rh-nodejs4Assignee: Zuzana Svetlikova <zsvetlik>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: rh-nodejs4CC: jorton, kanderso, lkuprova, mhradile, thrcka, zsvetlik
Target Milestone: beta   
Target Release: 2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
The rh-nodejs4-nodejs-mongodb module is unable to connect to the MongoDB database provided by the mongodb24 Software Collection.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-31 10:17:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Hradílek 2016-03-11 18:12:14 UTC
Description of problem:
We are shipping nodejs module to connect to mongodb database. In nodejs010 collection this was working with mongodb24 collection just fine.

Unfortunately it no longer works in rh-nodejs4 collection
:: [  BEGIN   ] :: Creating database with two entries :: actually running 'node freshdb_node.js | tee freshdb_node.out'
/opt/rh/rh-nodejs4/root/usr/lib/node_modules/mongodb/lib/mongodb/mongo_client.js:359
          throw err
          ^

Error: connection closed
    at null.<anonymous> (/opt/rh/rh-nodejs4/root/usr/lib/node_modules/mongodb/lib/mongodb/connection/server.js:592:24)
    at emitNone (events.js:67:13)
    at emit (events.js:166:7)
    at null.<anonymous> (/opt/rh/rh-nodejs4/root/usr/lib/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:155:15)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (/opt/rh/rh-nodejs4/root/usr/lib/node_modules/mongodb/lib/mongodb/connection/connection.js:494:12)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at TCP._onclose (net.js:469:12)
:: [   PASS   ] :: Creating database with two entries (Expected 0, got 0)
:: [  BEGIN   ] :: First entry should be found :: actually running 'grep '^First is Adam' freshdb_node.out'
:: [   FAIL   ] :: First entry should be found (Expected 0, got 1)
:: [  BEGIN   ] :: Second entry should be found :: actually running 'grep '^Second is Eve' freshdb_node.out'
:: [   FAIL   ] :: Second entry should be found (Expected 0, got 1)

The server closes collection due to bson being malformed (excerpt from server log):

Fri Mar 11 17:57:41.661 [conn28] AssertionException handling request, closing client connection: 10307 Client Error: 
bad object in message: bson length doesn't match what we found
Fri Mar 11 17:57:42.394 [conn35] Assertion: 10307:Client Error: bad object in message: bson length doesn't match what
 we found
0xe10557 0xdea302 0xdd7164 0xdd7073 0x9ae77c 0x9ae993 0xb77357 0xb78467 0x93f1dc 0xdfd12b 0x7fbcbfb27dc5 0x7fbcbdaac2
8d 
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x27) [0xe10557]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo10logContextEPKc+0x5e) [0xdea302]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0xf1) [0xdd7164]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0) [0xdd7073]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo9DbMessage9nextJsObjEv+0x19c) [0x9ae77c]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo12QueryMessageC2ERNS_9DbMessageE+0x81) [0x9ae993]
 /opt/rh/mongodb24/root/usr/bin/mongod() [0xb77357]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x332) [0xb78467]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0xdc) [0x93f1dc]
 /opt/rh/mongodb24/root/usr/bin/mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x4de) [0xdfd12b]
 /lib64/libpthread.so.0(+0x7dc5) [0x7fbcbfb27dc5]
 /lib64/libc.so.6(clone+0x6d) [0x7fbcbdaac28d]



Version-Release number of selected component (if applicable):
rh-nodejs4-nodejs-mongodb-1.3.19-4.2.el7.noarch
mongodb24-mongodb-2.4.9-8.el7.x86_64

Additional info:
I tried with upstream mongodb module and it connects just fine (Although i will have to change test to reflect changes in API).

Comment 7 errata-xmlrpc 2016-05-31 10:17:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1155