tiny_tds
tiny_tds copied to clipboard
Unable to connect when upgrade to Rials 6
Environment
Operating System NAME="Ubuntu" VERSION="16.04.5 LTS (Xenial Xerus)"
TinyTDS Version and Information
tiny_tds (2.1.2)
I also tried 2.1.5
FreeTDS Version MS db-lib source compatibility: no Sybase binary compatibility: yes Thread safety: yes iconv library: yes TDS version: 4.2 iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: yes
Description
I have used Rails 5 with TinyTds gem to connect to many servers. (hundreds of them) I recently upgrated to Rails 6. My system can connect to most of the servers, but cannot connect to some. When I start a client side, I get this error:
TinyTds::Error: Unable to connect: Adaptive Server is unavailable or does not exist (some.server.address:1433)
from ....gems/tiny_tds-2.1.2/lib/tiny_tds/client.rb:60:in `connect'
Is there any way to figure out why I cannot connect? I can connect when I switch back to Rails 5.
Thanks.
TinyTDS can't really tell you anything that FreeTDS isn't already saying; ie, it can't connect for some reason. The diagnostics are up to you. Here's some ideas to get you started:
- Is the FreeTDS info otherwise identical?
- Is the TDS version the same (4.2 is very old)
- Can you connect to from this web server to that SQL Server instance using other tools (eg,
tsql
) - Does the SQL Server log show anything interesting when you try to connect?
- Yes they are identical.
- The version seems old. Are the versions backward compatible?
- Yes, I can connect using command like tsql -S [hostname] -U [user] -P [password] But unable to connect using TinyTds::Client from rails_console.
- Have not been able to see the SQL server logs. I will try this.
Adding a follow up to this. Here are discussions and solutions: https://github.com/FreeTDS/freetds/issues/336 https://github.com/FreeTDS/freetds/issues/299