0

I am having an issue with my web application opening after being pushed to Heroku from Ruby on Rails. When I test out my application within the cloud9 ide it opens and works perfectly. However when I try to open it after merging all the branches to the master and pushing both the master to git and to Heroku I get this:

https://limitless-fortress-32820.herokuapp.com/

I am unsure how to fix this. Any advice?

This is what the logs say:

2017-03-11T02:43:48.982178+00:00 app[web.1]: D, [2017-03-11T02:43:48.982112 #4] DEBUG -- : [9828508f-52fc-489a-9bda-d680b05f1c28]   Plan Load (0.7ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
2017-03-11T02:43:48.983225+00:00 app[web.1]: D, [2017-03-11T02:43:48.983167 #4] DEBUG -- : [9828508f-52fc-489a-9bda-d680b05f1c28]   Plan Load (0.6ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 3], ["LIMIT", 1]]
2017-03-11T02:43:48.983770+00:00 app[web.1]: I, [2017-03-11T02:43:48.983713 #4]  INFO -- : [9828508f-52fc-489a-9bda-d680b05f1c28] Completed 404 Not Found in 3ms (ActiveRecord: 1.4ms)
2017-03-11T02:43:48.984196+00:00 app[web.1]: F, [2017-03-11T02:43:48.984142 #4] FATAL -- : [9828508f-52fc-489a-9bda-d680b05f1c28]   
2017-03-11T02:43:48.984248+00:00 app[web.1]: F, [2017-03-11T02:43:48.984196 #4] FATAL -- : [9828508f-52fc-489a-9bda-d680b05f1c28] ActiveRecord::RecordNotFound (Couldn't find Plan with 'id'=3):
2017-03-11T02:43:48.984296+00:00 app[web.1]: F, [2017-03-11T02:43:48.984249 #4] FATAL -- : [9828508f-52fc-489a-9bda-d680b05f1c28]   
2017-03-11T02:43:48.984347+00:00 app[web.1]: F, [2017-03-11T02:43:48.984296 #4] FATAL -- : [9828508f-52fc-489a-9bda-d680b05f1c28] app/controllers/pages_controller.rb:5:in `home'
2017-03-11T03:20:33.758477+00:00 heroku[web.1]: Idling
2017-03-11T03:20:33.759144+00:00 heroku[web.1]: State changed from up to down
2017-03-11T03:20:34.554844+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-03-11T03:20:34.566891+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2017-03-11T03:20:34.566983+00:00 app[web.1]: === puma shutdown: 2017-03-11 03:20:34 +0000 ===
2017-03-11T03:20:34.566987+00:00 app[web.1]: - Goodbye!
2017-03-11T03:20:34.567392+00:00 app[web.1]: Exiting
2017-03-11T03:20:34.775834+00:00 heroku[web.1]: Process exited with status 0
2017-03-11T05:25:57.075991+00:00 heroku[web.1]: Unidling
2017-03-11T05:25:57.076291+00:00 heroku[web.1]: State changed from down to starting
2017-03-11T05:26:01.138390+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 56896 -e production`
2017-03-11T05:26:06.849508+00:00 app[web.1]: => Booting Puma
2017-03-11T05:26:06.849544+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:56896
2017-03-11T05:26:06.849552+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-03-11T05:26:07.935302+00:00 app[web.1]: Puma starting in single mode...
2017-03-11T05:26:07.935323+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
2017-03-11T05:26:07.935324+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-03-11T05:26:07.935325+00:00 app[web.1]: * Environment: production
2017-03-11T05:26:07.935466+00:00 app[web.1]: * Listening on tcp://0.0.0.0:56896
2017-03-11T05:26:07.935709+00:00 app[web.1]: Use Ctrl-C to stop
2017-03-11T05:26:08.316445+00:00 heroku[web.1]: State changed from starting to up
2017-03-11T05:26:11.211047+00:00 app[web.1]: I, [2017-03-11T05:26:11.210942 #4]  INFO -- : [d795b023-4103-41a2-8825-ecb50be24fdd] Started HEAD "/" for 184.72.76.14 at 2017-03-11 05:26:11 +0000
2017-03-11T05:26:11.214433+00:00 app[web.1]: I, [2017-03-11T05:26:11.214374 #4]  INFO -- : [d795b023-4103-41a2-8825-ecb50be24fdd] Processing by PagesController#home as HTML
2017-03-11T05:26:11.243975+00:00 app[web.1]: D, [2017-03-11T05:26:11.243829 #4] DEBUG -- : [d795b023-4103-41a2-8825-ecb50be24fdd]   Plan Load (0.9ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
2017-03-11T05:26:11.257064+00:00 app[web.1]: D, [2017-03-11T05:26:11.256920 #4] DEBUG -- : [d795b023-4103-41a2-8825-ecb50be24fdd]   Plan Load (0.7ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 3], ["LIMIT", 1]]
2017-03-11T05:26:11.257752+00:00 app[web.1]: I, [2017-03-11T05:26:11.257692 #4]  INFO -- : [d795b023-4103-41a2-8825-ecb50be24fdd] Completed 404 Not Found in 43ms (ActiveRecord: 7.9ms)
2017-03-11T05:26:11.258611+00:00 app[web.1]: F, [2017-03-11T05:26:11.258542 #4] FATAL -- : [d795b023-4103-41a2-8825-ecb50be24fdd]   
2017-03-11T05:26:11.258689+00:00 app[web.1]: F, [2017-03-11T05:26:11.258627 #4] FATAL -- : [d795b023-4103-41a2-8825-ecb50be24fdd] ActiveRecord::RecordNotFound (Couldn't find Plan with 'id'=3):
2017-03-11T05:26:11.258744+00:00 app[web.1]: F, [2017-03-11T05:26:11.258692 #4] FATAL -- : [d795b023-4103-41a2-8825-ecb50be24fdd]   
2017-03-11T05:26:11.258855+00:00 app[web.1]: F, [2017-03-11T05:26:11.258746 #4] FATAL -- : [d795b023-4103-41a2-8825-ecb50be24fdd] app/controllers/pages_controller.rb:5:in `home'
2017-03-11T05:26:11.258728+00:00 heroku[router]: at=info method=HEAD path="/" host=limitless-fortress-32820.herokuapp.com request_id=d795b023-4103-41a2-8825-ecb50be24fdd fwd="184.72.76.14" dyno=web.1 connect=12ms service=118ms status=404 bytes=180 protocol=https
2017-03-11T05:58:12.552944+00:00 heroku[web.1]: Idling
2017-03-11T05:58:12.553609+00:00 heroku[web.1]: State changed from up to down
2017-03-11T05:58:13.333628+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-03-11T05:58:13.379474+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2017-03-11T05:58:13.379914+00:00 app[web.1]: === puma shutdown: 2017-03-11 05:58:13 +0000 ===
2017-03-11T05:58:13.379919+00:00 app[web.1]: - Goodbye!
2017-03-11T05:58:13.380079+00:00 app[web.1]: Exiting
2017-03-11T05:58:13.710764+00:00 heroku[web.1]: Process exited with status 0
2017-03-11T07:27:27.616986+00:00 heroku[web.1]: Unidling
2017-03-11T07:27:27.617784+00:00 heroku[web.1]: State changed from down to starting
2017-03-11T07:27:30.484604+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 53485 -e production`
2017-03-11T07:27:34.063443+00:00 app[web.1]: => Booting Puma
2017-03-11T07:27:34.063485+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:53485
2017-03-11T07:27:34.063487+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-03-11T07:27:34.745431+00:00 app[web.1]: Puma starting in single mode...
2017-03-11T07:27:34.745451+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
2017-03-11T07:27:34.745452+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-03-11T07:27:34.745453+00:00 app[web.1]: * Environment: production
2017-03-11T07:27:34.745551+00:00 app[web.1]: * Listening on tcp://0.0.0.0:53485
2017-03-11T07:27:34.745760+00:00 app[web.1]: Use Ctrl-C to stop
2017-03-11T07:27:35.323498+00:00 heroku[web.1]: State changed from starting to up
2017-03-11T07:27:36.716062+00:00 heroku[router]: at=info method=GET path="/" host=limitless-fortress-32820.herokuapp.com request_id=3034176c-dd58-4af0-8f70-745f440273db fwd="125.62.127.212" dyno=web.1 connect=0ms service=67ms status=404 bytes=1744 protocol=https
2017-03-11T07:27:36.683610+00:00 app[web.1]: I, [2017-03-11T07:27:36.683527 #4]  INFO -- : [3034176c-dd58-4af0-8f70-745f440273db] Started GET "/" for 125.62.127.212 at 2017-03-11 07:27:36 +0000
2017-03-11T07:27:36.686611+00:00 app[web.1]: I, [2017-03-11T07:27:36.686528 #4]  INFO -- : [3034176c-dd58-4af0-8f70-745f440273db] Processing by PagesController#home as HTML
2017-03-11T07:27:36.705959+00:00 app[web.1]: D, [2017-03-11T07:27:36.705867 #4] DEBUG -- : [3034176c-dd58-4af0-8f70-745f440273db]   Plan Load (0.6ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
2017-03-11T07:27:36.715238+00:00 app[web.1]: D, [2017-03-11T07:27:36.715149 #4] DEBUG -- : [3034176c-dd58-4af0-8f70-745f440273db]   Plan Load (2.1ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 3], ["LIMIT", 1]]
2017-03-11T07:27:36.715738+00:00 app[web.1]: I, [2017-03-11T07:27:36.715679 #4]  INFO -- : [3034176c-dd58-4af0-8f70-745f440273db] Completed 404 Not Found in 29ms (ActiveRecord: 8.8ms)
2017-03-11T07:27:36.716195+00:00 app[web.1]: F, [2017-03-11T07:27:36.716134 #4] FATAL -- : [3034176c-dd58-4af0-8f70-745f440273db]   
2017-03-11T07:27:36.716273+00:00 app[web.1]: F, [2017-03-11T07:27:36.716193 #4] FATAL -- : [3034176c-dd58-4af0-8f70-745f440273db] ActiveRecord::RecordNotFound (Couldn't find Plan with 'id'=3):
2017-03-11T07:27:36.716324+00:00 app[web.1]: F, [2017-03-11T07:27:36.716271 #4] FATAL -- : [3034176c-dd58-4af0-8f70-745f440273db]   
2017-03-11T07:27:36.716375+00:00 app[web.1]: F, [2017-03-11T07:27:36.716321 #4] FATAL -- : [3034176c-dd58-4af0-8f70-745f440273db] app/controllers/pages_controller.rb:5:in `home'
2017-03-11T07:27:37.337320+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=limitless-fortress-32820.herokuapp.com request_id=20bb1588-0933-4517-9605-0fdac9f274af fwd="125.62.127.212" dyno=web.1 connect=0ms service=1ms status=200 bytes=143 protocol=https
2017-03-11T08:01:45.234016+00:00 heroku[web.1]: Idling
2017-03-11T08:01:45.234777+00:00 heroku[web.1]: State changed from up to down
2017-03-11T08:01:46.059828+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-03-11T08:01:46.113060+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2017-03-11T08:01:46.113197+00:00 app[web.1]: === puma shutdown: 2017-03-11 08:01:46 +0000 ===
2017-03-11T08:01:46.113203+00:00 app[web.1]: - Goodbye!
2017-03-11T08:01:46.113318+00:00 app[web.1]: Exiting
2017-03-11T08:01:46.472377+00:00 heroku[web.1]: Process exited with status 0
2017-03-11T16:26:53.013220+00:00 heroku[web.1]: Unidling
2017-03-11T16:26:53.013532+00:00 heroku[web.1]: State changed from down to starting
2017-03-11T16:26:55.743205+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 42518 -e production`
2017-03-11T16:26:59.184085+00:00 app[web.1]: => Booting Puma
2017-03-11T16:26:59.184112+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:42518
2017-03-11T16:26:59.184113+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-03-11T16:26:59.813953+00:00 app[web.1]: Puma starting in single mode...
2017-03-11T16:26:59.813978+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
2017-03-11T16:26:59.814009+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-03-11T16:26:59.814025+00:00 app[web.1]: * Environment: production
2017-03-11T16:26:59.814139+00:00 app[web.1]: * Listening on tcp://0.0.0.0:42518
2017-03-11T16:26:59.814338+00:00 app[web.1]: Use Ctrl-C to stop
2017-03-11T16:27:00.213490+00:00 heroku[web.1]: State changed from starting to up
2017-03-11T16:27:01.161259+00:00 heroku[router]: at=info method=GET path="/" host=limitless-fortress-32820.herokuapp.com request_id=0394b2a7-1f84-42a8-9f38-5093385535b9 fwd="68.113.158.107,66.249.88.31" dyno=web.1 connect=1ms service=77ms status=404 bytes=1744 protocol=https
2017-03-11T16:27:01.104510+00:00 app[web.1]: I, [2017-03-11T16:27:01.104407 #4]  INFO -- : [0394b2a7-1f84-42a8-9f38-5093385535b9] Started GET "/" for 66.249.88.31 at 2017-03-11 16:27:01 +0000
2017-03-11T16:27:01.107677+00:00 app[web.1]: I, [2017-03-11T16:27:01.107612 #4]  INFO -- : [0394b2a7-1f84-42a8-9f38-5093385535b9] Processing by PagesController#home as HTML
2017-03-11T16:27:01.138947+00:00 app[web.1]: D, [2017-03-11T16:27:01.138843 #4] DEBUG -- : [0394b2a7-1f84-42a8-9f38-5093385535b9]   Plan Load (2.7ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
2017-03-11T16:27:01.144670+00:00 app[web.1]: D, [2017-03-11T16:27:01.144594 #4] DEBUG -- : [0394b2a7-1f84-42a8-9f38-5093385535b9]   Plan Load (1.0ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = $1 LIMIT $2  [["id", 3], ["LIMIT", 1]]
2017-03-11T16:27:01.145093+00:00 app[web.1]: I, [2017-03-11T16:27:01.145032 #4]  INFO -- : [0394b2a7-1f84-42a8-9f38-5093385535b9] Completed 404 Not Found in 37ms (ActiveRecord: 16.8ms)
2017-03-11T16:27:01.145493+00:00 app[web.1]: F, [2017-03-11T16:27:01.145437 #4] FATAL -- : [0394b2a7-1f84-42a8-9f38-5093385535b9]   
2017-03-11T16:27:01.145518+00:00 app[web.1]: F, [2017-03-11T16:27:01.145485 #4] FATAL -- : [0394b2a7-1f84-42a8-9f38-5093385535b9] ActiveRecord::RecordNotFound (Couldn't find Plan with 'id'=3):
2017-03-11T16:27:01.145558+00:00 app[web.1]: F, [2017-03-11T16:27:01.145518 #4] FATAL -- : [0394b2a7-1f84-42a8-9f38-5093385535b9]   
2017-03-11T16:27:01.145592+00:00 app[web.1]: F, [2017-03-11T16:27:01.145552 #4] FATAL -- : [0394b2a7-1f84-42a8-9f38-5093385535b9] app/controllers/pages_controller.rb:5:in `home'

I am unfamiliar with deciphering what this means. This is my first application.

1
  • The best way is to check the log, I use paperclip app. You need to install paperclick and carefully check the log. Copy the error messages in the log and search stackoverflow for the solution Mar 10, 2017 at 23:52

3 Answers 3

0

Have you run all the migrations and set up the environment variables? Enable Papertrail on your site. Then you can view the logs which should show what the error is.

9
  • Ok let me give it a shot. Thanks for the reply. Mar 10, 2017 at 22:30
  • I'm not quite sure how to decipher this log. Mar 10, 2017 at 22:54
  • visit the root of your app and in papertrail logs look for the logentry for the GET request e.g. `Started GET "/". After that line, there will be entries detailing what went wrong with the request. If you don't understand the logs, post a screenshot here
    – margo
    Mar 11, 2017 at 11:07
  • I was able to run papertrail. I posted the outcome in the original post because that was the only place I had enough characters. Mar 11, 2017 at 23:28
  • The application starts with a GET request to "/", the root route, which is handled by the 'home' method in the PagesController. Line 5 in that controller instigates an active record query looking for a 'plan' with id = 3. It can't find that particular resource in the database. Maybe you need to set up the database on production? How do you handle the situation where the active record query doesn't return what you expect it to?
    – margo
    Mar 12, 2017 at 13:28
0

The best way to see whats happening here is by reading the logs. You can do this by running:

heroku logs -a limitless-fortress-32820 (or whatever you named your app)

You would do this in your commandline and this assumes that you have the heroku cli tools installed. Check for the error the log is displaying and go from there. It could be a procfile, environmental variable issue, migration issue or any number of things.

0

To check heroku logs in real time:

heroku logs -t -a limitless-fortress-32820

Check following to resolve issues: 1. Have you used PG database? 2. Is all Migration file run?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.