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

No suitable servers found (serverSelectionTryOnce set): [connection refused calling ismaster on '127.0.0.1:2707'] #25

Open
imrantune opened this issue Sep 19, 2018 · 1 comment

Comments

@imrantune
Copy link

 No suitable servers found (serverSelectionTryOnce set): [connection refused calling ismaster on '127.0.0.1:2707']

in Client.php (line 178)
at Manager->selectServer(object(ReadPreference))in Client.php (line 178)
at Client->listDatabases()in QueryProfiler.php (line 34)
at QueryProfiler->getDatabases()in controllers.php (line 6)
at {closure}()
at call_user_func_array(object(Closure), array())in HttpKernel.php (line 153)
at HttpKernel->handleRaw(object(Request), 1)in HttpKernel.php (line 68)
at HttpKernel->handle(object(Request), 1, true)in Application.php (line 496)

Please help why me getting this error

@jmikola
Copy link
Owner

jmikola commented Sep 19, 2018

This exception originates from mongo-php-driver since it cannot access a MongoDB server running on the noted host and port. I would start by confirming that you actually have a server running on the local host (you should be able to connect to it via the mongo shell if so). At a glance, 127.0.0.1:2707 stands out as a possible typo unless you're explicitly running mongod on a different port than its default (27017).

On the off chance you do have a server running, but it's requiring SSL connection or authentication, you'll need to tweak the configuration accordingly to ensure the appropriate connection string and options are used.

Beyond that, I would suggest searching the driver repository for existing issues on the subject. Note that "No suitable servers found" is a common error when the driver cannot select a server for an operation (hence selectServer() in the stack trace). The more relevant errors are in brackets following that message. In this case, the driver was aware of a single node in the topology (127.0.0.1:2707), encountered a connection error attempting to monitor it, and reported that most recent error as the reason said server could not be selected.

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

No branches or pull requests

2 participants