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

Cannot Start on Ubuntu 14 in Vagrant on Windows #273

Closed
OmarShehata opened this issue Jun 22, 2016 · 9 comments
Closed

Cannot Start on Ubuntu 14 in Vagrant on Windows #273

OmarShehata opened this issue Jun 22, 2016 · 9 comments

Comments

@OmarShehata
Copy link

OmarShehata commented Jun 22, 2016

I'm following the instructions on the quick start page, and after creating a bot and running parse I get:

OpenError: IO error: systemDB/MANIFEST-000001: Invalid Argument 
at /usr/local/lib/node_modules/superscript/node_modules/sfacts/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:114:34

Now because I'm running in Vagrant I did run into some issues prior to this. I had to run npm install with the --no-bin-links because symlinks fail on Vagrant.

I don't know if it's relevant, but another weird issue when running npm install for superscript is that it fails to install conceptnet. It seems like it's trying to install it from the npm registry. This is the output:

npm http 404 https://registry.npmjs.org/conceptnet
npm ERR! TypeError: Object.keys called on non-object

But if I just run npm install silentrob/conceptnet that works. Although, now that I check, I don't see it in node_modules/superscript/node_modules.

Any ideas?

Edit/Update:

Followed the fix here to get Vagrant to use symlinks:

hashicorp/vagrant#713 (comment)

Now sudo npm install superscript -g runs without an error. However, it doesn't seem to edit the PATH? (So bot-init says it's not found). I can fix this by adding /usr/local/lib/node_modules/superscript/bin to the PATH and then calling bot-init.js and parse.js

And sudo npm install inside the bot is giving me EPERM errors, (even when running as admin and with sudo) I think this should fix it https://harvsworld.com/2015/how-to-fix-npm-install-errors-on-vagrant-on-windows-because-the-paths-are-too-long/

@OmarShehata
Copy link
Author

Ok, so applying the Vagrant symlink fix, and the Vagrant EPERM fix for filepaths that are too long, allows me to correctly npm install superscript and npm install inside my bot.

But then I'm right back where I started with the OpenError: IO Error: sysmtemDB/MANIFEST-0000001.

@silentrob
Copy link
Collaborator

It sounds like you might be in a bad state, you can safely delete the systemDB folder. It is re-created on startup

@OmarShehata
Copy link
Author

Thanks for the quick response!

So I tried doing that, same error. I tried a completely fresh new VM. This time bot-init and parse work without having to change anything in the PATH. But I'm still getting the IOError with systemDB.

Is there anything else that could be causing this? Or anything I can check?

@silentrob
Copy link
Collaborator

Try the steps in the hello-superscript repo. https://github.com/silentrob/hello-superscript.

I'm assuming you are running a windows machine. I will also open an issue to make sure superscript works on windows.

@OmarShehata
Copy link
Author

OmarShehata commented Jun 22, 2016

I'm running on a Windows 7 host machine but I'm trying to run superscript in Ubuntu 14 on Vagrant. I just tried the hello-superscript repo, and when I run:

./node_modules/superscript/bin/cleanup.js --mongo telnetbot

I get:

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
users is clear
topics is clear
replies is clear
gambits is clear
events.js:72
   throw err; // Unhandled 'error' event 
OpenError: IO Error: ./systemDB/MANIFEST-000001: Invalid argument 
   at /vagrant/hello-superscript/node_modules/superscript/node_modules/sfacts/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:114:34

Could this have anything to do with Mongo not running correctly or on the right port or anything? With Vagrant you have to specify which ports to bind/open. That's the only other thing I can think of that would be different from a pure Linux environment right now.

@silentrob
Copy link
Collaborator

What version of Node are you using? It should be 0.12.x or 5.11.x

@OmarShehata
Copy link
Author

I was really hoping that would be it! I was using 0.10, I started from scratch again with node 0.12.14 and got everything working up to that point, but in hello-superscript I get the same error but without this part;

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version

And the error is at events.js:85 now.

@silentrob
Copy link
Collaborator

Have a look at this thread. It seems to be related to mongo. http://stackoverflow.com/questions/28651028/cannot-find-module-build-release-bson-code-module-not-found-js-bson

@OmarShehata
Copy link
Author

Sorry if my previous message wasn't clear. I meant updating node fixed the "Cannot find module bson" error. So I was only getting the OpenError IO Error SystemDB.

The good news is I figured it out! The final problem was yet again a Vagrant issue where it can't access the file because of a filesystem issue. It's discussed in more detail here: Level/levelup#222

What worked for me is to just move my project out of the shared folder. So instead of having it in /vagrant/mybot I moved it to /home/mybot

Thanks for all your help @silentrob !

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

No branches or pull requests

2 participants