Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

545
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda