appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: It is not possible to connect to MySQL and MSSQL using the IP address in the self-hosted version.

Open felix-appsmith opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Previously in Appsmith self-hosted, I was able to connect to my data sources using my IP address. Currently, this is not working, and it doesn't allow me to connect using the IP/instancename either. However, if I expose the port of my data source with ngrok, then I can connect perfectly fine.

Steps To Reproduce

  1. Create a new data source using docker, you can use this docker-compose.
version: '3.7'
services:
  db:
    image: mcr.microsoft.com/mssql/server:2019-latest
    environment:
      SA_PASSWORD: "yopassword123"
      ACCEPT_EULA: "Y"
      MSSQL_PID: "Developer"
    ports:
      - "1433:1433"
    networks:
      - mi-red
networks:
  mi-red:

  1. Use the command ifconfig to see your IP address.

  2. Connect from Appsmith to your data source using your IP address, and you will see that it fails.

  3. Make the same connection but using Dbeaver and you will see that it succeeds.

  4. Expose the port of the data source with ngrok and try to make the connection with Appsmith, and you will see that it works successfully.

Here is my configuration:

IP/instancename:port

IP:port

In both cases, it fails, but if I expose it with ngrok, both cases work. I am attaching the docker-compose file for MsSql, but it also fails with MySQL.

Public Sample App

No response

Environment

Production

Issue video log

No response

Version

Self-Hosted 1.9.16, 1.9.15, 1.9.4

felix-appsmith avatar Apr 25 '23 22:04 felix-appsmith

Did you tried connecting using "IP,port" (comma)?

One other thing to try is to put MSSQL docker service within same docker network of Appsmith. It's described in this video: https://www.youtube.com/watch?v=EZQc8OuwTn4&t=735s

Anyway, I don't think is a Appsmith issue. I've connected Appsmith docker to a SQL Server running in Windows of my docker machine and it's fine!

jrvidotti avatar Apr 26 '23 17:04 jrvidotti

i can connect to a MSSQL in the docker network, but NOT in the Hosts Network. Other Docker containers are able to connect but not appsmith...

BRM-SMS avatar Apr 27 '23 07:04 BRM-SMS

ive managed to get this working. It was my fault using the wrong port. Unfortunatly someone, who setup the mssql server has set a different port. Now the connection is successful, even on a docker network.

This issue can be closed!

BRM-SMS avatar May 12 '23 11:05 BRM-SMS