Connection Test is successful, Connect fails

Dave Lutz shared this question 16 months ago
Answered

I have entered connection details - host and port, localhost and 27001 - to a local installation on my laptop.


When I click Test, I get "Connection Success!"


When I click Connect, I get "Create shell connection failed."


That seems odd. What is up?

Comments (19)

photo
2

Hi Dave,

Firstly thanks for giving dbKoda a go! We're still in early stages of the product so we greatly appreciate getting all the feedback possible.


In regards to this issue, it's possible that the application was unable to detect a Mongo Binary in your Path. We're working on making these error messages a lot more verbose to help users with odd behaviour like this.

Could I ask which OS you're currently using the product on so I can assist you in diagnosing this issue?

Cheers,Michael.

photo
1

I have the same error on Linux Unbuntu 16.04 even if mongo is in my path


2017-07-21T08:37:27+02:00 - info: load pre defined scripts /tmp/.mount_zJB5N2/usr/bin/resources/app.asar.unpacked/node_modules/@southbanksoftware/dbkoda-controller/lib/all-in-one.js

2017-07-21T08:37:27+02:00 - info: write to shell load("/tmp/.mount_zJB5N2/usr/bin/resources/app.asar.unpacked/node_modules/@southbanksoftware/dbkoda-controller/lib/all-in-one.js");

2017-07-21T08:37:27+02:00 - info: write to shell var prompt="dbKoda>";

2017-07-21T08:37:27+02:00 - debug: emit output bash: mongo: command not found

2017-07-21T08:37:27+02:00 - debug: initialized message bash: mongo: command not found

2017-07-21T08:37:27+02:00 - info: mongo shell exit 127 false

2017-07-21T08:37:27+02:00 - error: failed to initialize 127

2017-07-21T08:37:27+02:00 - error: got error Error

at Object. (/tmp/.mount_zJB5N2/usr/bin/resources/app.asar/node_modules/@southbanksoftware/dbkoda-controller/node_modules/feathers-errors/lib/index.js:64:27)

at Object. (/tmp/.mount_zJB5N2/usr/bin/resources/app.asar/node_modules/@southbanksoftware/dbkoda-controller/node_modules/feathers-errors/lib/index.js:248:3)

at Module._compile (module.js:571:32)

at Object.Module._extensions..js (module.js:580:10)

at Module.load (module.js:488:32)

at tryModuleLoad (module.js:447:12)

at Function.Module._load (module.js:439:3)

at Module.require (module.js:498:17)

at require (internal/module.js:20:19)

at Object. (/tmp/.mount_zJB5N2/usr/bin/resources/app.asar/node_modules/@southbanksoftware/dbkoda-controller/node_modules/feathers-rest/lib/wrappers.js:13:23)

photo
1

Michael,

My OS is Mac OS X 10.11.6.


The MongoDB binaries are in my path.


$ echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/mongodb/bin

photo
1

Can I ask you guys where the path entry for the mongo executable is added? Eg, is the mongo bin directory added to the path in the .bash_profile or in /etc/profile?

It looks like when we create a shell process to fire up the mongo shell, the environment in the shell has only the system-wide environment (eg /etc/profile) and not the login shell environment (.bash_profile). That may be causing the behaviour you are seeing.

We may need to provide a patch to fix that. If you are able to add the relevant path to /etc/profile or (on OSX) /etc/paths then that might fix the issue in the meantime.

Thanks,

Guy

photo
1

Guy,

I have it set at the system-wide level (/etc/paths) for all users at the personal level in my .bashrc file. (Yes, this duplicates it in the PATH for my user.) See Terminal output below:


Davids-MacBook-Pro:~ davidjlutz$ echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/mongodb/bin:/opt/mongodb/bin


Davids-MacBook-Pro:~ davidjlutz$ cat /etc/paths

/usr/local/bin

/usr/bin

/bin

/usr/sbin

/sbin

/opt/mongodb/bin


Davids-MacBook-Pro:~ davidjlutz$ grep PATH ~/.bashrc

export PATH=$PATH:/opt/mongodb/bin


Davids-MacBook-Pro:~ davidjlutz$


David Lutz

photo
1

I should add the .bash_profile simply executes .bashrc.


Davids-MacBook-Pro:~ davidjlutz$ cat .bash_profile

. ./.bashrc


Davids-MacBook-Pro:~ davidjlutz$

photo
1

Thanks for your patience guys. We can reproduce the problem and we are preparing a hotfix for you. Should be available tomorrow

Guy

photo
1

Hi Guys,

Again, sorry for the delay. We hit some weird behaviours in how node fires up login shells that caused a few issues. We believe these are fixed in the following hotfix builds:

For Mac:

photo
1

I think the comment got cut off. Is there a patch or should we just download the current offering?

photo
1

After configuring the config.yml file it works perfectly. Thanks.

photo
1

Works for me! Thanks.

photo
1

I have the same issue under windows. I have MongoDB Community Server 3.4 installed and have the following in config.yml in the directory C:\Users\{username}\.dbKoda


mongoCmd: C:\Program Files\MongoDB\Server\3.4\bin\mongo.exe

photo
2

Ahaa! I removed the .exe from the path and now it works.

photo
1

Hi Robin,


We have posted a hotfix to our website that may fix your issue. This version (0.7.2) fixes issues on Windows where the mongo.exe binary could not be launched as well as an issue in which dbKoda might hang after upgrade. Sounds like you overcame the issue you were having with the trailing .exe, but this release is more stable so you might want to install it.


You can download the upgrade from https://www.dbkoda.com/#downloads. Please let us know if this resolves your issue.


Thanks,


Guy

photo
photo
1

Hey guys! Cool product :)

I'm having the same issue - a test connection is successful but an actual throws an error about the config.yml file.

I'm running on a mac, and attempting to connect to a docker mongo container. I've added a config.yml file in the .dbKoda directory with the following command.


mongoCmd: /usr/local/bin/docker exec -it mongodb mongo

mongodb is the container name.

However, dbKoda is still throwing the error. Any help on this would be great.

Thanks,

Josh

photo
1

Hi Josh,

We currently don't support having the mongo binary in a docker container. The reason is that we load our functions into the mongo shell using the LOAD command. When the mongo command is in a docker container it can't access the host filesystem so we are unable to initialize the shell. We have docker support on the backlog, and we'll try and get a solution within a relatively short timeperiod (weeks not months). We'll keep you up to date :-).

In the meantime, you will need a mongo binary on your host OS.

Thanks for trying out our product!


Guy

photo
1

Guy,

Thank you for getting back to me on this, I appreciate it. I'll give it a shot on my host OS, and I look forward to forthcoming Docker support.

Best of luck!

Josh

photo
1

Hi all,

first of all, thanks for this nice tool.


I just want to drop a message that I had the same problem but managed to fix it while copying the ...\MongoDB\Server\3.4\bin path to my PATH in my environmental variables. Just to add this, I'm working with Windows 10 64bit. Hopefully this helps users facing the same issue.

Best regards,

Tobias