Dealing with "Creation of shell connection failed" errors

dbKoda uses the mongo shell installed on your server to perform much of it's interactions with your mongoDB databases.  This error occurs when we cannot locate the mongo binary on your computer.

We look for the mongo binary on:

  • The system path
  • Your local path (on Linux or MacOS this might be specified in .bash_profile) 
  • The preferences panel within dbKoda.
  • A location specified in the dbKoda config.yml file. 

There is a bug (or a feature if you like) in the Node.js child_process library that can cause us to fail to locate the mongo binary if it is qualified by the $HOME variable.  For instance, on my laptop I had the following line in my .bash_profile:

	export PATH=$HOME/mongo/bin:$PATH

Because the $HOME variable wasn't set within the Node.Js child process, we looked for the mongo binary in /mongo/bin which didn't work.   

You can work around these types of problems in a couple of ways:

  1. Change the PATH specifications so that they don't rely on $HOME.  On my laptop I now use ~/mongo/bin which works fine
  2. Specify the location of the mongo binary in the Preferences Panel within dbKoda, the screenshots below show you how to get to the preferences panel (Also availaavailable from File -> Preferences in your application toolbar):
  3. Specify the location of the mongo binary in the config.yml file.  On Linux and MacOS this file lives in the ~/.dbKoda directory.  You can add an entry to the file that looks like this:
	mongoCmd: /usr/local/bin/mongo

    Make sure the config.yml entry is fully qualified (eg, don't use the $HOME directory or any other substitution variable)

Is article helpful?