Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix driver install instructions get the automatic fall back to work (1.7.0-2) #1172

Closed
1N50MN14 opened this issue Jul 15, 2013 · 24 comments
Closed
Assignees
Labels
Milestone

Comments

@1N50MN14
Copy link

npm install rethinkdb fails with the error message:
with the error message

"../protobuf.cpp:7:45: fatal error: google/protobuf/dynamic_message.h: No such file or directory"

Should read a better error message with installation instructions for protobuf.

@ghost ghost assigned AtnNn Jul 15, 2013
@coffeemug
Copy link
Contributor

@1N50MN14 -- just so I understand, the driver still works, it just doesn't use the native backend, correct?

If that's the case, do the following instructions work for you -- http://rethinkdb.com/docs/guides/driver-performance/ ?

@neumino
Copy link
Member

neumino commented Jul 15, 2013

What may be the problem is that we have in package.json

"engine" : "node >= 0.10.0"

When according to https://npmjs.org/doc/json.html, it should be:

{ "engines" : { "node" : ">=0.10,0" } }

@1N50MN14
Copy link
Author

@coffeemug No the driver completely failed to install with a fatal error without falling back. The only way for me to get the driver to install was to manually install libprotobuf then npm install rethinkdb again. Ideally, the installation should've printed an error message about missing libprotobuf with a notice about optional fallback.

@neumino This happens regardless of node >= 0.10.0

@coffeemug
Copy link
Contributor

Ok, sorry you ran into this -- thanks for submitting the bug report. Assigning to @AtnNn. He's out until Wed, so we'll try to get this working as soon as we can.

@wmrowan -- can you look at this in the meantime?

@coffeemug
Copy link
Contributor

Hi @1N50MN14 -- I was able to (partially) reproduce this. If libprotobuf isn't installed, running npm install rethinkdb gives me the errors you got, but the driver still installs fine. Here's the output I get:

  CXX(target) Release/obj.target/protobuf/protobuf.o
../protobuf.cpp:7:10: fatal error: 'google/protobuf/dynamic_message.h' file not found
#include <google/protobuf/dynamic_message.h>
         ^
