Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

543
Vistas
Connect to mongodb via ssh tunnel failing

I have tried to connect to my mongodb on a server i own via an ssh tunnel via the following apps but nothing will connect:

  • compass
  • robomongo
  • nosqlbooster4mongo
  • phpstorm inbuilt mongodb java connector

Server and mongo:

  • Server: ubuntu 18lts
  • Mongo: latest community version

The Connection URL in all instances is the same (also tried removing the query params) and this url works on the node app:

mongodb://localhost:27017/data-aggregator?retryWrites=true&w=majority

nosqlbooster4mongo's error message is: enter image description here But the connection url is 27017 and gets changed to 37903 for some reason enter image description here

PHPStorm's error message is:

DBMS: Mongo DB Case sensitivity: plain=mixed, delimited=mixed Driver: MongoDB JDBC Driver (ver. 1.13, JDBC4.2) Effective version: UNKNOWN (ver. 0.0) Ping: 10 sec, 289 ms (keep-alive query results in error)

Timed out after 10000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:42865, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Exception receiving message}, caused by {java.net.SocketException: Connection reset}}].

Nothing works but i cannot understand why.

The SSH connection is working as confirmed by nosqlbooster4mongo and phpstorm

But as soon as it then tries to connect to the local mongodb instance it fails. I don't know if this is an issue with the SSH tunnel or the mongo setup. Via a terminal i can connect to mongo no issue, also the node app there can too.

The tunnels are using the same key as i use to connect to the server via terminal without issue which leads me to believe it is mongo but i don't know where to look :/

As the tunnel is established, then this says the server firewalls are not an issue.

I don't know what it is, is there an additional query param for ssh tunnel access?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Solved by @Jack_Woehr on: https://www.mongodb.com/community/forums/t/mongo-5-community-edition-cannot-connect-via-tunnel/151526

The trick was to not use the ssh tunnel from any of the tools listed and just create a the tunnel on the OS.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda