camicroscope / Caracal

Conslidated Backend, Auth, and Security Services for caMicroscope
GNU General Public License v3.0
15 stars 97 forks source link

Issue with the setup script #95

Open siddhanth339 opened 3 years ago

siddhanth339 commented 3 years ago

Describe the bug I was following the instructions on using setup script to initialize the project. I have the Distro, Caracal, and caMicroscope repositories in the same parent folder. When I run "bash ./setup_script.sh", I get an error saying the mongo path was not found while I have set the path inside environment variables.

To Reproduce Steps to reproduce the behavior:

  1. Open Git bash
  2. Navigate to the Caracal folder which has the "setup_script.sh" file
  3. Run the script with "bash ./setup_script.sh"
  4. See the error

Expected behavior The script must run smoothly and start the application

Screenshots The error: mongoPathError

My environment variables window: env variables

System information:

birm commented 3 years ago

so, it looks like your mingw environment doesn't know about mongo, at least as "mongo", or perhaps it's some quirk of mingw's shell? To help answer this, could you run mongo from mingw and see if it runs?

siddhanth339 commented 3 years ago

It says: "bash: mongo: command not found"

YashKumarVerma commented 3 years ago

thanks for the detailed report @siddhanth339, could you try navigating to the MongoDB installation directory from the terminal and run ./mongo? What does it show?

Also, is it possible to share the list of variables on your PATH from your terminal?

I'm not currently logged into my windows machine, will try doing so tomorrow morning.

siddhanth339 commented 3 years ago

Running mongo, I was successfully able to enter into the MongoDB shell: runMongo

List of variables on my path: envOnCmd

YashKumarVerma commented 3 years ago

@siddhanth339 since you're running the setup script the cygwin terminal, please run ./mongo and list the path from that shell itself.

siddhanth339 commented 3 years ago

MongoFrombashShell

pathFromGitBash

siddhanth339 commented 3 years ago

@YashKumarVerma any update?

YashKumarVerma commented 3 years ago

Apologies but I'm writing university exams this week so was not able to investigate this myself.

siddhanth339 commented 3 years ago

Update: When I was looking at the setup script there were few commands using wget So, I installed wget and updated my environment variable "Path" to include wget. Now, magically, the "mongo path error" I was getting before disappeared. Any reason why and how this happened? Is mongo linked with wget in any way?

After successfully running the setup_script, running npm start also runs fine but when I go to localhost:4010, it says "Cannot Get /"

runSetupScript

npmStart

YashKumarVerma commented 3 years ago

It is fairly strange that installing wget solved that problem, but it did nonetheless. The logic for checking whether or not mongo is available in the path or not is (given below). I will play around with this weekend and let you know about the results.


###
## check if the system has required services installed
###
if ! command -v "mongo" &>/dev/null; then
    echo "mongo could not be found on path. Please ensure that mongo is installed and is on PATH"
    exit
fi

if ! command -v "node" &>/dev/null; then
    echo "node could not be found on path. Please ensure that node is installed and is on PATH"
    exit
fi