Redirect Loop with Heroku and Rails 4 App -


my app runs fine locally, when push heroku, in firefox says "the page isn't redirecting properly" (i.e. 302 error).

running heroku logs results in bunch of requests this:

2015-06-02t21:30:26.556750+00:00 heroku[router]: at=info method=get path="/" host=www.mydomainname.com request_id=a0cb3aa2-af7c-431a-9cc4-a237e551ae0a fwd="173.27.229.45" dyno=web.1 connect=2ms service=13ms status=302 bytes=499 2015-06-02t21:30:27.761039+00:00 heroku[router]: at=info method=get path="/" host=www.mydomainname.com request_id=32026d7d-2167-4058-8ef6-8ebd15af7460 fwd="173.27.229.45" dyno=web.1 connect=2ms service=12ms status=302 bytes=499 2015-06-02t21:30:27.914344+00:00 heroku[router]: at=info method=get path="/" host=www.mydomainname.com request_id=2087a90c-fd56-4d14-b630-9c92fda30c80 fwd="173.27.229.45" dyno=web.1 connect=1ms service=15ms status=302 bytes=499 

when run "network" option under firefox's developer section, continuously shows alternating between domain , without www. example:

www.domain.com domain.com www.domain.com domain.com 

etc.

i using custom domain name have set how other apps working set up, don't think dns issue far how setup goes. also, when visit "myappname.herokuapp.com" url, redirects heroku.com reason. not sure why. ran "production check" , passes "dns configuration" section.

i realize have not provided bunch of information here (not sure else provide), ideas on next?

edit: today saying prior redirect code posted earlier:

2015-06-03t14:38:14.651296+00:00 heroku[web.2]: state changed down 2015-06-03t14:38:17.135688+00:00 heroku[web.2]: stopping processes sigterm 2015-06-03t14:38:17.774095+00:00 app[web.2]: [2015-06-03 14:38:17] fatal signalexception: sigterm 2015-06-03t14:38:17.774101+00:00 app[web.2]:    /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:170:in `select' 2015-06-03t14:38:17.774103+00:00 app[web.2]:    /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:170:in `block in start' 2015-06-03t14:38:17.774104+00:00 app[web.2]:    /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:32:in `start' 2015-06-03t14:38:17.774105+00:00 app[web.2]:    /app/vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:160:in `start' 2015-06-03t14:38:17.774106+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:35:in `run' 2015-06-03t14:38:17.774108+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/rack-1.6.0/lib/rack/server.rb:286:in `start' 2015-06-03t14:38:17.774109+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start' 2015-06-03t14:38:17.774110+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server' 2015-06-03t14:38:17.774111+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap' 2015-06-03t14:38:17.774113+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server' 2015-06-03t14:38:17.774114+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!' 2015-06-03t14:38:17.774115+00:00 app[web.2]:    /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>' 2015-06-03t14:38:17.774117+00:00 app[web.2]:    bin/rails:4:in `require' 2015-06-03t14:38:17.774118+00:00 app[web.2]:    bin/rails:4:in `<main>' 2015-06-03t14:38:17.774147+00:00 app[web.2]: [2015-06-03 14:38:17] info  webrick::httpserver#start done. 2015-06-03t14:38:17.774124+00:00 app[web.2]: [2015-06-03 14:38:17] info  going shutdown ... 2015-06-03t14:38:17.828035+00:00 app[web.2]: => booting webrick 2015-06-03t14:38:17.828041+00:00 app[web.2]: => rails 4.2.0 application starting in production on http://0.0.0.0:4223 2015-06-03t14:38:17.828043+00:00 app[web.2]: => run `rails server -h` more startup options 2015-06-03t14:38:17.828045+00:00 app[web.2]: => ctrl-c shutdown server 2015-06-03t14:38:17.828046+00:00 app[web.2]: exiting 2015-06-03t14:38:18.624457+00:00 heroku[web.2]: process exited status 143 

