tiny_tds icon indicating copy to clipboard operation
tiny_tds copied to clipboard

Unable to connect when upgrade to Rials 6

Open weijenlarryli opened this issue 2 years ago • 3 comments

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.

weijenlarryli avatar Jul 25 '22 01:07 weijenlarryli

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:

  1. Is the FreeTDS info otherwise identical?
  2. Is the TDS version the same (4.2 is very old)
  3. Can you connect to from this web server to that SQL Server instance using other tools (eg, tsql)
  4. Does the SQL Server log show anything interesting when you try to connect?

aharpervc avatar Jul 25 '22 15:07 aharpervc

  1. Yes they are identical.
  2. The version seems old. Are the versions backward compatible?
  3. Yes, I can connect using command like tsql -S [hostname] -U [user] -P [password] But unable to connect using TinyTds::Client from rails_console.
  4. Have not been able to see the SQL server logs. I will try this.

weijenlarryli avatar Jul 25 '22 22:07 weijenlarryli

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

weijenlarryli avatar Aug 08 '22 19:08 weijenlarryli