1 error generated.
make: *** [Release/obj.target/protobuf/protobuf.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/Cellar/node/0.10.10/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.4.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.10/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/coffeemug/node_modules/rethinkdb/node_modules/node-protobuf
gyp ERR! node -v v0.10.10
gyp ERR! node-gyp -v v0.9.6
gyp ERR! not ok
npm WARN optional dep failed, continuing node-protobuf@1.0.2
rethinkdb@1.7.0-2 node_modules/rethinkdb

However, if I run npm list I still get the RethinkDB driver installed, and everything works fine. Unless something works differently on your machine, I think it's a matter of confusing error messages (which we should definitely fix).

Would you mind taking a minute to confirm that the driver works despite the errors if libprotobuf isn't installed?

@1N50MN14
Copy link
Author

@coffeemug Driver is working for me, but the only way to get it to install was to install libprotobuf and the dependencies needed for it to work:

sudo apt-get install g++ protobuf-compiler protobuf-c-compiler libprotobuf-dev libv8-dev libgoogle-perftools-dev make libprotoc-dev default-jre libboost-dev

In my case, the driver didn't install at all... I should have kept a log, sorry about that..

@coffeemug
Copy link
Contributor

@1N50MN14 -- I think even if you don't install the protobuf dependencies, the driver will work, it just gives a confusing error message during installation.

It would be helpful if you could uninstall the protobuf libraries, rethinkdb driver, and then tried to reinstall it and see if it works despite the error message. (If not, that's ok)

I'll talk to @AtnNn about this tomorrow when he gets back and see what we can do about improving the error message.

@1N50MN14
Copy link
Author

@coffeemug Yes ofcourse I'll try that, I'll also launch couple of Ubuntu instances on Joyent and give it a go there see what happens. Will report back.

@coffeemug
Copy link
Contributor

@1N50MN14 -- thanks so much for helping track this down!

@1N50MN14
Copy link
Author

@coffeemug I think you're right, here's the output... looks like I got indeed confused:

root@7b672396-8abf-47d8-b881-bef750cb784d:~# npm install rethinkdb
npm http GET https://registry.npmjs.org/rethinkdb
npm http 200 https://registry.npmjs.org/rethinkdb
npm http GET https://registry.npmjs.org/rethinkdb/-/rethinkdb-1.7.0-2.tgz
npm http 200 https://registry.npmjs.org/rethinkdb/-/rethinkdb-1.7.0-2.tgz
npm http GET https://registry.npmjs.org/node-protobuf
npm http 200 https://registry.npmjs.org/node-protobuf
npm http GET https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.2.tgz
npm http 200 https://registry.npmjs.org/node-protobuf/-/node-protobuf-1.0.2.tgz

> node-protobuf@1.0.2 install /root/node_modules/rethinkdb/node_modules/node-protobuf
> node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
make: Entering directory `/root/node_modules/rethinkdb/node_modules/node-protobuf/build'
  CXX(target) Release/obj.target/protobuf/protobuf.o
../protobuf.cpp:7:45: fatal error: google/protobuf/dynamic_message.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/protobuf/protobuf.o] Error 1
make: Leaving directory `/root/node_modules/rethinkdb/node_modules/node-protobuf/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.8.6-joyent-ubuntu-12-opt
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/rethinkdb/node_modules/node-protobuf
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok 
unbuild node-protobuf@1.0.2
npm WARN optional dep failed, continuing node-protobuf@1.0.2
rethinkdb@1.7.0-2 node_modules/rethinkdb

@coffeemug
Copy link
Contributor

Cool -- thanks for checking this! I'll talk to @AtnNn tomorrow when he gets back to see if we could make the message more clear.

@1N50MN14
Copy link
Author

@da-z huh?

@da-z
Copy link

da-z commented Jul 26, 2013

@1N50MN14 -- Sorry about that. I did not pay close attention to the issue's title and also missed one of your comments when you say you installed libprotobuf.

@1N50MN14
Copy link
Author

@da-z no problem, thanks anyway

@AtnNn
Copy link
Member

AtnNn commented Jul 29, 2013

I have not found a way to make the error message more clear.

@coffeemug
Copy link
Contributor

@AtnNn -- let's talk about this today to see what (if anything) we can do.

@coffeemug
Copy link
Contributor

And by that, I mean that may be there are creative solutions here (we could just fix the docs, for example, though it isn't ideal).

@coffeemug
Copy link
Contributor

Moving this to 1.9-required since people can running into it. I talked to @AtnNn, he had some ideas (like patching npm and creating separate packages for fast and slow rethinkdb js drivers).

@AtnNn
Copy link
Member

AtnNn commented Aug 15, 2013

@coffeemug: Here is the relevant npm issue: https://github.com/isaacs/npm/issues/3715

@AtnNn
Copy link
Member

AtnNn commented Aug 30, 2013

Here is another idea: remove the c++ backend from the npm package, and provide and alternative way to install it.

@AtnNn
Copy link
Member

AtnNn commented Oct 24, 2013

@coffeemug's message was accidentally deleted.

Here's what we decided to do.

  • npm install rethinkdb will not try to install the optimized protobuf backend. This way new users will never encounter this error.
  • For people that want the optimized backend, we'll have separate instructions on installing protobuf-js in a way that works with the rethinkdb driver.

@AtnNn
Copy link
Member

AtnNn commented Nov 13, 2013

See rethinkdb/docs#75 for the new documentation.

@xuthief
Copy link

xuthief commented Mar 31, 2014

i met this problem too when installing node-proto in my mac, then i re-install libprotobuf-dev by brew rather than install protobuf by source code, the error solved mystically. try `brew install protobuf'.

@coffeemug
Copy link
Contributor

Note, this problem will go away completely in 1.13 because we're dropping to protobuf API for JSON (see #1868). So no more protobuf dependencies or special installation steps for optimized backends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants