jmikola / mongoqp

A frontend for MongoDB's query profiler collection.
MIT License
170 stars 25 forks source link

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

Open imrantune opened 6 years ago

imrantune commented 6 years ago

 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 commented 6 years ago

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.