Heroku run rake db.migrate / Error: A connection attempt failed

允我心安 提交于 2019-12-25 04:07:32

问题


I am experiencing problems with the "heroku run rake db:migrate" command. It complains about an " ! Heroku client internal error", see below for the entire thing. Git push and heroku create work (see below), but finally rake db:migrate crashes.

What can I do?

All the best

Stefan

Below is what I enter and get from Heroku.

C:\Sites\demo_app_rt32>git push -u  origin master
Enter passphrase for key '/z/.ssh/id_rsa':
Counting objects: 102, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (91/91), done.
Writing objects: 100% (102/102), 32.37 KiB, done.
Total 102 (delta 8), reused 0 (delta 0)
To git@github.com:StefanHelber/demo_app_rt32.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

C:\Sites\demo_app_rt32>heroku create --stack cedar
Creating murmuring-thicket-9165... done, stack is cedar
http://murmuring-thicket-9165.herokuapp.com/ | git@heroku.com:murmuring-thicket-
9165.git
Git remote heroku added

C:\Sites\demo_app_rt32>git push heroku master
Enter passphrase for key '/z/.ssh/id_rsa':
Counting objects: 102, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (91/91), done.
Writing objects: 100% (102/102), 32.37 KiB, done.
Total 102 (delta 8), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
       Running: bundle install --without development:test --path vendor/bundle -
-binstubs bin/
       Fetching gem metadata from https://rubygems.org/.........
       Installing rake (0.9.2.2)
       Installing i18n (0.6.1)
       Installing multi_json (1.3.6)
       Installing activesupport (3.2.3)
       Installing builder (3.0.3)
       Installing activemodel (3.2.3)
       Installing erubis (2.7.0)
       Installing journey (1.0.4)
       Installing rack (1.4.1)
       Installing rack-cache (1.2)
       Installing rack-test (0.6.2)
       Installing hike (1.2.1)
       Installing tilt (1.3.3)
       Installing sprockets (2.1.3)
       Installing actionpack (3.2.3)
       Installing mime-types (1.19)
       Installing polyglot (0.3.3)
       Installing treetop (1.4.10)
       Installing mail (2.4.4)
       Installing actionmailer (3.2.3)
       Installing arel (3.0.2)
       Installing tzinfo (0.3.33)
       Installing activerecord (3.2.3)
       Installing activeresource (3.2.3)
       Using bundler (1.2.1)
       Installing coffee-script-source (1.3.3)
       Installing execjs (1.4.0)
       Installing coffee-script (2.2.0)
       Installing rack-ssl (1.3.2)
       Installing json (1.7.5) with native extensions
       Installing rdoc (3.12)
       Installing thor (0.14.6)
       Installing railties (3.2.3)
       Installing coffee-rails (3.2.2)
       Installing jquery-rails (2.0.2)
       Installing pg (0.12.2) with native extensions
       Installing rails (3.2.3)
       Installing sass (3.2.1)
       Installing sass-rails (3.2.4)
       Installing uglifier (1.2.3)
       Your bundle is complete! It was installed into ./vendor/bundle
       Post-install message from rdoc:
       Depending on your version of ruby, you may need to install ruby rdoc/ri data:
       <= 1.8.6 : unsupported
       = 1.8.7 : gem install rdoc-data; rdoc-data --install
       = 1.9.1 : gem install rdoc-data; rdoc-data --install
       >= 1.9.2 : nothing to do! Yay!

       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Asset precompilation completed (13.78s)
-----> Rails plugin injection
       Injecting rails_log_stdout
       Injecting rails3_serve_static_assets
-----> Discovering process types
       Procfile declares types      -> (none)
       Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 9.0MB
-----> Launching... done, v5
       http://murmuring-thicket-9165.herokuapp.com deployed to Heroku

To git@heroku.com:murmuring-thicket-9165.git
 * [new branch]      master -> master

C:\Sites\demo_app_rt32>heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.1
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       A connection attempt failed because the connected party did not
 properly respond after a period of time, or established connection failed becau
se connected host has failed to respond. - connect(2) (Errno::ETIMEDOUT)
    Backtrace:   C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/client/rendezvous.rb:39:in `initialize'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/client/rendezvous.rb:39:in `open'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/client/rendezvous.rb:39:in `block in start'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/timeout.rb:68:in `ti
meout'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/client/rendezvous.rb:31:in `start'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/command/run.rb:125:in `rendezvous_session'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/command/run.rb:112:in `run_attached'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/command/run.rb:21:in `index'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/command.rb:206:in `run'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/lib/heroku/cli.rb:28:in `start'
                 C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/heroku-2.3
2.4/bin/heroku:16:in `<top (required)>'
                 C:/RailsInstaller/Ruby1.9.3/bin/heroku:19:in `load'
                 C:/RailsInstaller/Ruby1.9.3/bin/heroku:19:in `<main>'

    Command:     heroku run rake db:migrate
    Version:     heroku-toolbelt/2.32.4 (i386-mingw32) ruby/1.9.3 autoupdate


C:\Sites\demo_app_rt32>

回答1:


See https://devcenter.heroku.com/articles/oneoff-admin-ps

The heroku run process opens a connection to Heroku on port 5000. If your local network or ISP is blocking port 5000, or you are experiencing a connectivity issue, you will see an error similar to:

$ heroku run rails console
Running rails console attached to terminal... 
Timeout awaiting process

You can test your connection to Heroku by trying to connect directly to port 5000 by using telnet to rendezvous.runtime.heroku.com. A successful session will look like this:

$ telnet rendezvous.runtime.heroku.com 5000
Trying 50.19.103.36...
Connected to ec2-50-19-103-36.compute-1.amazonaws.com.
Escape character is '^]'. 

If you do not get this output, your computer is being blocked from accessing our services. We recommend contacting your IT department, ISP, or firewall manufacturer to move forward with this issue.



来源:https://stackoverflow.com/questions/12623814/heroku-run-rake-db-migrate-error-a-connection-attempt-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!