edit 2: re-cloned repository different directory , ran heroku create, git push heroku master, , heroku run rake db:migrate. did eliminate possible dns issues. log says:

2015-06-03t15:55:51.082260+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path="/" host=lit-inlet-1933.herokuapp.com request_id=2cd494b9-8f93-4270-b8db-e1dda9a6ab4a fwd="173.27.229.45" dyno= connect= service= status=503 bytes= 2015-06-03t15:55:51.274766+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=lit-inlet-1933.herokuapp.com request_id=78128ada-cb90-4580-8102-be756ec7b7cc fwd="173.27.229.45" dyno= connect= service= status=503 bytes= 2015-06-03t15:55:53.861456+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=lit-inlet-1933.herokuapp.com request_id=6d89785d-1b00-4b40-8984-15dbbe5e994f fwd="173.27.229.45" dyno= connect= service= status=503 bytes= 

this shows 2 crashes root url "/" , 2 crashes on /favicon.ico. based on favicon.ico, removed favicons root page test. app behaving earlier one: redirects heroku.com instead of loading page , logs says:

2015-06-03t16:00:42.804253+00:00 heroku[web.1]: state changed crashed starting 2015-06-03t16:00:48.568268+00:00 heroku[web.1]: starting process command `bin/rails server -p 25258 -e production` 2015-06-03t16:00:57.769255+00:00 app[web.1]: [2015-06-03 16:00:57] info  webrick 1.3.1 2015-06-03t16:00:57.769284+00:00 app[web.1]: [2015-06-03 16:00:57] info  ruby 2.1.5 (2014-11-13) [x86_64-linux] 2015-06-03t16:00:57.769643+00:00 app[web.1]: [2015-06-03 16:00:57] info  webrick::httpserver#start: pid=3 port=25258 2015-06-03t16:00:58.321124+00:00 heroku[web.1]: state changed starting 2015-06-03t16:01:00.754258+00:00 heroku[router]: at=info method=get path="/" host=lit-inlet-1933.herokuapp.com request_id=8664d409-5542-4bee-914d-00639c08c2d0 fwd="173.27.229.45" dyno=web.1 connect=1ms service=174ms status=302 bytes=501 

the root url simple. there welcome_controller:

class welcomecontroller < applicationcontroller   skip_before_filter :authenticate_user!, only: :index    def index       end end 

and view is:

  <div class="jumbotron">     <h1> task clash</h1>     <p>a ridiculously simple , easy-to-use crm/time tracking tool aimed @ small businesses!</p>     <p><%= link_to "create account", new_account_path, class: "btn btn-primary btn-lg" %></p>   </div> 

any appreciated!

edit 3: added rails_12factor gemfile , this:

2015-06-03t19:37:48.713189+00:00 heroku[router]: at=info method=get path="/" host=www.taskclash.com request_id=c0dfd7ac-233c-4be9-a155-57b66f9a84cb fwd="173.27.229.45" dyno=web.1 connect=0ms service=12ms status=302 bytes=435 2015-06-03t19:37:48.700898+00:00 app[web.1]: started "/" 173.27.229.45 @ 2015-06-03 19:37:48 +0000 2015-06-03t19:37:48.710826+00:00 app[web.1]:   account load (1.4ms)  select  "public"."accounts".* "public"."accounts" "public"."accounts"."subdomain" = $1 limit 1  [["subdomain", "www"]] 2015-06-03t19:37:48.711577+00:00 app[web.1]: filter chain halted :load_schema rendered or redirected 2015-06-03t19:37:48.711704+00:00 app[web.1]: completed 302 found in 8ms (activerecord: 6.5ms) 2015-06-03t19:37:48.703333+00:00 app[web.1]: processing taskscontroller#index html 2015-06-03t19:37:48.711291+00:00 app[web.1]: redirected https://taskclash.com/ 

check if there's production migration pending. run terminal command: $ heroku run rake db:migrate

if there no migrations pending, post more lines of logs.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -