-
Notifications
You must be signed in to change notification settings - Fork 140
Cannot connect to MSSQL server #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting. Can you please send the full verbose logs here? You can collect logs by launching SQLPage from your terminal with
Can you also check the encryption setting of your database server and return the logs from the server from the time of the error of you have them? |
@lovasoa Logs (please help me check for any sensitive information):
|
Thank you. Maybe the database does not support encrypted connections? Can you try connecting with encryption disabled, and report the same logs? You can disable encryption by adding |
@lovasoa Yes, you are right. It works fine after adding I couldn't find this option in the configuration.md. Can we include it? |
Yes, I'll add a reference to supported connection string parameters. Even better, we should be able to make it just work by default. We currently support both fully encrypted and fully cleartext connections, but I suspect your database expects sql server's third mode, that is partially encrypted connections where only the password is encrypted. We should add support for that too. |
Alright, we can give it a try. |
I implemented login packet encryption for mssql. However, looking back at your logs above, I'm not sure that would solve the initial issue. I also added much more verbose debug logging during the connection phase, which will make debugging issues like this one easier. Could you please test the latest pre-release of sqlpage (v0.31), try to connect to the same database (without setting encrypt in the connection string), and if it still fails, report the details logged here ? |
I implemented login packet encryption for mssql. However, looking back at your logs above, I'm not sure that would solve the initial issue. I also added much more verbose debug logging during the connection phase, which will make debugging issues like this one easier. Could you please test the latest pre-release of sqlpage (v0.31), try to connect to the same database (without setting encrypt in the connection string), and if it still fails, report the details logged here ? |
@lovasoa Hello, whether or not The log without
The log with
|
Thank you for helping investigate this! You have properly redacted the database password. The problem does not seem to be where I thought. The database reports it has encryption enabled, and SQLPage thus correctly starts a handshake, but something closes the connection prematurely. Do you have a firewall, or are you on an Enterprise network that may be doing this? Can you connect to the same database from the same computer using other tools? If you have the time,I would love to get a packet capture (using Wireshark) both of the failing connection and of a working connection that from a different software. You can send this to contact@ophir.dev if you are not sure how to redact it. If you can to completely disable encryption (even for the database password) in the latest version, going back to the fully unencrypted connection that worked, you can use |
I'm still pretty new to this, so I'm not sure if I should comment on a closed item or open a new one. So, I'll start here and move my comment if needed. First, I'm starting to test your product and I really like it. Well done! My use case is that I have an existing site that I developed with DNN and all the site data is located on a Windows server with an MS SQL database. All of my new development is on a new server (Ubuntu 22.04) with different open source software. I would like to use your product to reach through to my current DNN/MSSQL database and create quick "apps" that I can integrate in various places. Here's the problem: my connection (from Ubuntu Server #2 to Windows Server #1) does not work until I use ?encrypt=not_supported as described above. The log error is "Failed to connect to the database: error communicating with database: tls handshake eof. Retrying in 5 seconds." This same error occurs whether I set encrypt to true or false. I'm able to connect to the database through DBeaver just fine. Are there any tests I can run in my environment that would help you troubleshoot this issue? |
Hello and welcome to SQLPage! |
I just created #905 . I think it has everything you requested. I'll watch for your thoughts. |
Hello, I cannot connect to the MSSQL server in the production environment (previously I was connecting to the local server).
database_url:
mssql://user:password@ip:1433/DB
Error:
[2024-11-07T03:43:56.138Z WARN sqlpage::webserver::database::connect] Failed to connect to the database: error communicating with database: tls handshake eof. Retrying in 5 seconds.
Could this be an issue with the SSL certificate?
Version information
windows 10 Simplified Chinese zh-CN
MSSQL 2012
sqlpage 0.30.1
The text was updated successfully, but these errors were encountered: