Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

TinyTds::Error: Adaptive Server connection failed #12

Open
monteirobrena opened this issue Apr 7, 2016 · 10 comments
Open

TinyTds::Error: Adaptive Server connection failed #12

monteirobrena opened this issue Apr 7, 2016 · 10 comments

Comments

@monteirobrena
Copy link

I'm trying to configure my Rails project with SQL on Azure. I'm using Mac OS X 10.11. But when I run rake db:migrate I receive this error TinyTds::Error: Adaptive Server connection failed.

I'm looking for answer in Stackoverflow, too.

http://stackoverflow.com/questions/36484700/rails-and-azure-tinytdserror-adaptive-server-connection-failed

@meet-bhagdev
Copy link
Contributor

+Andrea

On Thu, Apr 7, 2016 at 11:56 AM -0700, "Brena Monteiro" <[email protected]mailto:[email protected]> wrote:

I'm trying to configure my Rails project with SQL on Azure. I'm using Mac OS X 10.11. But when I run rake db:migrate I receive this error TinyTds::Error: Adaptive Server connection failed.

I'm looking for answer in Stackoverflow, too.

http://stackoverflow.com/questions/36484700/rails-and-azure-tinytdserror-adaptive-server-connection-failedhttps://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fstackoverflow.com%2fquestions%2f36484700%2frails-and-azure-tinytdserror-adaptive-server-connection-failed&data=01%7c01%7cmeetb%40microsoft.com%7c75104fd7e99f44f0c86d08d35f165411%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=9XjWh7%2f%2bTigSIczghqFKgLaWgyjugCrhzkMXoe28CqQ%3d

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/12

@ajlam
Copy link
Contributor

ajlam commented Apr 7, 2016

@monteirobrena Are you able to connect to your Azure SQL Database any tools outside of your Rails app? What happens when you run rake db::setup?

@monteirobrena
Copy link
Author

I fixed it, but I need change my config/database.yml.

staging:
  adapter: sqlserver
  username: 'username@database'
  password: 'password'
  host: 'db-staging.database.windows.net'
  port: 1433
  database: 'db-staging'
  azure: true

@monteirobrena
Copy link
Author

@ajlam actually works fine in localhost but now when I move to staging (Ubuntu VM Azure) the same error occurred.

TinyTds::Error: Adaptive Server connection failed

@monteirobrena
Copy link
Author

That's so weird! If I setup this configuration as development database, all work correctly. I can connect and save in my database on Azure. But when I try to deploy to staging VM with Capistrano I receive this error

$ cd /var/www/homepage/releases/20160408035644 && ( export RAILS_ENV="staging" ; ~/.rvm/bin/rvm default do bundle exec rake db:migrate )

rake stdout: rake aborted!
TinyTds::Error: Adaptive Server connection failed
/var/www/homepage/shared/bundle/ruby/2.2.0/gems/tiny_tds-0.7.0/lib/tiny_tds/client.rb:74:in `connect'
/var/www/homepage/shared/bundle/ruby/2.2.0/gems/tiny_tds-0.7.0/lib/tiny_tds/client.rb:74:in `initialize'

@ajlam
Copy link
Contributor

ajlam commented Apr 8, 2016

@monteirobrena Let me test with staging on my end to see if I run into a similar error.

@monteirobrena
Copy link
Author

@ajlam any news?

I put my project in my staging server and if I run rails s inside this folder I can connect with my database. But, if I run my project with Puma and Nginx, I receive this error:

TinyTds::Error (Adaptive Server connection failed):

@ajlam
Copy link
Contributor

ajlam commented Apr 18, 2016

@monteirobrena sorry for the delay. Still working on trying to repro the issue. I'll try to get back to you asap.

@ajlam
Copy link
Contributor

ajlam commented May 25, 2016

@monteirobrena were you able to figure out what the problem was?

@monteirobrena
Copy link
Author

@ajlam not yet.

I'm receiving this error:

[TinyTds][v1.0.2][tsql]: /usr/local/bin/tsql locale is "en_US.UTF-8" locale charset is "UTF-8" using default charset "UTF-8" Setting db-api-staging as default database in login packet 2Error 20002 (severity 9): Adaptive Server connection failed OS error 60, "Operation timed out" There was a problem connecting to the server

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants