Cant get MongoLab database to work on heroku - ruby-on-rails

I have deployed my app to heroku but and I can see the app but the app is NOT accessing the mongolab database. I have tried resetting the database in console with
$ heroku run rake db:reset
but I get this error.
failed with error 13: "not authorized on ENV['MONGOID_DATABASE'] to execute command { dropDatabase: 1 }"
See https://github.com/mongodb/mongo/blob/master/docs/errors.md
Not sure what I am doing wrong, I have not setup an app with mongoid on heroku before, this is my first time
-UPDATE-
Here is the end of the log I have that seems to show the post is not working.
$ heroku logs
2015-09-25T16:20:15.770927+00:00 heroku[router]: at=info method=POST path="/managers" host=beta.herokuapp.com request_id=95709038-02e9-45b1-8300-0aebc287f6c1 fwd="162.239.42.196" dyno=web.1 connect=0ms service=178ms status=500 bytes=1480
2015-09-25T16:20:15.770408+00:00 app[web.1]: D, [2015-09-25T16:20:15.770342 #3] DEBUG -- : MOPED: 10.152.165.9:29821 QUERY database=ENV['MONGOID_DATABASE'] collection=managers selector={"email"=>"sample#email.com"} flags=[] limit=-1 skip=0 batch_size=nil fields={:_id=>1} runtime: 1.0352ms
Here are the router logs...
$ heroku logs --ps router
2015-09-25T20:40:46.935184+00:00 heroku[router]: at=info method=POST path="/managers" host=beta.herokuapp.com request_id=c1673463-a69f-4111-bd4d-01fdb5516ad0 fwd="162.239.42.196" dyno=web.1 connect=2ms service=109ms status=500 bytes=1480
2015-09-25T20:40:47.285029+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=beta.herokuapp.com request_id=1e998283-b02b-4cc5-83f6-7996a6991531 fwd="162.239.42.196" dyno=web.1 connect=1ms service=2ms status=200 bytes=143
2015-09-26T04:45:32.833599+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=beta.herokuapp.com request_id=59ccc2e7-18d4-4c08-8b08-a653f5d11714 fwd="2602:30a:2ef2:ac40:acb1:9144:79b4:affb,66.249.88.51" dyno=web.1 connect=1ms service=4ms status=200 bytes=143
I also see it failing to query the database
2015-09-26T05:03:39.852170+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"WVGY+XLD...A=", "manager"=>{"name"=>"Blah Blah", "company"=>"Blah Blah CO.", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2015-09-26T05:03:40.138442+00:00 app[web.1]: D, [2015-09-26T05:03:40.138321 #3] DEBUG -- : MOPED: 10.152.165.9:29821 COMMAND database=admin command={:ismaster=>1} runtime: 23.5306ms
2015-09-26T05:03:40.146776+00:00 app[web.1]: Completed 500 Internal Server Error in 294ms
2015-09-26T05:03:40.146782+00:00 app[web.1]: Completed 500 Internal Server Error in 294ms
2015-09-26T05:03:40.152205+00:00 app[web.1]:
2015-09-26T05:03:40.152208+00:00 app[web.1]: Moped::Errors::QueryFailure (The operation: #<Moped::Protocol::Query
2015-09-26T05:03:40.152209+00:00 app[web.1]: #length=112
2015-09-26T05:03:40.152211+00:00 app[web.1]: #request_id=4
2015-09-26T05:03:40.152212+00:00 app[web.1]: #response_to=0
2015-09-26T05:03:40.152214+00:00 app[web.1]: #op_code=2004
2015-09-26T05:03:40.152215+00:00 app[web.1]: #flags=[]
2015-09-26T05:03:40.152216+00:00 app[web.1]: #full_collection_name="ENV['MONGOID_DATABASE'].managers"
2015-09-26T05:03:40.152218+00:00 app[web.1]: #skip=0
2015-09-26T05:03:40.152219+00:00 app[web.1]: #limit=-1
2015-09-26T05:03:40.152222+00:00 app[web.1]: #selector={"email"=>"sample#email.com"}
2015-09-26T05:03:40.152224+00:00 app[web.1]: #fields={:_id=>1}>
2015-09-26T05:03:40.152225+00:00 app[web.1]: failed with error 13: "not authorized for query on ENV['MONGOID_DATABASE'].managers"
2015-09-26T05:03:40.152227+00:00 app[web.1]:
2015-09-26T05:03:40.152228+00:00 app[web.1]: See https://github.com/mongodb/mongo/blob/master/docs/errors.md

I figured it out. The db was not connecting because the mongoid.yml file was incorrect. I tweaked the yml file and added the URI to the heroku variables and it worked correctly.

Related

Heroku not working and I don't know where to start

I apologize for this being a vague question but I don't know what is going wrong so I don't know how to ask the questions.
I set up a rails app and it's working locally. However, when creating it on Heroku Create and it gets set up on my Heroku server it does not work. When I run Heroku open I get this page:
https://polar-taiga-65467.herokuapp.com/
I can post logs or anything else to help. If someone can help me figure out what to do from here it would be appreciated.
Here is my GitHub project: https://github.com/TomTom319/morali-tee
Here is the log from Heroku:
2018-01-16T05:13:18.292500+00:00 app[web.1]: I,
[2018-01-16T05:13:18.292411 #4] INFO -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] Rendering simple_pages/index.html.erb within layouts/application
2018-01-16T05:13:18.295106+00:00 app[web.1]:
[99bf3dd0-59b3-4438-a3f7-36a037174b55] 3: 2018-01-16T05:13:18.293930+00:00 app[web.1]: I,
[2018-01-16T05:13:18.293863 #4] INFO -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] Rendered simple_pages/index.html.erb within layouts/application (1.3ms)
2018-01-16T05:13:18.294179+00:00 app[web.1]: I,
[2018-01-16T05:13:18.294089 #4] INFO -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] Completed 500 Internal Server Error in 15ms 2018-01-16T05:13:18.294881+00:00 app[web.1]: F,
[2018-01-16T05:13:18.294798 #4] FATAL -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] 2018-01-16T05:13:18.295107+00:00 app[web.1]:
[99bf3dd0-59b3-4438-a3f7-36a037174b55] 4: <%= image_tag("yellowtee", class: "img-responsive first-tee")%>
2018-01-16T05:13:18.295101+00:00 app[web.1]: F,
[2018-01-16T05:13:18.295028 #4] FATAL -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] 1: <h1 style="color:red;">MoraliTee</h1> 2018-01-16T05:13:18.295104+00:00
app[web.1]: [99bf3dd0-59b3-4438-a3f7-36a037174b55] 2: <p>Welcome! We are on a mission to give back to people around the world</p>
2018-01-16T05:13:18.295158+00:00 app[web.1]: F,
[2018-01-16T05:13:18.295086 #4] FATAL -- :
[99bf3dd0-59b3-4438-a3f7-36a037174b55] 2018-01-16T05:13:18.760114+00:00 heroku[router]: at=info method=GET
path="/favicon.ico" host=polar-taiga-65467.herokuapp.com
request_id=6a2ec4b7-7054-46b7-b76a-28ef5ab3f69a fwd="24.15.217.85"
dyno=web.1 connect=0ms service=2ms status=200 bytes=143 protocol=https
2018-01-16T05:13:18.293286+00:00 heroku[router]: at=info method=GET
path="/" host=polar-taiga-65467.herokuapp.com
request_id=99bf3dd0-59b3-4438-a3f7-36a037174b55 fwd="24.15.217.85" dyno=web.1 connect=0ms service=22ms status=500 bytes=1827
protocol=https
Simple_pages/index.html.erb code below:
<h1 style="color:red;">MoraliTee</h1>
<p>Welcome! We are on a mission to give back to people around the
world</p>
<%= image_tag("yellowtee", class: "img-responsive first-tee")%>
There was a file type missing from the end of my image on my simple_pages/index.html.erb page. I needed to .jpg to the end of my source in my image_tag.
Thank you #mmichael for your help in identifying the issue.
I thought there was something wrong with my db but I was incorrect. Thanks for your help.

Ruby on Rails app on a Heroku environment: "Sending Email with Mailgun" error

I was trying to test sending an e-mail from a contact form of a Rails app based at an Heroku server and I got an error saying:
We're sorry, but something went wrong. If you are the application owner check the logs for more information.
My intention was to learn how to integrate a mail server service into my Heroku account. For that, the addon used was MailGun. I even created a MailGun account with my personal e-mail to be able to check if I'm getting the e-mails or not.
After deploying the code from the Cloud9 environment to Heroku servers with the success, the only change I made in my Ruby code was the following stuff:
config/environment.rb
ActionMailer::Base.smtp_settings = {
:port => ENV['MAILGUN_SMTP_PORT'],
:address => ENV['MAILGUN_SMTP_SERVER'],
:user_name => ENV['MAILGUN_SMTP_LOGIN'],
:password => ENV['MAILGUN_SMTP_PASSWORD'],
:domain => 'blahblahblah.herokuapp.com',
:authentication => :plain,
}
ActionMailer::Base.delivery_method = :smtp
What's the problem? Any tip for a solution?
Updated Requested Info (Heroku Logs - I can't update all the logs due to restriction of characters in StackOverflow body):
iamsamuel:~/workspace/saasapp (master) $ heroku logs
2017-02-24T20:18:19.316716+00:00 app[web.1]: Content-Type: text/html;
2017-02-24T20:18:19.316717+00:00 app[web.1]: charset=UTF-8
2017-02-24T20:18:19.316718+00:00 app[web.1]: Content-Transfer-Encoding: 7bit
2017-02-24T20:18:19.316718+00:00 app[web.1]:
2017-02-24T20:18:19.316719+00:00 app[web.1]: <!DOCTYPE html>
2017-02-24T20:18:19.316719+00:00 app[web.1]: <html>
2017-02-24T20:18:19.316720+00:00 app[web.1]: <head>
2017-02-24T20:18:19.316721+00:00 app[web.1]: </head>
2017-02-24T20:18:19.316721+00:00 app[web.1]: <body>
2017-02-24T20:18:19.316722+00:00 app[web.1]: <p>
2017-02-24T20:18:19.316723+00:00 app[web.1]: You have received a message from the site's contact form, from Sam, smlmrr#outlook.com.
2017-02-24T20:18:19.316724+00:00 app[web.1]: </p>
2017-02-24T20:18:19.316724+00:00 app[web.1]: <p>
2017-02-24T20:18:19.316725+00:00 app[web.1]:
2017-02-24T20:18:19.316725+00:00 app[web.1]: </p>
2017-02-24T20:18:19.316726+00:00 app[web.1]: </body>
2017-02-24T20:18:19.316726+00:00 app[web.1]: </html>
2017-02-24T20:18:19.316886+00:00 app[web.1]: I, [2017-02-24T20:18:19.316838 #4] INFO -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Completed 500 Internal Server Error in 1166ms (ActiveRecord: 4.1ms)
2017-02-24T20:18:19.317316+00:00 app[web.1]: F, [2017-02-24T20:18:19.317273 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c]
2017-02-24T20:18:19.317357+00:00 app[web.1]: F, [2017-02-24T20:18:19.317318 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
2017-02-24T20:18:19.317358+00:00 app[web.1]: ):
2017-02-24T20:18:19.317396+00:00 app[web.1]: F, [2017-02-24T20:18:19.317355 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c]
2017-02-24T20:18:19.317435+00:00 app[web.1]: F, [2017-02-24T20:18:19.317396 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] app/controllers/contacts_controller.rb:15:in `create'
2017-02-24T20:18:19.520898+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=62153ff0-bef7-4e44-958b-447fb18e7c23 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:53:16.169251+00:00 heroku[web.1]: Idling
2017-02-24T20:53:16.169901+00:00 heroku[web.1]: State changed from up to down
2017-02-24T20:53:17.034264+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-02-24T20:53:17.078764+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2017-02-24T20:53:17.078952+00:00 app[web.1]: === puma shutdown: 2017-02-24 20:53:17 +0000 ===
2017-02-24T20:53:17.078957+00:00 app[web.1]: - Goodbye!
2017-02-24T20:53:17.079100+00:00 app[web.1]: Exiting
2017-02-24T20:53:17.347515+00:00 heroku[web.1]: Process exited with status 0
2017-02-24T20:57:24.680979+00:00 heroku[web.1]: Unidling
2017-02-24T20:57:24.681258+00:00 heroku[web.1]: State changed from down to starting
2017-02-24T20:57:27.221989+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 44473 -e production`
2017-02-24T20:57:30.299354+00:00 app[web.1]: => Booting Puma
2017-02-24T20:57:30.299447+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:44473
2017-02-24T20:57:30.299502+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-02-24T20:57:31.229688+00:00 app[web.1]: Puma starting in single mode...
2017-02-24T20:57:31.229714+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-02-24T20:57:31.229713+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
2017-02-24T20:57:31.229716+00:00 app[web.1]: * Environment: production
2017-02-24T20:57:31.229813+00:00 app[web.1]: * Listening on tcp://0.0.0.0:44473
2017-02-24T20:57:31.230029+00:00 app[web.1]: Use Ctrl-C to stop
2017-02-24T20:57:31.421917+00:00 heroku[web.1]: State changed from starting to up
2017-02-24T20:57:32.788592+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=dedd394a-498a-464d-a669-ed19fa2fd418 fwd="188.83.235.112" dyno=web.1 connect=0ms service=58ms status=200 bytes=2753
2017-02-24T20:57:32.737531+00:00 app[web.1]: I, [2017-02-24T20:57:32.737424 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Started GET "/" for 188.83.235.112 at 2017-02-24 20:57:32 +0000
2017-02-24T20:57:32.740219+00:00 app[web.1]: I, [2017-02-24T20:57:32.740152 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Processing by PagesController#home as HTML
2017-02-24T20:57:32.752357+00:00 app[web.1]: I, [2017-02-24T20:57:32.752273 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendering pages/home.html.erb within layouts/application
2017-02-24T20:57:32.753153+00:00 app[web.1]: I, [2017-02-24T20:57:32.753082 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendered pages/home.html.erb within layouts/application (0.6ms)
2017-02-24T20:57:32.759595+00:00 app[web.1]: I, [2017-02-24T20:57:32.759524 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Completed 200 OK in 19ms (Views: 8.6ms | ActiveRecord: 0.0ms)
2017-02-24T20:57:32.929609+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=80d55a95-cbe8-4982-a571-bc8850567a87 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:32.928158+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=a9c456f3-e7cd-4d6a-865f-2c8f5efbdaa7 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:33.143930+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=90d78563-eaa6-4f24-a054-5c89beada59c fwd="188.83.235.112" dyno=web.1 connect=3ms service=1ms status=304 bytes=48
2017-02-24T20:57:33.402193+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=7c20311c-bd5a-46c3-a9d5-c6266c1f9331 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:50.706814+00:00 heroku[router]: at=info method=GET path="/contact-us" host=infinite-forest-28304.herokuapp.com request_id=0ec752b1-0d75-42dd-83f6-ecd127086bfb fwd="188.83.235.112" dyno=web.1 connect=0ms service=35ms status=200 bytes=4317
2017-02-24T20:57:50.651067+00:00 app[web.1]: I, [2017-02-24T20:57:50.650984 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Started GET "/contact-us" for 188.83.235.112 at 2017-02-24 20:57:50 +0000
2017-02-24T20:57:50.652579+00:00 app[web.1]: I, [2017-02-24T20:57:50.652518 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Processing by ContactsController#new as HTML
2017-02-24T20:57:50.669618+00:00 app[web.1]: I, [2017-02-24T20:57:50.669536 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendering contacts/new.html.erb within layouts/application
2017-02-24T20:57:50.681558+00:00 app[web.1]: I, [2017-02-24T20:57:50.681481 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendered contacts/new.html.erb within layouts/application (11.8ms)
2017-02-24T20:57:50.682909+00:00 app[web.1]: I, [2017-02-24T20:57:50.682846 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Completed 200 OK in 30ms (Views: 14.0ms | ActiveRecord: 7.5ms)
2017-02-24T20:59:14.426470+00:00 app[web.1]: I, [2017-02-24T20:59:14.426395 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Started POST "/contacts" for 188.83.235.112 at 2017-02-24 20:59:14 +0000
2017-02-24T20:59:14.427281+00:00 app[web.1]: I, [2017-02-24T20:59:14.427232 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Processing by ContactsController#create as HTML
2017-02-24T20:59:14.427366+00:00 app[web.1]: I, [2017-02-24T20:59:14.427324 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Parameters: {"utf8"=>"✓", "authenticity_token"=>"MgrtXM/8aUAYPnJ2ph4eIbsqMbLR/xXMZabcKmKh4myMlp0MdLJ2dCHnh7KshXSCqAsIzGQr0SdebpJw1v0QHw==", "contact"=>{"name"=>"Jesse Pinkman", "email"=>"jp#example.com", "comments"=>"Yo Beach!"}, "commit"=>"Submit"}
2017-02-24T20:59:14.429694+00:00 app[web.1]: D, [2017-02-24T20:59:14.429641 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (0.9ms) BEGIN
2017-02-24T20:59:14.434537+00:00 app[web.1]: D, [2017-02-24T20:59:14.434485 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] SQL (1.3ms) INSERT INTO "contacts" ("name", "email", "comments", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Jesse Pinkman"], ["email", "jp#example.com"], ["comments", "Yo Beach!"], ["created_at", 2017-02-24 20:59:14 UTC], ["updated_at", 2017-02-24 20:59:14 UTC]]
2017-02-24T20:59:14.436712+00:00 app[web.1]: D, [2017-02-24T20:59:14.436665 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (1.9ms) COMMIT
2017-02-24T20:59:14.441776+00:00 app[web.1]: I, [2017-02-24T20:59:14.441724 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendering contact_mailer/contact_email.html.erb
2017-02-24T20:59:14.442284+00:00 app[web.1]: I, [2017-02-24T20:59:14.442237 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendered contact_mailer/contact_email.html.erb (0.4ms)
2017-02-24T20:59:14.622612+00:00 app[web.1]: D, [2017-02-24T20:59:14.622518 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] ContactMailer#contact_email: processed outbound mail in 184.5ms
2017-02-24T20:59:14.749027+00:00 heroku[router]: at=info method=POST path="/contacts" host=infinite-forest-28304.herokuapp.com request_id=606794a4-3f9b-417c-b3ca-72af4d8bafb6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=304ms status=500 bytes=1669
2017-02-24T20:59:14.722589+00:00 app[web.1]: I, [2017-02-24T20:59:14.722491 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Sent mail to samuelslmoreira#hotmail.com (99.8ms)
2017-02-24T20:59:14.722632+00:00 app[web.1]: D, [2017-02-24T20:59:14.722588 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Date: Fri, 24 Feb 2017 20:59:14 +0000
2017-02-24T20:59:14.722632+00:00 app[web.1]: From: jp#example.com
2017-02-24T20:59:14.722633+00:00 app[web.1]: To: samuelslmoreira#hotmail.com
2017-02-24T20:59:14.722633+00:00 app[web.1]: Message-ID: <58b09ea298a14_43fc0c75eb9c0103ae#71798652-2827-4935-9282-6b3ae7c47b44.mail>
2017-02-24T20:59:14.722634+00:00 app[web.1]: Subject: Contact Form Message
2017-02-24T20:59:14.722634+00:00 app[web.1]: Mime-Version: 1.0
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Type: text/html;
2017-02-24T20:59:14.722635+00:00 app[web.1]: charset=UTF-8
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Transfer-Encoding: 7bit
2017-02-24T20:59:14.722636+00:00 app[web.1]:
2017-02-24T20:59:14.722636+00:00 app[web.1]: <!DOCTYPE html>
2017-02-24T20:59:14.722637+00:00 app[web.1]: <html>
2017-02-24T20:59:14.722637+00:00 app[web.1]: <head>
2017-02-24T20:59:14.722637+00:00 app[web.1]: </head>
2017-02-24T20:59:14.722638+00:00 app[web.1]: <body>
2017-02-24T20:59:14.722638+00:00 app[web.1]: <p>
2017-02-24T20:59:14.722638+00:00 app[web.1]: You have received a message from the site's contact form, from Jesse Pinkman, jp#example.com.
2017-02-24T20:59:14.722639+00:00 app[web.1]: </p>
2017-02-24T20:59:14.722639+00:00 app[web.1]: <p>
2017-02-24T20:59:14.722639+00:00 app[web.1]:
2017-02-24T20:59:14.722640+00:00 app[web.1]: </p>
2017-02-24T20:59:14.722640+00:00 app[web.1]: </body>
2017-02-24T20:59:14.722640+00:00 app[web.1]: </html>
2017-02-24T20:59:14.722825+00:00 app[web.1]: I, [2017-02-24T20:59:14.722779 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Completed 500 Internal Server Error in 295ms (ActiveRecord: 4.1ms)
2017-02-24T20:59:14.723286+00:00 app[web.1]: F, [2017-02-24T20:59:14.723242 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6]
2017-02-24T20:59:14.723324+00:00 app[web.1]: F, [2017-02-24T20:59:14.723287 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
2017-02-24T20:59:14.723325+00:00 app[web.1]: ):
2017-02-24T20:59:14.723357+00:00 app[web.1]: F, [2017-02-24T20:59:14.723324 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6]
2017-02-24T20:59:14.723390+00:00 app[web.1]: F, [2017-02-24T20:59:14.723357 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] app/controllers/contacts_controller.rb:15:in `create'
iamsamuel:~/workspace/saasapp (master) $ clear
iamsamuel:~/workspace/saasapp (master) $ clear
iamsamuel:~/workspace/saasapp (master) $ heroku logs
2017-02-24T20:18:19.316723+00:00 app[web.1]: You have received a message from the site's contact form, from Sam, smlmrr#outlook.com.
2017-02-24T20:18:19.316724+00:00 app[web.1]: </p>
2017-02-24T20:18:19.316724+00:00 app[web.1]: <p>
2017-02-24T20:18:19.316725+00:00 app[web.1]:
2017-02-24T20:18:19.316725+00:00 app[web.1]: </p>
2017-02-24T20:18:19.316726+00:00 app[web.1]: </body>
2017-02-24T20:18:19.316726+00:00 app[web.1]: </html>
2017-02-24T20:18:19.316886+00:00 app[web.1]: I, [2017-02-24T20:18:19.316838 #4] INFO -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Completed 500 Internal Server Error in 1166ms (ActiveRecord: 4.1ms)
2017-02-24T20:18:19.317316+00:00 app[web.1]: F, [2017-02-24T20:18:19.317273 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c]
2017-02-24T20:18:19.317357+00:00 app[web.1]: F, [2017-02-24T20:18:19.317318 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
2017-02-24T20:18:19.317358+00:00 app[web.1]: ):
2017-02-24T20:18:19.317396+00:00 app[web.1]: F, [2017-02-24T20:18:19.317355 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c]
2017-02-24T20:18:19.317435+00:00 app[web.1]: F, [2017-02-24T20:18:19.317396 #4] FATAL -- : [f024cbfb-df8b-4efa-8cb1-50a6a0d7881c] app/controllers/contacts_controller.rb:15:in `create'
2017-02-24T20:18:19.520898+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=62153ff0-bef7-4e44-958b-447fb18e7c23 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:53:16.169251+00:00 heroku[web.1]: Idling
2017-02-24T20:53:16.169901+00:00 heroku[web.1]: State changed from up to down
2017-02-24T20:53:17.034264+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-02-24T20:53:17.078764+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2017-02-24T20:53:17.078952+00:00 app[web.1]: === puma shutdown: 2017-02-24 20:53:17 +0000 ===
2017-02-24T20:53:17.078957+00:00 app[web.1]: - Goodbye!
2017-02-24T20:53:17.079100+00:00 app[web.1]: Exiting
2017-02-24T20:53:17.347515+00:00 heroku[web.1]: Process exited with status 0
2017-02-24T20:57:24.680979+00:00 heroku[web.1]: Unidling
2017-02-24T20:57:24.681258+00:00 heroku[web.1]: State changed from down to starting
2017-02-24T20:57:27.221989+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 44473 -e production`
2017-02-24T20:57:30.299354+00:00 app[web.1]: => Booting Puma
2017-02-24T20:57:30.299447+00:00 app[web.1]: => Rails 5.0.0 application starting in production on http://0.0.0.0:44473
2017-02-24T20:57:30.299502+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-02-24T20:57:31.229688+00:00 app[web.1]: Puma starting in single mode...
2017-02-24T20:57:31.229714+00:00 app[web.1]: * Min threads: 5, max threads: 5
2017-02-24T20:57:31.229713+00:00 app[web.1]: * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl
2017-02-24T20:57:31.229716+00:00 app[web.1]: * Environment: production
2017-02-24T20:57:31.229813+00:00 app[web.1]: * Listening on tcp://0.0.0.0:44473
2017-02-24T20:57:31.230029+00:00 app[web.1]: Use Ctrl-C to stop
2017-02-24T20:57:31.421917+00:00 heroku[web.1]: State changed from starting to up
2017-02-24T20:57:32.788592+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=dedd394a-498a-464d-a669-ed19fa2fd418 fwd="188.83.235.112" dyno=web.1 connect=0ms service=58ms status=200 bytes=2753
2017-02-24T20:57:32.737531+00:00 app[web.1]: I, [2017-02-24T20:57:32.737424 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Started GET "/" for 188.83.235.112 at 2017-02-24 20:57:32 +0000
2017-02-24T20:57:32.740219+00:00 app[web.1]: I, [2017-02-24T20:57:32.740152 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Processing by PagesController#home as HTML
2017-02-24T20:57:32.752357+00:00 app[web.1]: I, [2017-02-24T20:57:32.752273 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendering pages/home.html.erb within layouts/application
2017-02-24T20:57:32.753153+00:00 app[web.1]: I, [2017-02-24T20:57:32.753082 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Rendered pages/home.html.erb within layouts/application (0.6ms)
2017-02-24T20:57:32.759595+00:00 app[web.1]: I, [2017-02-24T20:57:32.759524 #4] INFO -- : [dedd394a-498a-464d-a669-ed19fa2fd418] Completed 200 OK in 19ms (Views: 8.6ms | ActiveRecord: 0.0ms)
2017-02-24T20:57:32.929609+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=80d55a95-cbe8-4982-a571-bc8850567a87 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:32.928158+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=a9c456f3-e7cd-4d6a-865f-2c8f5efbdaa7 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:33.143930+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=90d78563-eaa6-4f24-a054-5c89beada59c fwd="188.83.235.112" dyno=web.1 connect=3ms service=1ms status=304 bytes=48
2017-02-24T20:57:33.402193+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=7c20311c-bd5a-46c3-a9d5-c6266c1f9331 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T20:57:50.706814+00:00 heroku[router]: at=info method=GET path="/contact-us" host=infinite-forest-28304.herokuapp.com request_id=0ec752b1-0d75-42dd-83f6-ecd127086bfb fwd="188.83.235.112" dyno=web.1 connect=0ms service=35ms status=200 bytes=4317
2017-02-24T20:57:50.651067+00:00 app[web.1]: I, [2017-02-24T20:57:50.650984 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Started GET "/contact-us" for 188.83.235.112 at 2017-02-24 20:57:50 +0000
2017-02-24T20:57:50.652579+00:00 app[web.1]: I, [2017-02-24T20:57:50.652518 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Processing by ContactsController#new as HTML
2017-02-24T20:57:50.669618+00:00 app[web.1]: I, [2017-02-24T20:57:50.669536 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendering contacts/new.html.erb within layouts/application
2017-02-24T20:57:50.681558+00:00 app[web.1]: I, [2017-02-24T20:57:50.681481 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Rendered contacts/new.html.erb within layouts/application (11.8ms)
2017-02-24T20:57:50.682909+00:00 app[web.1]: I, [2017-02-24T20:57:50.682846 #4] INFO -- : [0ec752b1-0d75-42dd-83f6-ecd127086bfb] Completed 200 OK in 30ms (Views: 14.0ms | ActiveRecord: 7.5ms)
2017-02-24T20:59:14.426470+00:00 app[web.1]: I, [2017-02-24T20:59:14.426395 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Started POST "/contacts" for 188.83.235.112 at 2017-02-24 20:59:14 +0000
2017-02-24T20:59:14.427281+00:00 app[web.1]: I, [2017-02-24T20:59:14.427232 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Processing by ContactsController#create as HTML
2017-02-24T20:59:14.427366+00:00 app[web.1]: I, [2017-02-24T20:59:14.427324 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Parameters: {"utf8"=>"✓", "authenticity_token"=>"MgrtXM/8aUAYPnJ2ph4eIbsqMbLR/xXMZabcKmKh4myMlp0MdLJ2dCHnh7KshXSCqAsIzGQr0SdebpJw1v0QHw==", "contact"=>{"name"=>"Jesse Pinkman", "email"=>"jp#example.com", "comments"=>"Yo Beach!"}, "commit"=>"Submit"}
2017-02-24T20:59:14.429694+00:00 app[web.1]: D, [2017-02-24T20:59:14.429641 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (0.9ms) BEGIN
2017-02-24T20:59:14.434537+00:00 app[web.1]: D, [2017-02-24T20:59:14.434485 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] SQL (1.3ms) INSERT INTO "contacts" ("name", "email", "comments", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Jesse Pinkman"], ["email", "jp#example.com"], ["comments", "Yo Beach!"], ["created_at", 2017-02-24 20:59:14 UTC], ["updated_at", 2017-02-24 20:59:14 UTC]]
2017-02-24T20:59:14.436712+00:00 app[web.1]: D, [2017-02-24T20:59:14.436665 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] (1.9ms) COMMIT
2017-02-24T20:59:14.441776+00:00 app[web.1]: I, [2017-02-24T20:59:14.441724 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendering contact_mailer/contact_email.html.erb
2017-02-24T20:59:14.442284+00:00 app[web.1]: I, [2017-02-24T20:59:14.442237 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Rendered contact_mailer/contact_email.html.erb (0.4ms)
2017-02-24T20:59:14.622612+00:00 app[web.1]: D, [2017-02-24T20:59:14.622518 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] ContactMailer#contact_email: processed outbound mail in 184.5ms
2017-02-24T20:59:14.749027+00:00 heroku[router]: at=info method=POST path="/contacts" host=infinite-forest-28304.herokuapp.com request_id=606794a4-3f9b-417c-b3ca-72af4d8bafb6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=304ms status=500 bytes=1669
2017-02-24T20:59:14.722589+00:00 app[web.1]: I, [2017-02-24T20:59:14.722491 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Sent mail to samuelslmoreira#hotmail.com (99.8ms)
2017-02-24T20:59:14.722632+00:00 app[web.1]: D, [2017-02-24T20:59:14.722588 #4] DEBUG -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Date: Fri, 24 Feb 2017 20:59:14 +0000
2017-02-24T20:59:14.722632+00:00 app[web.1]: From: jp#example.com
2017-02-24T20:59:14.722633+00:00 app[web.1]: To: samuelslmoreira#hotmail.com
2017-02-24T20:59:14.722633+00:00 app[web.1]: Message-ID: <58b09ea298a14_43fc0c75eb9c0103ae#71798652-2827-4935-9282-6b3ae7c47b44.mail>
2017-02-24T20:59:14.722634+00:00 app[web.1]: Subject: Contact Form Message
2017-02-24T20:59:14.722634+00:00 app[web.1]: Mime-Version: 1.0
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Type: text/html;
2017-02-24T20:59:14.722635+00:00 app[web.1]: charset=UTF-8
2017-02-24T20:59:14.722635+00:00 app[web.1]: Content-Transfer-Encoding: 7bit
2017-02-24T20:59:14.722636+00:00 app[web.1]:
2017-02-24T20:59:14.722636+00:00 app[web.1]: <!DOCTYPE html>
2017-02-24T20:59:14.722637+00:00 app[web.1]: <html>
2017-02-24T20:59:14.722637+00:00 app[web.1]: <head>
2017-02-24T20:59:14.722637+00:00 app[web.1]: </head>
2017-02-24T20:59:14.722638+00:00 app[web.1]: <body>
2017-02-24T20:59:14.722638+00:00 app[web.1]: <p>
2017-02-24T20:59:14.722638+00:00 app[web.1]: You have received a message from the site's contact form, from Jesse Pinkman, jp#example.com.
2017-02-24T20:59:14.722639+00:00 app[web.1]: </p>
2017-02-24T20:59:14.722639+00:00 app[web.1]: <p>
2017-02-24T20:59:14.722639+00:00 app[web.1]:
2017-02-24T20:59:14.722640+00:00 app[web.1]: </p>
2017-02-24T20:59:14.722640+00:00 app[web.1]: </body>
2017-02-24T20:59:14.722640+00:00 app[web.1]: </html>
2017-02-24T20:59:14.722825+00:00 app[web.1]: I, [2017-02-24T20:59:14.722779 #4] INFO -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Completed 500 Internal Server Error in 295ms (ActiveRecord: 4.1ms)
2017-02-24T20:59:14.723286+00:00 app[web.1]: F, [2017-02-24T20:59:14.723242 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6]
2017-02-24T20:59:14.723324+00:00 app[web.1]: F, [2017-02-24T20:59:14.723287 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
2017-02-24T20:59:14.723325+00:00 app[web.1]: ):
2017-02-24T20:59:14.723357+00:00 app[web.1]: F, [2017-02-24T20:59:14.723324 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6]
2017-02-24T20:59:14.723390+00:00 app[web.1]: F, [2017-02-24T20:59:14.723357 #4] FATAL -- : [606794a4-3f9b-417c-b3ca-72af4d8bafb6] app/controllers/contacts_controller.rb:15:in `create'
2017-02-24T21:30:27.890702+00:00 heroku[router]: at=info method=GET path="/" host=infinite-forest-28304.herokuapp.com request_id=ef1e2185-e94e-4a90-907e-15dad519fd59 fwd="188.83.235.112" dyno=web.1 connect=1ms service=6ms status=200 bytes=2753
2017-02-24T21:30:27.866291+00:00 app[web.1]: I, [2017-02-24T21:30:27.866202 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Started GET "/" for 188.83.235.112 at 2017-02-24 21:30:27 +0000
2017-02-24T21:30:27.867090+00:00 app[web.1]: I, [2017-02-24T21:30:27.867030 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Processing by PagesController#home as HTML
2017-02-24T21:30:27.868034+00:00 app[web.1]: I, [2017-02-24T21:30:27.867962 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Rendering pages/home.html.erb within layouts/application
2017-02-24T21:30:27.868172+00:00 app[web.1]: I, [2017-02-24T21:30:27.868117 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Rendered pages/home.html.erb within layouts/application (0.0ms)
2017-02-24T21:30:27.869109+00:00 app[web.1]: I, [2017-02-24T21:30:27.869058 #4] INFO -- : [ef1e2185-e94e-4a90-907e-15dad519fd59] Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
2017-02-24T21:30:28.039850+00:00 heroku[router]: at=info method=GET path="/assets/application-5ed627eba0abe94ba4e2c255c2298f55d9bca9b4ea45ded59ba1705edc5385d0.css" host=infinite-forest-28304.herokuapp.com request_id=f9b48384-ae99-4f9e-b035-6624ef9d2ce6 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T21:30:28.051038+00:00 heroku[router]: at=info method=GET path="/assets/application-95163fa38446d1bb6139f870d5fb932af7fa47b347b8951923c32a4565386aa6.js" host=infinite-forest-28304.herokuapp.com request_id=7b1f62bf-5aca-4ac1-b926-5c3219b3ccac fwd="188.83.235.112" dyno=web.1 connect=1ms service=2ms status=304 bytes=48
2017-02-24T21:30:28.279062+00:00 heroku[router]: at=info method=GET path="/assets/font-awesome/fontawesome-webfont-2932abf996373e87fbf2e950876b1962f1b57db954a1643ea68831d9fbb74da4.woff2?v=4.6.2" host=infinite-forest-28304.herokuapp.com request_id=d1522ce1-c16b-4525-aa55-08c6f45713c8 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2017-02-24T21:30:29.186402+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=infinite-forest-28304.herokuapp.com request_id=1cec8754-06b9-4b20-ad32-77976a359e33 fwd="188.83.235.112" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
Read the error message:
Net::SMTPFatalError (554 Please activate your Mailgun account. Check your inbox or log in to your control panel to resend the activation email.
Just activate your account.
Ok. As the logs say and as #GrahamSlick already answered, your mailgun account is not verified. If you claim that the account is verified make sure that the credentials you used in
your config/environment.rb are the correct ones that belong to the verified account and ensure that heroku uses the correct credentials. The logs say that your account is not verified. May be you want to check your settings with mailgun again and see whether they tell you something about having an inactive account. Good luck.
You have to add a domain, verified it then you can send mails from mailgun.
I ran into the exact same issue. I even tried with just CURL to make sure it had nothing to do with rails or heroku. I double checked that my domain was validated.
I ended up opening a support ticket. They got back to me within a few hours and said "now its good to go" and sure enough it works.
So it's either bugs on their end, or they purposefully require manual oversight for some accounts. Not a great first impression, but it's good to see their support responded quickly.

Redirect Loop with Heroku and Rails 4 App

My app runs fine locally, but when I push to Heroku, in Firefox it says "The page isn't redirecting properly" (i.e. a 302 error).
Running heroku logs results in a bunch of requests like 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 I run the "Network" option under Firefox's Developer section, it continuously shows that it is alternating between the domain with and without www. For example:
www.domain.com
domain.com
www.domain.com
domain.com
etc.
I am using a custom domain name but have it set up exactly how my other apps that are working are set up, so I don't think it is a DNS issue as far as how the setup goes. Also, when I visit the "myappname.herokuapp.com" URL, it immediately redirects to heroku.com for some reason. Not sure why. I ran the "Production Check" and it passes the "DNS configuration" section.
I realize that I have not provided a bunch of information here (not sure what else to provide), but any ideas on what I could look into next?
EDIT: Today it is saying this prior to the redirect code posted earlier:
2015-06-03T14:38:14.651296+00:00 heroku[web.2]: State changed from up to down
2015-06-03T14:38:17.135688+00:00 heroku[web.2]: Stopping all processes with 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 to 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` for more startup options
2015-06-03T14:38:17.828045+00:00 app[web.2]: => Ctrl-C to 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 with status 143
EDIT 2: I re-cloned the repository into a different directory and then ran heroku create, git push heroku master, and then heroku run rake db:migrate. I did this to eliminate any possible DNS issues. The log now 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 to the root url "/" and 2 crashes on /favicon.ico. Based on the favicon.ico, I removed any favicons from the root page as a test. Now the app is behaving similarly to the earlier one: It immediately redirects to heroku.com instead of loading the page and the logs says:
2015-06-03T16:00:42.804253+00:00 heroku[web.1]: State changed from crashed to starting
2015-06-03T16:00:48.568268+00:00 heroku[web.1]: Starting process with 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 from starting to up
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 is very simple. There is a welcome_controller:
class WelcomeController < ApplicationController
skip_before_filter :authenticate_user!, only: :index
def index
end
end
and the view is:
<div class="jumbotron">
<h1> Task Clash</h1>
<p>A ridiculously simple and easy-to-use CRM/Time Tracking tool aimed at small businesses!</p>
<p><%= link_to "Create Account", new_account_path, class: "btn btn-primary btn-lg" %></p>
</div>
Any help would be greatly appreciated!
EDIT 3: I added rails_12factor to my Gemfile and now get 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 GET "/" for 173.27.229.45 at 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".* FROM "public"."accounts" WHERE "public"."accounts"."subdomain" = $1 LIMIT 1 [["subdomain", "www"]]
2015-06-03T19:37:48.711577+00:00 app[web.1]: Filter chain halted as :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 by TasksController#index as HTML
2015-06-03T19:37:48.711291+00:00 app[web.1]: Redirected to https://taskclash.com/
Check if there's a production migration pending. Run from the terminal this command:
$ heroku run rake db:migrate
If there are no migrations pending, post more lines of the logs.

Can someone help me understand why data is not being seeded to Heroku?

I really need to deploy data to my heroku app but I don't understand why it's not working. I've read the documentation and I have seeded my database in the seeds.rb file like so:
user = User.create(band_name: "The Rubies", email: "therubies#gmail.com", user_name: "therubies1000", password: "password", password_confirmation: "password")
MusicVideo.create([
{song_title: "Ruby Gems"
venue: "The Gypsy Lounge"
location: "Boston"
description: "First time in Boston"
url_id: "http://vimeo.com/75032263"
name: "hiphop"
user: user},
{song_title: "Ruby Blood Love"
venue: "The Masquerade"
location: "Atlanta"
description: "5th circuit tour at the Masquerade"
url_id: "http://vimeo.com/28020056"
name: "alternative"
user: user},
{song_title: "Ruby vs. Python"
venue: "Launch Academy"
location: "Boston"
description: "A love song about Ruby"
url_id: "http://vimeo.com/67825649"
name: "hiphop"
user: user},
{song_title: "Farewell Launch Academy"
venue: "Los Locos Tavern"
location: "New York City"
description: "My heartfelt farewell balad for Launch Academy"
url_id: "http://vimeo.com/60347451"
name: "country"
user: user},
{song_title: "Solar Molecules"
venue: "Miami Central"
location: "Miami"
description: "Our band's first single"
url_id: "http://vimeo.com/61605196"
name: "pop"
user: user},
{song_title: "Lovely Miss Ruby!"
venue: "2120 nightclub"
location: "Boston"
description: "The song that made us famous"
url_id: "http://vimeo.com/68269314"
name: "pop"
user: user},
{song_title: "Lady Ruby vs. Lady Python"
venue: "Longhorn Bar & Grill"
location: "Austin"
description: "Battle of the bands 2012"
url_id: "http://vimeo.com/71137905"
name: "rock"
user: user},
{song_title: "The Seductress: Rails"
venue: "Igloo Bar"
location: "Denver"
description: "The crowd goes nuts at 2:14"
url_id: "http://vimeo.com/70360517"
name: "hiphop"
user: user}
])
Then I've run the heroku rake db:migrate and then heroku rake db:seed as demonstrated in the rails app project website. I'd try to troubleshoot this but I don't know where to start or how to begin. These commands should work. I could really use some help with this.
----EDIT-----
When I use the two rake commands, I don't receive an error at all. I get this:
➜ musikfish git:(master) ✗ heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.8472
➜ musikfish git:(master) ✗ heroku run rake db:seed
Running `rake db:seed` attached to terminal... up, run.9065
The problem is that when I go to my heroku app, nothing is there.
musikfish git:(master) ✗ heroku logs
2014-04-29T01:27:43.662686+00:00 heroku[run.9065]: Starting process with command `bundle exec rake db:seed`
2014-04-29T01:27:43.446432+00:00 heroku[run.9065]: State changed from starting to up
2014-04-29T01:27:48.599137+00:00 heroku[run.9065]: Process exited with status 0
2014-04-29T01:27:48.615271+00:00 heroku[run.9065]: State changed from up to complete
2014-04-29T01:27:59.356149+00:00 heroku[router]: at=info method=GET path=/ host=musikfish.herokuapp.com request_id=9198db15-ceb6-47d0-bf5c-9c0c8f86ed00 fwd="76.19.195.114" dyno=web.1 connect=13ms service=26ms status=304 bytes=963
2014-04-29T01:27:59.437007+00:00 heroku[router]: at=info method=GET path=/assets/vendor/modernizr-aee7c485b9900b5743cd0108ba6c4203.js host=musikfish.herokuapp.com request_id=8fff456c-414b-44d5-9745-c287e21ae29f fwd="76.19.195.114" dyno=web.1 connect=0ms service=4ms status=304 bytes=133
2014-04-29T01:27:59.447087+00:00 heroku[router]: at=info method=GET path=/assets/application-35b8d7e622749de25608aa28d2dab9bf.css host=musikfish.herokuapp.com request_id=5b704bcd-11c5-445e-a3a4-3b5a9771b162 fwd="76.19.195.114" dyno=web.1 connect=0ms service=6ms status=304 bytes=133
2014-04-29T01:27:59.452743+00:00 heroku[router]: at=info method=GET path=/assets/application-f22c7c9cfd4209f8467d10162777b447.js host=musikfish.herokuapp.com request_id=99c37dd8-c9e7-414d-833c-b2355a0a7d78 fwd="76.19.195.114" dyno=web.1 connect=1ms service=6ms status=304 bytes=133
2014-04-29T01:27:59.339867+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:27:59 +0000
2014-04-29T01:27:59.339876+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:27:59 +0000
2014-04-29T01:27:59.342081+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:27:59.350172+00:00 app[web.1]: Rendered music_videos/index.html.erb within layouts/application (4.2ms)
2014-04-29T01:27:59.350164+00:00 app[web.1]: Rendered music_videos/index.html.erb within layouts/application (4.2ms)
2014-04-29T01:27:59.342088+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:27:59.351185+00:00 app[web.1]: Completed 200 OK in 9ms (Views: 4.4ms | ActiveRecord: 2.3ms)
2014-04-29T01:27:59.351191+00:00 app[web.1]: Completed 200 OK in 9ms (Views: 4.4ms | ActiveRecord: 2.3ms)
2014-04-29T01:27:59.707282+00:00 heroku[router]: at=info method=GET path=/assets/concert-fa42c0b37cf58a39f5c756d58acc0cff.jpg host=musikfish.herokuapp.com request_id=e62134aa-1020-4402-b507-e90f4cb2c2fa fwd="76.19.195.114" dyno=web.1 connect=1ms service=4ms status=304 bytes=133
2014-04-29T01:28:01.827756+00:00 heroku[router]: at=info method=POST path=/users/sign_out host=musikfish.herokuapp.com request_id=ba2049ed-925a-419f-8d8f-703025441667 fwd="76.19.195.114" dyno=web.1 connect=1ms service=31ms status=302 bytes=1008
2014-04-29T01:28:01.933934+00:00 heroku[router]: at=info method=GET path=/ host=musikfish.herokuapp.com request_id=82444cc8-b75c-4f81-a5b7-a0c4dbebae00 fwd="76.19.195.114" dyno=web.1 connect=2ms service=11ms status=302 bytes=1174
2014-04-29T01:28:02.019241+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=musikfish.herokuapp.com request_id=ff98915d-2970-4369-81c4-b3335cf6fb50 fwd="76.19.195.114" dyno=web.1 connect=1ms service=24ms status=200 bytes=5117
2014-04-29T01:28:01.815374+00:00 app[web.1]: Parameters: {"authenticity_token"=>"6U9MH33BoyP3riIQVH9xRUG/jTGHDbDc9haqkb1wm+c="}
2014-04-29T01:28:01.812383+00:00 app[web.1]: Started DELETE "/users/sign_out" for 76.19.195.114 at 2014-04-29 01:28:01 +0000
2014-04-29T01:28:01.812441+00:00 app[web.1]: Started DELETE "/users/sign_out" for 76.19.195.114 at 2014-04-29 01:28:01 +0000
2014-04-29T01:28:01.836620+00:00 app[web.1]: Redirected to http://musikfish.herokuapp.com/
2014-04-29T01:28:01.815244+00:00 app[web.1]: Processing by Devise::SessionsController#destroy as HTML
2014-04-29T01:28:01.815318+00:00 app[web.1]: Processing by Devise::SessionsController#destroy as HTML
2014-04-29T01:28:01.836976+00:00 app[web.1]: Completed 302 Found in 21ms (ActiveRecord: 4.7ms)
2014-04-29T01:28:01.815409+00:00 app[web.1]: Parameters: {"authenticity_token"=>"6U9MH33BoyP3riIQVH9xRUG/jTGHDbDc9haqkb1wm+c="}
2014-04-29T01:28:01.836730+00:00 app[web.1]: Redirected to http://musikfish.herokuapp.com/
2014-04-29T01:28:01.837036+00:00 app[web.1]: Completed 302 Found in 21ms (ActiveRecord: 4.7ms)
2014-04-29T01:28:01.931057+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:28:01 +0000
2014-04-29T01:28:01.931067+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:28:01 +0000
2014-04-29T01:28:01.933233+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:28:01.933240+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:28:01.934294+00:00 app[web.1]: Completed 401 Unauthorized in 1ms
2014-04-29T01:28:01.934300+00:00 app[web.1]: Completed 401 Unauthorized in 1ms
2014-04-29T01:28:02.003346+00:00 app[web.1]: Started GET "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:28:02 +0000
2014-04-29T01:28:02.003359+00:00 app[web.1]: Started GET "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:28:02 +0000
2014-04-29T01:28:02.005391+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:28:02.005397+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:28:02.016010+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (8.1ms)
2014-04-29T01:28:02.016022+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (8.1ms)
2014-04-29T01:28:02.016885+00:00 app[web.1]: Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.0ms)
2014-04-29T01:28:02.016891+00:00 app[web.1]: Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.0ms)
2014-04-29T01:28:02.165810+00:00 heroku[router]: at=info method=GET path=/assets/record-b8785487ad26187346eb4a4f3ca44b8e.jpg host=musikfish.herokuapp.com request_id=761b5080-013c-4308-8073-6ae64ee63fe5 fwd="76.19.195.114" dyno=web.1 connect=1ms service=4ms status=304 bytes=133
2014-04-29T01:28:24.575301+00:00 heroku[router]: at=info method=POST path=/users/sign_in host=musikfish.herokuapp.com request_id=95ef1998-d961-4783-8685-d7d463c04cd8 fwd="76.19.195.114" dyno=web.1 connect=0ms service=134ms status=200 bytes=5158
2014-04-29T01:28:24.444910+00:00 app[web.1]: Started POST "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:28:24 +0000
2014-04-29T01:28:24.450353+00:00 app[web.1]: Processing by Devise::SessionsController#create as HTML
2014-04-29T01:28:24.450395+00:00 app[web.1]: Processing by Devise::SessionsController#create as HTML
2014-04-29T01:28:24.450480+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:28:24.456080+00:00 app[web.1]: Completed 401 Unauthorized in 5ms
2014-04-29T01:28:24.457165+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:28:24.457172+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:28:24.457213+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:28:24.450529+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:28:24.456071+00:00 app[web.1]: Completed 401 Unauthorized in 5ms
2014-04-29T01:28:24.457231+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:28:24.570577+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (9.5ms)
2014-04-29T01:28:24.570588+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (9.5ms)
2014-04-29T01:28:24.571495+00:00 app[web.1]: Completed 200 OK in 114ms (Views: 11.0ms | ActiveRecord: 0.0ms)
2014-04-29T01:28:24.571501+00:00 app[web.1]: Completed 200 OK in 114ms (Views: 11.0ms | ActiveRecord: 0.0ms)
2014-04-29T01:28:24.444975+00:00 app[web.1]: Started POST "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:28:24 +0000
2014-04-29T01:28:24.685158+00:00 heroku[router]: at=info method=GET path=/assets/application-f22c7c9cfd4209f8467d10162777b447.js host=musikfish.herokuapp.com request_id=88423114-72bc-49e8-bb7d-cf5b19fc1908 fwd="76.19.195.114" dyno=web.1 connect=2ms service=6ms status=304 bytes=133
2014-04-29T01:28:24.868171+00:00 heroku[router]: at=info method=GET path=/assets/vendor/modernizr-aee7c485b9900b5743cd0108ba6c4203.js host=musikfish.herokuapp.com request_id=5724d3e6-9603-4b84-84fb-3ba5c696c74f fwd="76.19.195.114" dyno=web.1 connect=118ms service=41ms status=304 bytes=133
2014-04-29T01:31:54.118937+00:00 heroku[router]: at=info method=POST path=/users/sign_in host=musikfish.herokuapp.com request_id=a92e7853-43a3-48b5-9f42-6e55beaf1be2 fwd="76.19.195.114" dyno=web.1 connect=5ms service=173ms status=200 bytes=5158
2014-04-29T01:31:53.955209+00:00 app[web.1]: Started POST "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:31:53 +0000
2014-04-29T01:31:53.957652+00:00 app[web.1]: Processing by Devise::SessionsController#create as HTML
2014-04-29T01:31:53.957659+00:00 app[web.1]: Processing by Devise::SessionsController#create as HTML
2014-04-29T01:31:53.957698+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:31:53.957720+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:31:53.968990+00:00 app[web.1]: Completed 401 Unauthorized in 11ms
2014-04-29T01:31:53.969002+00:00 app[web.1]: Completed 401 Unauthorized in 11ms
2014-04-29T01:31:53.971927+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:31:53.955199+00:00 app[web.1]: Started POST "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:31:53 +0000
2014-04-29T01:31:53.971933+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:31:53.971976+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:31:53.971991+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oU2ObllOpGkDy+clk2mfnxi9y/oY/JpEWJAGVVEmNA=", "user"=>{"user_name"=>"therubies1000", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign In!"}
2014-04-29T01:31:54.117705+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (5.9ms)
2014-04-29T01:31:54.117717+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (5.9ms)
2014-04-29T01:31:54.118464+00:00 app[web.1]: Completed 200 OK in 146ms (Views: 7.2ms | ActiveRecord: 0.0ms)
2014-04-29T01:31:54.118470+00:00 app[web.1]: Completed 200 OK in 146ms (Views: 7.2ms | ActiveRecord: 0.0ms)
2014-04-29T01:31:54.237788+00:00 heroku[router]: at=info method=GET path=/assets/application-35b8d7e622749de25608aa28d2dab9bf.css host=musikfish.herokuapp.com request_id=77e5536c-f9af-4285-a236-a011c1355b81 fwd="76.19.195.114" dyno=web.1 connect=4ms service=9ms status=304 bytes=133
2014-04-29T01:31:54.243275+00:00 heroku[router]: at=info method=GET path=/assets/application-f22c7c9cfd4209f8467d10162777b447.js host=musikfish.herokuapp.com request_id=8ca4ebaf-739d-4e4a-901b-e616e2b7033b fwd="76.19.195.114" dyno=web.1 connect=6ms service=11ms status=304 bytes=133
2014-04-29T01:31:54.264123+00:00 heroku[router]: at=info method=GET path=/assets/vendor/modernizr-aee7c485b9900b5743cd0108ba6c4203.js host=musikfish.herokuapp.com request_id=f2a2d4e9-4163-425d-b26b-5255a6a1f5fe fwd="76.19.195.114" dyno=web.1 connect=6ms service=9ms status=304 bytes=133
2014-04-29T01:31:54.772855+00:00 heroku[router]: at=info method=GET path=/assets/record-b8785487ad26187346eb4a4f3ca44b8e.jpg host=musikfish.herokuapp.com request_id=d103b167-2ed5-4667-874f-679e3d07b859 fwd="76.19.195.114" dyno=web.1 connect=2ms service=5ms status=304 bytes=133
2014-04-29T01:32:03.174817+00:00 heroku[router]: at=info method=GET path=/ host=musikfish.herokuapp.com request_id=cd1eb130-8cf7-453a-982f-b7a74ccafe3e fwd="76.19.195.114" dyno=web.1 connect=11ms service=16ms status=302 bytes=1226
2014-04-29T01:32:03.158631+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:32:03.158689+00:00 app[web.1]: Processing by MusicVideosController#index as HTML
2014-04-29T01:32:03.159895+00:00 app[web.1]: Completed 401 Unauthorized in 1ms
2014-04-29T01:32:03.159937+00:00 app[web.1]: Completed 401 Unauthorized in 1ms
2014-04-29T01:32:03.156335+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:32:03 +0000
2014-04-29T01:32:03.156448+00:00 app[web.1]: Started GET "/" for 76.19.195.114 at 2014-04-29 01:32:03 +0000
2014-04-29T01:32:03.570966+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=musikfish.herokuapp.com request_id=0bcfa714-0019-4860-aa40-c18140690458 fwd="76.19.195.114" dyno=web.1 connect=121ms service=165ms status=200 bytes=5117
2014-04-29T01:32:03.511737+00:00 app[web.1]: Started GET "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:32:03 +0000
2014-04-29T01:32:03.511725+00:00 app[web.1]: Started GET "/users/sign_in" for 76.19.195.114 at 2014-04-29 01:32:03 +0000
2014-04-29T01:32:03.514596+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:32:03.527802+00:00 app[web.1]: Completed 200 OK in 13ms (Views: 10.8ms | ActiveRecord: 0.0ms)
2014-04-29T01:32:03.527809+00:00 app[web.1]: Completed 200 OK in 13ms (Views: 10.8ms | ActiveRecord: 0.0ms)
2014-04-29T01:32:03.514590+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2014-04-29T01:32:03.527020+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (9.6ms)
2014-04-29T01:32:03.527010+00:00 app[web.1]: Rendered devise/sessions/new.html.erb within layouts/application (9.6ms)
Have you successfully seeded a database locally?
You can also try putting puts lines in your seed file to ensure that the code is being run. (IE, after MusicVideo.create, say puts "Music Videos created!", which will be written to your console when running rake db:seed)
My hunch is that your models are failing validation; perhaps try using create! instead of create to see if an error is thrown.

Rails 4 on Heroku with 'protected_attributes' gem

I don't know where else to turn with this: I have spent many hours on my project, a recruiting events website for college students, but have reached quite the impasse.
In short, I plodded along in localhost - adding components like Devise; Omniauth authentication via providers Facebook, LinkedIn, and Google - building a website I was proud of along the way. Everything appeared to be working just fine, but once I pushed to 'heroku master' things started breaking big time.
I think the issues are most likely in or around:I have an Authentication model to keep track of a single user's authentication providers, alongside the User model (where all the oauth code is kept).
Without further ado, here is my app's heroku domain and my code:
http://lit-everglades-7633.herokuapp.com/
https://gist.github.com/mecampbellsoup/6357855
The things breaking which I suspect are related:
'heroku run rake db:seed' following 'pg:reset' & 'rake db:migrate'... instead of seeding with the contents of the seed file itself, a single blank Event and Company are created; more on this below
the routing and action relating to the omniauth request seems to be working just fine, according to the heroku logs (below) but no user nor authentication is actually created:
when, after resetting postgres db, I try to run 'heroku run rake db:create' or 'db:setup' I am whined at as follows:
☁ duke_recruits [master] heroku run rake db:setup
Running rake db:setup attached to terminal... up, run.5886
FATAL: permission denied for database "postgres"
DETAIL: User does not have CONNECT privilege.
also, 'heroku run rake db:seed' appears to be doing its thing, but then my db only has 1 empty Event and 1 empty Company:
☁ duke_recruits [master] heroku run rake db:seed
Running rake db:seed attached to terminal... up, run.1767
☁ duke_recruits [master] heroku run rails c
Running rails c attached to terminal... up, run.6135
Event.allLoading production environment (Rails 4.0.0)
irb(main):001:0> Event.all
=> #ActiveRecord::Relation [#Event id: 1, title: nil, location: nil, description: nil, date: nil, end_date: nil, company_id: nil, created_at: "2013-08-27 19:30:06", updated_at: "2013-08-27 19:30:06"]
irb(main):002:0> Company.all
=> #ActiveRecord::Relation [#Company id: 1, name: nil, description: nil, website: nil, logo: nil, created_at: "2013-08-27 19:30:06", updated_at: "2013-08-27 19:30:06"]
Logs (upon opening the app on heroku and trying google authentication):
2013-08-27T19:49:18.701285+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:49:18 +0000
2013-08-27T19:49:18.701019+00:00 app[web.1]: => Rails 4.0.0 application starting in production on http://0.0.0.0:49710
2013-08-27T19:49:18.701019+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-08-27T19:49:18.701019+00:00 app[web.1]: => Booting WEBrick
2013-08-27T19:49:18.701019+00:00 app[web.1]: => Run `rails server -h` for more startup options
2013-08-27T19:49:18.701019+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:49:18 +0000
2013-08-27T19:49:19.131115+00:00 heroku[router]: at=info method=GET path=/ host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=2ms service=442ms status=304 bytes=0
2013-08-27T19:49:19.221284+00:00 heroku[router]: at=info method=GET path=/assets/application-b44a43097f814ac98347f6802323e25f.js host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=1ms service=12ms status=304 bytes=0
2013-08-27T19:49:49.440894+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:49:49 +0000
2013-08-27T19:49:49.440894+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:49:49 +0000
2013-08-27T19:49:49.515520+00:00 heroku[router]: at=info method=GET path=/ host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=2ms service=80ms status=304 bytes=0
2013-08-27T19:50:48.534099+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:50:48 +0000
2013-08-27T19:50:48.534099+00:00 app[web.1]: Started GET "/" for 68.175.76.48 at 2013-08-27 19:50:48 +0000
2013-08-27T19:50:48.575279+00:00 heroku[router]: at=info method=GET path=/ host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=1ms service=51ms status=304 bytes=0
2013-08-27T19:50:52.293922+00:00 app[web.1]: Started GET "/users/sign_up" for 68.175.76.48 at 2013-08-27 19:50:52 +0000
2013-08-27T19:50:52.293922+00:00 app[web.1]: Started GET "/users/sign_up" for 68.175.76.48 at 2013-08-27 19:50:52 +0000
2013-08-27T19:50:52.591752+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=1ms service=307ms status=304 bytes=0
2013-08-27T19:51:00.368352+00:00 app[web.1]: Started GET "/users/auth/google_oauth2" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.368352+00:00 app[web.1]: Started GET "/users/auth/google_oauth2" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.368926+00:00 app[web.1]: I, [2013-08-27T19:51:00.368823 #2] INFO -- omniauth: (google_oauth2) Request phase initiated.
2013-08-27T19:51:00.392262+00:00 heroku[router]: at=info method=GET path=/users/auth/google_oauth2 host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=3ms service=33ms status=302 bytes=469
2013-08-27T19:51:00.715597+00:00 app[web.1]: Started GET "/users/auth/google_oauth2" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.715597+00:00 app[web.1]: Started GET "/users/auth/google_oauth2" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.716822+00:00 app[web.1]: I, [2013-08-27T19:51:00.716706 #2] INFO -- omniauth: (google_oauth2) Request phase initiated.
2013-08-27T19:51:00.997866+00:00 app[web.1]: Started GET "/users/auth/google_oauth2/callback?state=40ecfd10739cb874b5c461fc00cfd72ec4fcb694ef3a6878&code=4/D_(omitted_for_security)_GBlmiYhY(partially_omitted)E9yth.QpxI3jdcGpYYshQV0ieZDAoQOqyCgQI" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.997866+00:00 app[web.1]: Started GET "/users/auth/google_oauth2/callback?state=10739cb874b5c461fc00cfd72ec4fcb694ef3a6878&code=4/D_GBlmiYhY1rCvgdgE9yth.QpxI3jdcGpYYshQV0ieZDAoQOqyCgQI" for 68.175.76.48 at 2013-08-27 19:51:00 +0000
2013-08-27T19:51:00.998508+00:00 app[web.1]: I, [2013-08-27T19:51:00.998379 #2] INFO -- omniauth: (google_oauth2) Callback phase initiated.
2013-08-27T19:51:02.188467+00:00 app[web.1]: Started GET "/users/sign_up" for 68.175.76.48 at 2013-08-27 19:51:02 +0000
2013-08-27T19:51:02.188467+00:00 app[web.1]: Started GET "/users/sign_up" for 68.175.76.48 at 2013-08-27 19:51:02 +0000
2013-08-27T19:51:02.234644+00:00 heroku[router]: at=info method=GET path=/users/sign_up host=lit-everglades-7633.herokuapp.com fwd="68.175.76.48" dyno=web.1 connect=9ms service=52ms status=304 bytes=0
Please let me know what questions you have for me and if I can clarify anything at all. I really appreciate your time & help SO!
After a pg:reset, you can run the create command, but it usually gives you output like:
slkdjfs0dslkd already exists
So then you'll know that your database is created and ready to be used. Before you can seed though make sure you migrate. Just the standard heroku way
heroku run rake db:migrate
Then seed as normal
heroku run rake db:seed

Resources