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

mongosh not found #68

Open
richard-mihalovic opened this issue Dec 23, 2023 · 6 comments
Open

mongosh not found #68

richard-mihalovic opened this issue Dec 23, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@richard-mihalovic
Copy link

Bug description

Cant find mongosh even if its already installed (over brew). If I run mongosh from terminal it starts successfully.

OS: MacOs Sonoma 14.2.1

Screenshot 2023-12-23 at 22 48 25

Reproduction

Opening shell tab.

Version

0.3.0

Relevant log output

~ brew list | grep mongosh
mongosh
➜  ~ which mongosh
/opt/homebrew/bin/mongosh

Environment information

{
    "arch": "amd64",
    "buildType": "production",
    "platform": "darwin",
    "version": "0.3.0",
    "hasMongoExport": false,
    "hasMongoDump": false,
    "hasMongoShell": false
}

Severity of this bug

Blocking a specific feature

@richard-mihalovic richard-mihalovic added the bug Something isn't working label Dec 23, 2023
@garraflavatra
Copy link
Owner

That would mean exec.LookPath returns a negative result, even though mongosh exists in your path.

_, err = exec.LookPath("mongosh")
a.Env.HasMongoShell = err == nil

I'm curious what the error says, since mongosh seems to be correctly installed.
Could you run the below code (save tomongosh.go and execute go run mongosh.go) and paste the output here?

package main

import "os/exec"

func main() {
        path, err := exec.LookPath("mongosh")
        println(path)

        if err != nil {
                println(err.Error())
        }
}

@richard-mihalovic
Copy link
Author

richard-mihalovic commented Dec 24, 2023

Hi. Seems the path is ok.

➜  tmp which mongosh
/opt/homebrew/bin/mongosh
➜  tmp mongosh --version
2.1.1
➜  tmp go run gotest.go
/opt/homebrew/bin/mongosh

@garraflavatra
Copy link
Owner

Thanks. I'm able to reproduce it on another machine... will try to debug further.

@garraflavatra
Copy link
Owner

garraflavatra commented Jan 13, 2024

I could reproduce it on a fresh machine. When I installed MongoDB + all database tools using brew (brew tap mongodb/brew && brew install mongodb-database-tools), the shell started working without problems. It continued to work after I had removed all of them again (except mongosh).

Strange indeed, but this may be a useful workaround.

@richard-mihalovic
Copy link
Author

Screenshot 2024-01-17 at 08 18 56

Hi. Seems it's not working for me. Maybe it will fix with next mongodb-database-tools update.

@garraflavatra
Copy link
Owner

I really don't have any clue anymore (except the one that something is wrong…)

It feels quite strange, given that the entire toolset is installed.

Thank you for your time and patience! :)
I'm looking in to it…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants