Skip to content

MongoServerSelectionError: connect ECONNREFUSED localhost:27017 #132

@deflexable

Description

@deflexable

i install npm
i start mongodb server (on macos using brew services start mongodb-community)
i started the server with node server
i visited http://localhost:4321/
i viewed a collection - it loads correctly the first time
but when i try viewing another collection, it keeps spinning and after spinning for a while it shows a toast saying MongoServerSelectionError: connect ECONNREFUSED and displayed a box and text below it saying This collection doesn't have any documents

below shows the error logged on the server:

MongoServerSelectionError: connect ECONNREFUSED localhost:27017
    at Timeout._onTimeout (/Users/aoamacsplace/Documents/dirty/mongo-gui-master/node_modules/mongodb/lib/core/sdam/topology.js:438:30)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'localhost:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 17
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions