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

EACCES error when launching Mongoclient #384

Open
dainbrump opened this issue Aug 7, 2017 · 6 comments
Open

EACCES error when launching Mongoclient #384

dainbrump opened this issue Aug 7, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@dainbrump
Copy link

Opening mongoclient and I get

Error: spawn EACCES
    at exports._errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:399:9)
    at ~/Apps/Mongoclient/resources/app/index.js:228:24
    at Socket.<anonymous> (~/Apps/Mongoclient/resources/app/index.js:315:13)
    at Object.onceWrapper (events.js:290:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)

Expected Behavior

I expect the app would open and allow me to do something, anything.

Current Behavior

It just hangs at the "Please wait" screen.

Possible Solution

Looking at line 228 in the index.js, it appears the app is trying to spawn an instance of Mongo. I already have mongo installed and running as a service on this machine. Is there a reason is tries to spawn Mongo? Is there a way to have it ignore this step if Mongo is already running on the machine?

Your Environment

  • nosqlclient 2.1.0
  • Portable
  • Ubuntu 16.04 (KDE Neon)
@rsercano
Copy link
Member

rsercano commented Aug 7, 2017

Hello @dainbrump

mongoclient needs a mongodb instance to run, it uses it for internal connections and settings. You can optionally set MONGO_URL environment variable with an another mongodb so that it shouldn't start it's own.

Apart from that if you can use sudo or give permissions for the logged in user, you may successfully open mongoclient. Let me know if that works for you.

@dainbrump
Copy link
Author

Setting MONGO_URL in the environment does nothing. It still tries to launch the relative instance of mongod, the one the app ships with. Using sudo will make no difference. I have tried setting the MONGO_URL with and without "mongodb://"

[MONGOCLIENT] trying to start Mongoclient electron application
[MONGOCLIENT] trying to show loading page while everything is getting ready, loading page url: file:~/Apps/Mongoclient/resources/app/loading.html
[MONGOCLIENT] trying to start mongod process
[MONGOCLIENT] detected mongod executable path: ~/Apps/Mongoclient/resources/app/bin/mongod
[MONGOCLIENT] detected mongod data directory: ~/var/local/Mongoclient/db
[MONGOCLIENT] trying to create data dir and removing mongod.lock just in case
[MONGOCLIENT] trying to find free port for spawn
[MONGOCLIENT] trying to spawn mongod process with port: 11235

I have already installed Mongo on this machine because I am using it for dev work. Why doesn't the app check for already running mongod processes and prompt the user for connection settings when it finds one or start its own when one doesn't exist?

@rsercano
Copy link
Member

rsercano commented Aug 10, 2017

@dainbrump it wouldn't be safe to use someone's MongoDB process and create a database, collections on it without permission. Actually, it should start a MongoDB process as soon as it finds a free port. I'll do next release soon, will try to find a solution for you as well. Until then I recommend you to use Docker build which is being shipped with the most recent code. It's safe and best way to use nosqlclient

@lingfish
Copy link

I agree with @dainbrump .... setting the env var does nothing for me as well, and I'm not terribly interested in standing up a Docker env just to run this great tool; that's kind of the point of electron.

On top of that, I'm getting the libssl1.0.0 error as well.

@rsercano rsercano added this to the v2.3.0 milestone May 24, 2018
@rsercano rsercano self-assigned this May 24, 2018
@rsercano rsercano added the bug label May 24, 2018
@rsercano rsercano added this to To DO in Nosqlclient 4.0.0 May 24, 2018
@rsercano rsercano removed the rewrite label Feb 6, 2019
@nikolov-tmw
Copy link

Apologies for resurrecting this, but if anyone finds this, I want them to know my solution to this problem. I ran into the problem of Nosqlclient not starting up after not using it for a while and upgrading a bunch of system packages.

I got the following error:

[NOSQLCLIENT] [MONGOD-STDERR] /opt/nosqlclient/resources/app/bin/mongod: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

After reading in this and #434 about using MONGO_URL and having that not work, I then tried to symlink my local mongod binary to /opt/nosqlclient/resources/app/bin/mongod(I first made a backup of /opt/nosqlclient/resources/app/bin/mongod and then ran ln -s /usr/bin/mongod /opt/nosqlclient/resources/app/bin/ ).

That improved things a bit more as I was starting to see some more messages in the console(running Nosqlclient from the terminal gives you helpful output). However I was now getting this error message:

[NOSQLCLIENT] [MONGOD-STDOUT] 2020-02-28T02:10:46.684+0200 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

This lead me on a wild goose chase of figuring out how to upgrade things and since I don't usually use mongodb, I couldn't make it work.

Finally my attention was caught by this line in the debug output:

[NOSQLCLIENT] detected mongod data directory: /home/redacted/var/local/Mongoclient/db

And I figured out that the problem was that Nosqlclient has it's own database(for storing things like connections and whatever other settings it has) and during boot it was perhaps trying to upgrade it's schema to the latest version or something 🤔

So I just deleted the /home/redacted/var/local/Mongoclient/db folder and started up Nosqlclient again - and it works! Obviously I lost my saved connections, so if that's a problem for you, then maybe don't do it that way, but to me it was a nobrainer as I only had one connection anyway.

Hope that helps! Also @rsercano thank you for creating Nosqlclient! It's awesome! 🙂

@rsercano
Copy link
Member

Thanks a lot @nikolov-tmw thanks for both your help and for appreciation, that kind of attitude is the only thing that really keep this project alive :)

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

No branches or pull requests

4 participants