I try to deploy my rails app to heroku. I get issue in logs.
2019-09-05T21:30:24.764421+00:00 app[web.1]: D, [2019-09-05T21:30:24.764290 #10] DEBUG -- : [3adcd749-6637-4790-8b0d-dab833c46c47] [1m[36mUser Create (16.1ms)[0m [1m[32mINSERT INTO "users" ("name", "email", "note", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["name", ""], ["email", ""], ["note", ""], ["created_at", "2019-09-05 21:30:24.745537"], ["updated_at", "2019-09-05 21:30:24.745537"]]
2019-09-05T21:30:24.766999+00:00 app[web.1]: D, [2019-09-05T21:30:24.766917 #10] DEBUG -- : [3adcd749-6637-4790-8b0d-dab833c46c47] [1m[35m (2.0ms)[0m [1m[35mCOMMIT[0m
2019-09-05T21:30:24.771504+00:00 app[web.1]: I, [2019-09-05T21:30:24.771419 #10] INFO -- : [3adcd749-6637-4790-8b0d-dab833c46c47] Completed 500 Internal Server Error in 161ms (ActiveRecord: 47.8ms)
2019-09-05T21:30:24.772177+00:00 app[web.1]: F, [2019-09-05T21:30:24.772096 #10] FATAL -- : [3adcd749-6637-4790-8b0d-dab833c46c47]
2019-09-05T21:30:24.772242+00:00 app[web.1]: F, [2019-09-05T21:30:24.772179 #10] FATAL -- : [3adcd749-6637-4790-8b0d-dab833c46c47] Redis::CannotConnectError (Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)):
2019-09-05T21:30:24.772293+00:00 app[web.1]: F, [2019-09-05T21:30:24.772241 #10] FATAL -- : [3adcd749-6637-4790-8b0d-dab833c46c47]
2019-09-05T21:30:24.772375+00:00 app[web.1]: F, [2019-09-05T21:30:24.772316 #10] FATAL -- : [3adcd749-6637-4790-8b0d-dab833c46c47] app/controllers/users_controller.rb:25:in block in create'
2019-09-05T21:30:24.772377+00:00 app[web.1]: [3adcd749-6637-4790-8b0d-dab833c46c47] app/controllers/users_controller.rb:23:increate'
2019-09-05T21:30:24.727793+00:00 heroku[router]: at=info method=POST path="/users" host=mailme-reminder.herokuapp.com request_id=3adcd749-6637-4790-8b0d-dab833c46c47 fwd="189.159.252.164" dyno=web.1 connect=1ms service=178ms status=500 bytes=1827 protocol=https
2019-09-05T21:30:24.913280+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=mailme-reminder.herokuapp.com request_id=df1321b0-44d2-46ef-9015-45a7f2fc8c38 fwd="189.159.252.164" dyno=web.1 connect=1ms service=4ms status=304 bytes=48 protocol=https
2019-09-05T21:31:09.129802+00:00 app[web.1]: I, [2019-09-05T21:31:09.129668 #10] INFO -- : [17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643] Started GET "/" for 189.159.252.164 at 2019-09-05 21:31:09 +0000
2019-09-05T21:31:09.131458+00:00 app[web.1]: I, [2019-09-05T21:31:09.131337 #10] INFO -- : [17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643] Processing by UsersController#new as HTML
2019-09-05T21:31:09.138108+00:00 app[web.1]: I, [2019-09-05T21:31:09.138004 #10] INFO -- : [17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643] Rendering users/new.html.erb within layouts/application
2019-09-05T21:31:09.142089+00:00 app[web.1]: I, [2019-09-05T21:31:09.142006 #10] INFO -- : [17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643] Rendered users/new.html.erb within layouts/application (3.8ms)
2019-09-05T21:31:09.144723+00:00 app[web.1]: I, [2019-09-05T21:31:09.144626 #10] INFO -- : [17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643] Completed 200 OK in 13ms (Views: 9.4ms | ActiveRecord: 0.0ms)
2019-09-05T21:31:09.101818+00:00 heroku[router]: at=info method=GET path="/" host=mailme-reminder.herokuapp.com request_id=17ce6b70-1cd1-4b7e-b7b8-2a8b79f09643 fwd="189.159.252.164" dyno=web.1 connect=1ms service=19ms status=200 bytes=5496 protocol=https
2019-09-05T21:31:26.058494+00:00 heroku[router]: at=info method=POST path="/users" host=mailme-reminder.herokuapp.com request_id=63bbddba-107e-47b5-a0ee-ca8da83a6b0e fwd="189.159.252.164" dyno=web.1 connect=1ms service=26ms status=500 bytes=1827 protocol=https
2019-09-05T21:31:26.085304+00:00 app[web.1]: I, [2019-09-05T21:31:26.085200 #14] INFO -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] Started POST "/users" for 189.159.252.164 at 2019-09-05 21:31:26 +0000
2019-09-05T21:31:26.086465+00:00 app[web.1]: I, [2019-09-05T21:31:26.086388 #14] INFO -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] Processing by UsersController#create as HTML
2019-09-05T21:31:26.086570+00:00 app[web.1]: I, [2019-09-05T21:31:26.086505 #14] INFO -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] Parameters: {"utf8"=>"✓", "authenticity_token"=>"DNicK64JMa2ApcaSeYrP84zdeZe7hDYc2HZktB0ObXp4IVmCobV4KJQnZ9UazBiROfn6sE/jsCredCh6HzMgwg==", "user"=>{"name"=>"Michael", "email"=>"example_email#example.com", "date_and_time"=>"2019/09/05 17:00", "note"=>"Check"}, "commit"=>"Remind Me"}
2019-09-05T21:31:26.092268+00:00 app[web.1]: D, [2019-09-05T21:31:26.092172 #14] DEBUG -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] [1m[35m (1.0ms)[0m [1m[35mBEGIN[0m
2019-09-05T21:31:26.096930+00:00 app[web.1]: D, [2019-09-05T21:31:26.096826 #14] DEBUG -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] [1m[36mUser Create (1.8ms)[0m [1m[32mINSERT INTO "users" ("name", "email", "note", "date_and_time", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["name", "Michael"], ["email", "example_email#example.com"], ["note", "Check"], ["date_and_time", "2019-09-05 22:00:00"], ["created_at", "2019-09-05 21:31:26.092480"], ["updated_at", "2019-09-05 21:31:26.092480"]]
2019-09-05T21:31:26.099330+00:00 app[web.1]: D, [2019-09-05T21:31:26.099250 #14] DEBUG -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] [1m[35m (2.0ms)[0m [1m[35mCOMMIT[0m
2019-09-05T21:31:26.102570+00:00 app[web.1]: I, [2019-09-05T21:31:26.102493 #14] INFO -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] Completed 500 Internal Server Error in 16ms (ActiveRecord: 4.8ms)
2019-09-05T21:31:26.103205+00:00 app[web.1]: F, [2019-09-05T21:31:26.103127 #14] FATAL -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e]
2019-09-05T21:31:26.103267+00:00 app[web.1]: F, [2019-09-05T21:31:26.103206 #14] FATAL -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] Redis::CannotConnectError (Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)):
2019-09-05T21:31:26.103318+00:00 app[web.1]: F, [2019-09-05T21:31:26.103263 #14] FATAL -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e]
2019-09-05T21:31:26.103376+00:00 app[web.1]: F, [2019-09-05T21:31:26.103323 #14] FATAL -- : [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] app/controllers/users_controller.rb:25:in block in create'
2019-09-05T21:31:26.103377+00:00 app[web.1]: [63bbddba-107e-47b5-a0ee-ca8da83a6b0e] app/controllers/users_controller.rb:23:increate'
Heroku doesn't support your case, you must use s3 as they mentioned in their doc https://devcenter.heroku.com/articles/active-storage-on-heroku here, else you will end up missing image after the instance restarted or after you deploy new version.
The files will go away when the app is deployed, or when it is automatically restarted (once every 24 hours)
There's no other better option, you can either:
Keep using heroku for the server and s3 for file storage (No charge for free tier, just keep a reminder to shut it down sometimes later)
Move all to AWS, so you don't have to use 2 providers.
If you are not actually using Active Storage, look in Config > Environments > production.rb and you should find the following lines;
# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local
Just comment out config.active_storage.service = :local to make it look like this:
# Store uploaded files on the local file system (see config/storage.yml for options)
# config.active_storage.service = :local
Or, remove both lines entirely.
Then, it should work fine on Heroku.
Related
I built an e-commerce app using Rails 5, postgres and heroku, with a classic shopping Cart using the session object to store the cart_id. Thanks to a warning from heroku, I discovered that the numbers of Carts in my database was increasing in a very weird way. It can be more than 50 per minute; and it's not due to many customers visiting the site, which is quite small for the moment. At other moments, the numbers of rows of the Carts table is stable.
Here is my application controller:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
around_action :switch_locale
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :current_cart
after_action :store_action
def switch_locale(&action)
locale = params[:locale] || I18n.default_locale
I18n.with_locale(locale, &action)
end
def default_url_options
{ locale: I18n.locale == I18n.default_locale ? nil : I18n.locale }
end
def current_cart
if session[:cart_id]
cart = Cart.find_by_id(session[:cart_id])
if cart == nil
session[:cart_id] = nil
end
if cart.present?
#current_cart = cart
else
session[:cart_id] = nil
end
end
if session[:cart_id] == nil
#current_cart = Cart.create
session[:cart_id] = #current_cart.id
end
end
def store_action
return unless request.get?
if (request.path != "/users/sign_in" &&
request.path != "/users/sign_up" &&
request.path != "/users/password/new" &&
request.path != "/users/password/edit" &&
request.path != "/users/confirmation" &&
request.path != "/users/sign_out" &&
!request.xhr?) # don't store ajax calls
store_location_for(:user, request.fullpath)
end
end
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
end
end
cart.rb
class Cart < ApplicationRecord
has_many :order_items, dependent: :destroy
has_many :products, through: :order_items
monetize :amount_cents_cents
end
and the Orders controller:
class OrdersController < ApplicationController
before_action :authenticate_user!
def create
#order = Order.new
total = []
#current_cart.order_items.each do |item|
total << item.product.price_cents * item.quantity.to_i
end
#order.amount_cents_cents = total.sum
if #order.amount_cents_cents == 0
Cart.destroy(session[:cart_id])
session[:cart_id] = nil
redirect_to root_path
else
#current_cart.order_items.each do |item|
#order.order_items << item
item.cart_id = nil
end
#user = current_user
#order.user_id = #user.id
#order.save
Cart.destroy(session[:cart_id])
session[:cart_id] = nil
redirect_to order_path(#order)
end
Here are Heroku logs from yesterday :
2021-03-09T16:25:31.994631+00:00 app[web.1]: D, [2021-03-09T16:25:31.994568 #4] DEBUG -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Cart Create (1.1ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:25:31.993019"], ["updated_at", "2021-03-09 16:25:31.993019"]]
2021-03-09T16:25:31.996727+00:00 app[web.1]: D, [2021-03-09T16:25:31.996649 #4] DEBUG -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] (1.8ms) COMMIT
2021-03-09T16:25:31.998717+00:00 app[web.1]: D, [2021-03-09T16:25:31.998636 #4] DEBUG -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102580]]
2021-03-09T16:25:31.999401+00:00 app[web.1]: I, [2021-03-09T16:25:31.999343 #4] INFO -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:25:32.000698+00:00 app[web.1]: I, [2021-03-09T16:25:32.000634 #4] INFO -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Rendered carts/show.html.erb within layouts/application (1.2ms)
2021-03-09T16:25:32.003572+00:00 app[web.1]: I, [2021-03-09T16:25:32.003492 #4] INFO -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Rendered shared/_navbar.html.erb (2.0ms)
2021-03-09T16:25:32.003861+00:00 app[web.1]: I, [2021-03-09T16:25:32.003787 #4] INFO -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:25:32.004305+00:00 app[web.1]: I, [2021-03-09T16:25:32.004209 #4] INFO -- : [bc4f12a5-b503-435a-bd45-eac3c3adc006] Completed 200 OK in 14ms (Views: 5.0ms | ActiveRecord: 5.0ms)
2021-03-09T16:25:32.006089+00:00 heroku[router]: at=info method=GET path="/en/carts/100155" host=www.bravacoffeeroasters.com request_id=bc4f12a5-b503-435a-bd45-eac3c3adc006 fwd="5.9.108.254" dyno=web.1 connect=0ms service=20ms status=200 bytes=8003 protocol=https
2021-03-09T16:25:39.827045+00:00 app[web.1]: I, [2021-03-09T16:25:39.826944 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Started GET "/en/carts/100158" for 5.9.108.254 at 2021-03-09 16:25:39 +0000
2021-03-09T16:25:39.828020+00:00 app[web.1]: I, [2021-03-09T16:25:39.827942 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Processing by CartsController#show as HTML
2021-03-09T16:25:39.828070+00:00 app[web.1]: I, [2021-03-09T16:25:39.828014 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Parameters: {"locale"=>"en", "id"=>"100158"}
2021-03-09T16:25:39.831671+00:00 app[web.1]: D, [2021-03-09T16:25:39.831585 #4] DEBUG -- : [794133c6-3a8d-4952-b38b-148dd1c78941] (1.2ms) BEGIN
2021-03-09T16:25:39.834022+00:00 app[web.1]: D, [2021-03-09T16:25:39.833931 #4] DEBUG -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Cart Create (1.3ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:25:39.832057"], ["updated_at", "2021-03-09 16:25:39.832057"]]
2021-03-09T16:25:39.836952+00:00 app[web.1]: D, [2021-03-09T16:25:39.836843 #4] DEBUG -- : [794133c6-3a8d-4952-b38b-148dd1c78941] (2.6ms) COMMIT
2021-03-09T16:25:39.838769+00:00 app[web.1]: D, [2021-03-09T16:25:39.838664 #4] DEBUG -- : [794133c6-3a8d-4952-b38b-148dd1c78941] OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102581]]
2021-03-09T16:25:39.839411+00:00 app[web.1]: I, [2021-03-09T16:25:39.839342 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:25:39.840887+00:00 app[web.1]: I, [2021-03-09T16:25:39.840812 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Rendered carts/show.html.erb within layouts/application (1.4ms)
2021-03-09T16:25:39.843830+00:00 app[web.1]: I, [2021-03-09T16:25:39.843767 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Rendered shared/_navbar.html.erb (2.0ms)
2021-03-09T16:25:39.844041+00:00 app[web.1]: I, [2021-03-09T16:25:39.843979 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:25:39.844419+00:00 app[web.1]: I, [2021-03-09T16:25:39.844315 #4] INFO -- : [794133c6-3a8d-4952-b38b-148dd1c78941] Completed 200 OK in 16ms (Views: 5.1ms | ActiveRecord: 6.2ms)
2021-03-09T16:25:39.846119+00:00 heroku[router]: at=info method=GET path="/en/carts/100158" host=www.bravacoffeeroasters.com request_id=794133c6-3a8d-4952-b38b-148dd1c78941 fwd="5.9.108.254" dyno=web.1 connect=0ms service=21ms status=200 bytes=8007 protocol=https
2021-03-09T16:25:44.393247+00:00 app[web.1]: I, [2021-03-09T16:25:44.393143 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Started GET "/en/carts/100162" for 5.9.108.254 at 2021-03-09 16:25:44 +0000
2021-03-09T16:25:44.394349+00:00 app[web.1]: I, [2021-03-09T16:25:44.394257 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Processing by CartsController#show as HTML
2021-03-09T16:25:44.394397+00:00 app[web.1]: I, [2021-03-09T16:25:44.394331 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Parameters: {"locale"=>"en", "id"=>"100162"}
2021-03-09T16:25:44.402068+00:00 app[web.1]: D, [2021-03-09T16:25:44.401988 #4] DEBUG -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] (1.0ms) BEGIN
2021-03-09T16:25:44.404434+00:00 app[web.1]: D, [2021-03-09T16:25:44.404308 #4] DEBUG -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Cart Create (1.2ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:25:44.402575"], ["updated_at", "2021-03-09 16:25:44.402575"]]
2021-03-09T16:25:44.406742+00:00 app[web.1]: D, [2021-03-09T16:25:44.406662 #4] DEBUG -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] (1.9ms) COMMIT
2021-03-09T16:25:44.408565+00:00 app[web.1]: D, [2021-03-09T16:25:44.408479 #4] DEBUG -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] OrderItem Load (1.0ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102582]]
2021-03-09T16:25:44.409183+00:00 app[web.1]: I, [2021-03-09T16:25:44.409106 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:25:44.410524+00:00 app[web.1]: I, [2021-03-09T16:25:44.410452 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Rendered carts/show.html.erb within layouts/application (1.2ms)
2021-03-09T16:25:44.413558+00:00 app[web.1]: I, [2021-03-09T16:25:44.413470 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Rendered shared/_navbar.html.erb (2.0ms)
2021-03-09T16:25:44.413840+00:00 app[web.1]: I, [2021-03-09T16:25:44.413772 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:25:44.414160+00:00 app[web.1]: I, [2021-03-09T16:25:44.414098 #4] INFO -- : [55da48a9-0088-4a3d-984a-f58f8a81245a] Completed 200 OK in 20ms (Views: 5.1ms | ActiveRecord: 5.2ms)
2021-03-09T16:25:44.416182+00:00 heroku[router]: at=info method=GET path="/en/carts/100162" host=www.bravacoffeeroasters.com request_id=55da48a9-0088-4a3d-984a-f58f8a81245a fwd="5.9.108.254" dyno=web.1 connect=0ms service=25ms status=200 bytes=8001 protocol=https
2021-03-09T16:25:49.749861+00:00 app[web.1]: I, [2021-03-09T16:25:49.749718 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Started GET "/en/carts/100167" for 5.9.108.254 at 2021-03-09 16:25:49 +0000
2021-03-09T16:25:49.751269+00:00 app[web.1]: I, [2021-03-09T16:25:49.751173 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Processing by CartsController#show as HTML
2021-03-09T16:25:49.751359+00:00 app[web.1]: I, [2021-03-09T16:25:49.751277 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Parameters: {"locale"=>"en", "id"=>"100167"}
2021-03-09T16:25:49.754570+00:00 app[web.1]: D, [2021-03-09T16:25:49.754464 #4] DEBUG -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] (1.1ms) BEGIN
2021-03-09T16:25:49.757801+00:00 app[web.1]: D, [2021-03-09T16:25:49.757693 #4] DEBUG -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Cart Create (1.2ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:25:49.755581"], ["updated_at", "2021-03-09 16:25:49.755581"]]
2021-03-09T16:25:49.760623+00:00 app[web.1]: D, [2021-03-09T16:25:49.760418 #4] DEBUG -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] (2.2ms) COMMIT
2021-03-09T16:25:49.762818+00:00 app[web.1]: D, [2021-03-09T16:25:49.762617 #4] DEBUG -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102583]]
2021-03-09T16:25:49.764416+00:00 app[web.1]: I, [2021-03-09T16:25:49.764303 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:25:49.766505+00:00 app[web.1]: I, [2021-03-09T16:25:49.766423 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Rendered carts/show.html.erb within layouts/application (1.9ms)
2021-03-09T16:25:49.771851+00:00 app[web.1]: I, [2021-03-09T16:25:49.771765 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Rendered shared/_navbar.html.erb (3.8ms)
2021-03-09T16:25:49.772151+00:00 app[web.1]: I, [2021-03-09T16:25:49.772072 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:25:49.772669+00:00 app[web.1]: I, [2021-03-09T16:25:49.772589 #4] INFO -- : [c9f138de-a820-4b0b-b87e-ad2f99f6c9f5] Completed 200 OK in 21ms (Views: 8.7ms | ActiveRecord: 5.7ms)
2021-03-09T16:25:49.775098+00:00 heroku[router]: at=info method=GET path="/en/carts/100167" host=www.bravacoffeeroasters.com request_id=c9f138de-a820-4b0b-b87e-ad2f99f6c9f5 fwd="5.9.108.254" dyno=web.1 connect=0ms service=28ms status=200 bytes=8005 protocol=https
2021-03-09T16:25:55.885797+00:00 app[web.1]: I, [2021-03-09T16:25:55.885705 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Started GET "/en/carts/100171" for 5.9.108.254 at 2021-03-09 16:25:55 +0000
2021-03-09T16:25:55.886791+00:00 app[web.1]: I, [2021-03-09T16:25:55.886726 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Processing by CartsController#show as HTML
2021-03-09T16:25:55.886851+00:00 app[web.1]: I, [2021-03-09T16:25:55.886800 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Parameters: {"locale"=>"en", "id"=>"100171"}
2021-03-09T16:25:55.889588+00:00 app[web.1]: D, [2021-03-09T16:25:55.889521 #4] DEBUG -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] (1.0ms) BEGIN
2021-03-09T16:25:55.891685+00:00 app[web.1]: D, [2021-03-09T16:25:55.891611 #4] DEBUG -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Cart Create (1.2ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:25:55.889991"], ["updated_at", "2021-03-09 16:25:55.889991"]]
2021-03-09T16:25:55.894147+00:00 app[web.1]: D, [2021-03-09T16:25:55.894080 #4] DEBUG -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] (2.1ms) COMMIT
2021-03-09T16:25:55.895883+00:00 app[web.1]: D, [2021-03-09T16:25:55.895820 #4] DEBUG -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102584]]
2021-03-09T16:25:55.896595+00:00 app[web.1]: I, [2021-03-09T16:25:55.896512 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:25:55.898042+00:00 app[web.1]: I, [2021-03-09T16:25:55.897982 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Rendered carts/show.html.erb within layouts/application (1.4ms)
2021-03-09T16:25:55.900969+00:00 app[web.1]: I, [2021-03-09T16:25:55.900906 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Rendered shared/_navbar.html.erb (2.0ms)
2021-03-09T16:25:55.901154+00:00 app[web.1]: I, [2021-03-09T16:25:55.901098 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Rendered shared/_flashes.html.erb (0.0ms)
2021-03-09T16:25:55.901439+00:00 app[web.1]: I, [2021-03-09T16:25:55.901385 #4] INFO -- : [e2305a65-52be-432a-867f-ac1c0f459e1b] Completed 200 OK in 14ms (Views: 5.1ms | ActiveRecord: 5.3ms)
2021-03-09T16:25:55.903393+00:00 heroku[router]: at=info method=GET path="/en/carts/100171" host=www.bravacoffeeroasters.com request_id=e2305a65-52be-432a-867f-ac1c0f459e1b fwd="5.9.108.254" dyno=web.1 connect=0ms service=20ms status=200 bytes=8005 protocol=https
2021-03-09T16:26:02.095206+00:00 app[web.1]: I, [2021-03-09T16:26:02.095107 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Started GET "/en/carts/100176" for 5.9.108.254 at 2021-03-09 16:26:02 +0000
2021-03-09T16:26:02.096223+00:00 app[web.1]: I, [2021-03-09T16:26:02.096121 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Processing by CartsController#show as HTML
2021-03-09T16:26:02.096287+00:00 app[web.1]: I, [2021-03-09T16:26:02.096209 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Parameters: {"locale"=>"en", "id"=>"100176"}
2021-03-09T16:26:02.099292+00:00 app[web.1]: D, [2021-03-09T16:26:02.099195 #4] DEBUG -- : [59ebb736-4614-4052-97dd-9517cfd2af70] (1.0ms) BEGIN
2021-03-09T16:26:02.101864+00:00 app[web.1]: D, [2021-03-09T16:26:02.101787 #4] DEBUG -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Cart Create (1.3ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:26:02.099815"], ["updated_at", "2021-03-09 16:26:02.099815"]]
2021-03-09T16:26:02.104590+00:00 app[web.1]: D, [2021-03-09T16:26:02.104462 #4] DEBUG -- : [59ebb736-4614-4052-97dd-9517cfd2af70] (2.3ms) COMMIT
2021-03-09T16:26:02.106692+00:00 app[web.1]: D, [2021-03-09T16:26:02.106619 #4] DEBUG -- : [59ebb736-4614-4052-97dd-9517cfd2af70] OrderItem Load (1.3ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102585]]
2021-03-09T16:26:02.107212+00:00 app[web.1]: I, [2021-03-09T16:26:02.107150 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:26:02.108495+00:00 app[web.1]: I, [2021-03-09T16:26:02.108422 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Rendered carts/show.html.erb within layouts/application (1.2ms)
2021-03-09T16:26:02.111100+00:00 app[web.1]: I, [2021-03-09T16:26:02.111034 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Rendered shared/_navbar.html.erb (1.7ms)
2021-03-09T16:26:02.111294+00:00 app[web.1]: I, [2021-03-09T16:26:02.111230 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:26:02.111695+00:00 app[web.1]: I, [2021-03-09T16:26:02.111563 #4] INFO -- : [59ebb736-4614-4052-97dd-9517cfd2af70] Completed 200 OK in 15ms (Views: 4.5ms | ActiveRecord: 5.9ms)
2021-03-09T16:26:02.114053+00:00 heroku[router]: at=info method=GET path="/en/carts/100176" host=www.bravacoffeeroasters.com request_id=59ebb736-4614-4052-97dd-9517cfd2af70 fwd="5.9.108.254" dyno=web.1 connect=0ms service=21ms status=200 bytes=8011 protocol=https
2021-03-09T16:26:07.168587+00:00 app[web.1]: I, [2021-03-09T16:26:07.168395 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Started GET "/en/carts/100181" for 5.9.108.254 at 2021-03-09 16:26:07 +0000
2021-03-09T16:26:07.169524+00:00 app[web.1]: I, [2021-03-09T16:26:07.169461 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Processing by CartsController#show as HTML
2021-03-09T16:26:07.169585+00:00 app[web.1]: I, [2021-03-09T16:26:07.169533 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Parameters: {"locale"=>"en", "id"=>"100181"}
2021-03-09T16:26:07.172559+00:00 app[web.1]: D, [2021-03-09T16:26:07.172490 #4] DEBUG -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] (1.0ms) BEGIN
2021-03-09T16:26:07.174639+00:00 app[web.1]: D, [2021-03-09T16:26:07.174577 #4] DEBUG -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Cart Create (1.2ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:26:07.172954"], ["updated_at", "2021-03-09 16:26:07.172954"]]
2021-03-09T16:26:07.176801+00:00 app[web.1]: D, [2021-03-09T16:26:07.176731 #4] DEBUG -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] (1.9ms) COMMIT
2021-03-09T16:26:07.178631+00:00 app[web.1]: D, [2021-03-09T16:26:07.178567 #4] DEBUG -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] OrderItem Load (1.1ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102586]]
2021-03-09T16:26:07.179179+00:00 app[web.1]: I, [2021-03-09T16:26:07.179119 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:26:07.180626+00:00 app[web.1]: I, [2021-03-09T16:26:07.180554 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Rendered carts/show.html.erb within layouts/application (1.3ms)
2021-03-09T16:26:07.183396+00:00 app[web.1]: I, [2021-03-09T16:26:07.183332 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Rendered shared/_navbar.html.erb (1.9ms)
2021-03-09T16:26:07.183592+00:00 app[web.1]: I, [2021-03-09T16:26:07.183524 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Rendered shared/_flashes.html.erb (0.0ms)
2021-03-09T16:26:07.183924+00:00 app[web.1]: I, [2021-03-09T16:26:07.183852 #4] INFO -- : [512ac9cd-da40-435d-a7b8-986ad4209a31] Completed 200 OK in 14ms (Views: 4.8ms | ActiveRecord: 5.1ms)
2021-03-09T16:26:07.186556+00:00 heroku[router]: at=info method=GET path="/en/carts/100181" host=www.bravacoffeeroasters.com request_id=512ac9cd-da40-435d-a7b8-986ad4209a31 fwd="5.9.108.254" dyno=web.1 connect=0ms service=20ms status=200 bytes=8009 protocol=https
2021-03-09T16:26:12.791059+00:00 app[web.1]: I, [2021-03-09T16:26:12.790956 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Started GET "/en/carts/100185" for 5.9.108.254 at 2021-03-09 16:26:12 +0000
2021-03-09T16:26:12.792005+00:00 app[web.1]: I, [2021-03-09T16:26:12.791938 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Processing by CartsController#show as HTML
2021-03-09T16:26:12.792075+00:00 app[web.1]: I, [2021-03-09T16:26:12.792011 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Parameters: {"locale"=>"en", "id"=>"100185"}
2021-03-09T16:26:12.794860+00:00 app[web.1]: D, [2021-03-09T16:26:12.794781 #4] DEBUG -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] (1.0ms) BEGIN
2021-03-09T16:26:12.797433+00:00 app[web.1]: D, [2021-03-09T16:26:12.797358 #4] DEBUG -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Cart Create (1.2ms) INSERT INTO "carts" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", "2021-03-09 16:26:12.795289"], ["updated_at", "2021-03-09 16:26:12.795289"]]
2021-03-09T16:26:12.799742+00:00 app[web.1]: D, [2021-03-09T16:26:12.799657 #4] DEBUG -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] (1.8ms) COMMIT
2021-03-09T16:26:12.801691+00:00 app[web.1]: D, [2021-03-09T16:26:12.801618 #4] DEBUG -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] OrderItem Load (1.2ms) SELECT "order_items".* FROM "order_items" WHERE "order_items"."cart_id" = $1 [["cart_id", 102587]]
2021-03-09T16:26:12.802222+00:00 app[web.1]: I, [2021-03-09T16:26:12.802153 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Rendering carts/show.html.erb within layouts/application
2021-03-09T16:26:12.803798+00:00 app[web.1]: I, [2021-03-09T16:26:12.803727 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Rendered carts/show.html.erb within layouts/application (1.5ms)
2021-03-09T16:26:12.807236+00:00 app[web.1]: I, [2021-03-09T16:26:12.807070 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Rendered shared/_navbar.html.erb (2.3ms)
2021-03-09T16:26:12.807516+00:00 app[web.1]: I, [2021-03-09T16:26:12.807446 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Rendered shared/_flashes.html.erb (0.1ms)
2021-03-09T16:26:12.807908+00:00 app[web.1]: I, [2021-03-09T16:26:12.807840 #4] INFO -- : [ee78de9f-ffb9-4c3b-a484-8438903fd9c9] Completed 200 OK in 16ms (Views: 5.8ms | ActiveRecord: 5.2ms)
2021-03-09T16:26:12.809202+00:00 heroku[router]: at=info method=GET path="/en/carts/100185" host=www.bravacoffeeroasters.com request_id=ee78de9f-ffb9-4c3b-a484-8438903fd9c9 fwd="5.9.108.254" dyno=web.1 connect=0ms service=20ms status=200 bytes=8013 protocol=https
I deleted all the Carts of the production database yesterday and today I have already more than 3000 rows. This sounds bad to me. Is anyone could help fixing the problem?
If I am reading your code correctly:
before_action :current_cart
def current_cart
...
if session[:cart_id] == nil
#current_cart = Cart.create
session[:cart_id] = #current_cart.id
end
end
A before_action added in ApplicationController will execute for every action in every controller that inherits from ApplicationController.
Even your homepage probably executes it. When session[:cart_id] is nil (which by your current issue, it happens a lot) every access will create a Cart.
The purpose of current_cart, IMO, same as current_user is to find a cart not create one. If it's not present, then it's other action's purpose to create it.
You should revise your logic a little. Good luck!
I am trying to implement Log-In with Facebook to my app. Everything worked fine in development but for production I had to upgrade the app to https and when I pushed to production, nothing works anymore.
I have no idea how to debug this since it's in production. Any help would be appreciated.
Those are the server logs:
2018-09-17T19:07:21.708757+00:00 app[web.1]: I, [2018-09-17T19:07:21.708637 #4] INFO -- : [c8077522-7674-46e5-97b8-c74456194630] Started GET "/users/auth/facebook" for 213.190.86.42 at 2018-09-17 19:07:21 +0000
2018-09-17T19:07:21.709189+00:00 app[web.1]: I, [2018-09-17T19:07:21.709128 #4] INFO -- omniauth: (facebook) Request phase initiated.
2018-09-17T19:07:22.442651+00:00 app[web.1]: I, [2018-09-17T19:07:22.442540 #4] INFO -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] Started GET "/users/auth/facebook/callback?code=AQDCk0zcgI3_D0ZEuO5l6pWjAbhRgSelpfYcPB_f70hwffFdhs2MRp1rYd1fktORGUhqruLXbB40DXbbbx71zMHD2hH5UyndDQXbWpZ4gIoDuGVqO6IgFMwQuv0Jp_-PVQ2eokb_aW_ZfVY_LkIYPUWqy4fGihmWgd3S4cSlpo9zqV_0m9Ra4avOXQjw5a8VQEq2WNlIsun4J77x4EBzrOh_9xtVG582YV2pZy6tFE83QsvsmNkpBEzmWsV0bnGek94hbnbkpKRmImHfCLD5iyJ3HWZ3uQLG3FypdGZHjo8BtQ23Y2GeD5lnsyGlvqGRX4M&state=f58628a503514d6fd368e47a88f0f1c383e1dbe519b4ad09" for 213.190.86.42 at 2018-09-17 19:07:22 +0000
2018-09-17T19:07:22.443281+00:00 app[web.1]: I, [2018-09-17T19:07:22.443215 #4] INFO -- omniauth: (facebook) Callback phase initiated.
2018-09-17T19:07:22.958420+00:00 app[web.1]: I, [2018-09-17T19:07:22.958291 #4] INFO -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] Processing by Users::OmniauthCallbacksController#facebook as HTML
2018-09-17T19:07:22.963677+00:00 app[web.1]: I, [2018-09-17T19:07:22.962975 #4] INFO -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] Parameters: {"code"=>"AQDCk0zcgI3_D0ZEuO5l6pWjAbhRgSelpfYcPB_f70hwffFdhs2MRp1rYd1fktORGUhqruLXbB40DXbbbx71zMHD2hH5UyndDQXbWpZ4gIoDuGVqO6IgFMwQuv0Jp_-PVQ2eokb_aW_ZfVY_LkIYPUWqy4fGihmWgd3S4cSlpo9zqV_0m9Ra4avOXQjw5a8VQEq2WNlIsun4J77x4EBzrOh_9xtVG582YV2pZy6tFE83QsvsmNkpBEzmWsV0bnGek94hbnbkpKRmImHfCLD5iyJ3HWZ3uQLG3FypdGZHjo8BtQ23Y2GeD5lnsyGlvqGRX4M", "state"=>"f58628a503514d6fd368e47a88f0f1c383e1dbe519b4ad09"}
2018-09-17T19:07:22.987503+00:00 app[web.1]: D, [2018-09-17T19:07:22.987389 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] User Load (3.9ms) SELECT "users".* FROM "users" WHERE "users"."provider" = $1 AND "users"."uid" = $2 LIMIT $3 [["provider", "facebook"], ["uid", "10156065770667984"], ["LIMIT", 1]]
2018-09-17T19:07:22.990121+00:00 app[web.1]: D, [2018-09-17T19:07:22.990015 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] (1.6ms) BEGIN
2018-09-17T19:07:22.997442+00:00 app[web.1]: D, [2018-09-17T19:07:22.997336 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] User Exists (2.1ms) SELECT 1 AS one FROM "users" WHERE "users"."username" = $1 AND "users"."id" != $2 LIMIT $3 [["username", "Listy"], ["id", 65], ["LIMIT", 1]]
2018-09-17T19:07:23.002441+00:00 app[web.1]: D, [2018-09-17T19:07:23.002365 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] User Update (2.9ms) UPDATE "users" SET "token" = $1, "token_expiry" = $2, "updated_at" = $3 WHERE "users"."id" = $4 [["token", "EAADxC9YDD2sBAKeTKx0Cgp86Dnm5l774a2vVsZBYwOTnl7TV9egMgBYjTtgY9lFHV6eW90V1KgRspbcHM3mKL92hKPO0fZAVbkNaWjdHzJ8TQiaRYJqZC3NnhNu6GOOr6eFtteA48XWhYXQslchLmFgUky1G50ZD"], ["token_expiry", "2018-11-16 19:07:22"], ["updated_at", "2018-09-17 19:07:22.997902"], ["id", 65]]
2018-09-17T19:07:23.055468+00:00 app[web.1]: D, [2018-09-17T19:07:23.055339 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] (6.5ms) COMMIT
2018-09-17T19:07:23.063263+00:00 app[web.1]: I, [2018-09-17T19:07:23.063174 #4] INFO -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] Completed 500 Internal Server Error in 99ms (Searchkick: 6.4ms | ActiveRecord: 19.1ms)
2018-09-17T19:07:23.064786+00:00 app[web.1]: F, [2018-09-17T19:07:23.064718 #4] FATAL -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78]
2018-09-17T19:07:23.062638+00:00 app[web.1]: D, [2018-09-17T19:07:23.062529 #4] DEBUG -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] User Store (6.4ms) {"id":65,"exception":["NoMethodError","undefined method `connect_timeout=' for #\u003cTyphoeus::Request:0x000000000782ded8\u003e"],"exception_object":"undefined method `connect_timeout=' for #\u003cTyphoeus::Request:0x000000000782ded8\u003e"}
2018-09-17T19:07:23.065029+00:00 app[web.1]: F, [2018-09-17T19:07:23.064965 #4] FATAL -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] NoMethodError (undefined method `connect_timeout=' for #<Typhoeus::Request:0x000000000782ded8>):
2018-09-17T19:07:23.065153+00:00 app[web.1]: F, [2018-09-17T19:07:23.065087 #4] FATAL -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78]
2018-09-17T19:07:23.065246+00:00 app[web.1]: [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] app/controllers/users/omniauth_callbacks_controller.rb:3:in `facebook'
2018-09-17T19:07:23.065243+00:00 app[web.1]: F, [2018-09-17T19:07:23.065187 #4] FATAL -- : [3d25cc49-e2ec-4593-bf2f-d06d5595cd78] app/models/user.rb:76:in `find_for_facebook_oauth'
2018-09-17T19:07:23.067245+00:00 heroku[router]: at=info method=GET path= "/users/auth/facebook/callback?code= AQDCk0zcgI3_D0ZEuO5l6pWjAbhRgSelpfYcPB_f70hwffFdhs2MRp1rYd1fktORGUhqruLXbB40DXbbbx71zMHD2hH5UyndDQXbWpZ4gIoDuGVqO6IgFMwQuv0Jp_-PVQ2eokb_aW_ZfVY_LkIYPUWqy4fGihmWgd3S4cSlpo9zqV_0m9Ra4avOXQjw5a8VQEq2WNlIsun4J77x4EBzrOh_9xtVG582YV2pZy6tFE83QsvsmNkpBEzmWsV0bnGek94hbnbkpKRmImHfCLD5iyJ3HWZ3uQLG3FypdGZHjo8BtQ23Y2GeD5lnsyGlvqGRX4M&state=f58628a503514d6fd368e47a88f0f1c383e1dbe519b4ad09" host=www.listy.club request_id=3d25cc49-e2ec-4593-bf2f-d06d5595cd78 fwd="213.190.86.42" dyno=web.1 connect=0ms service=630ms status=500 bytes=1891 protocol=https
2018-09-17T19:08:50.249219+00:00 heroku[run.8341]: Process exited with status 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.
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.
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.
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?
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.
I have an rails 5 app which works perfectly in my local machine with PostgreSQL locally installed.
I pushed my app to heroku and the login page of the app appears correctly. But when I try to login to the app I get an error. Checking the logs give following output.
2016-10-26T04:21:48.515201+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=teamwallet.herokuapp.com request_id=94268ad1-1f86-4caf-80ae-61799fdddc5b fwd="182.57.131.204" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
2016-10-26T04:21:54.410775+00:00 heroku[router]: at=info method=POST path="/" host=teamwallet.herokuapp.com request_id=52da63d5-afbd-4e8d-9d8a-51b04d077a21 fwd="182.57.131.204" dyno=web.1 connect=0ms service=7ms status=500 bytes=1669
2016-10-26T04:21:54.435325+00:00 app[web.1]: I, [2016-10-26T04:21:54.435257 #3] INFO -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] Started POST "/" for 182.57.131.204 at 2016-10-26 04:21:54 +0000
2016-10-26T04:21:54.435994+00:00 app[web.1]: I, [2016-10-26T04:21:54.435933 #3] INFO -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] Processing by SessionsController#login_attempt as HTML
2016-10-26T04:21:54.436093+00:00 app[web.1]: I, [2016-10-26T04:21:54.436045 #3] INFO -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] Parameters: {"utf8"=>"✓", "authenticity_token"=>"xEvOCcjU8FZyt2OlypuNIifhucXsveX6TOGIXwkpddO7Dt9cEQyJrS/5Kw+trW35eo/jtv+A2IkuIzYHJUt4tQ==", "username_or_email"=>"admin", "login_password"=>"[FILTERED]", "commit"=>"Log In"}
2016-10-26T04:21:54.438633+00:00 app[web.1]: I, [2016-10-26T04:21:54.438587 #3] INFO -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] Completed 500 Internal Server Error in 2ms (ActiveRecord: 1.7ms)
2016-10-26T04:21:54.439261+00:00 app[web.1]: F, [2016-10-26T04:21:54.439180 #3] FATAL -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21]
2016-10-26T04:21:54.439305+00:00 app[web.1]: F, [2016-10-26T04:21:54.439242 #3] FATAL -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
2016-10-26T04:21:54.439306+00:00 app[web.1]: LINE 8: WHERE a.attrelid = '"users"'::regclass
2016-10-26T04:21:54.439307+00:00 app[web.1]: ^
2016-10-26T04:21:54.439308+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2016-10-26T04:21:54.439309+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
2016-10-26T04:21:54.439310+00:00 app[web.1]: (SELECT c.collname FROM pg_collation c, pg_type t
2016-10-26T04:21:54.439311+00:00 app[web.1]: WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
2016-10-26T04:21:54.439311+00:00 app[web.1]: col_description(a.attrelid, a.attnum) AS comment
2016-10-26T04:21:54.439312+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2016-10-26T04:21:54.439313+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2016-10-26T04:21:54.439313+00:00 app[web.1]: WHERE a.attrelid = '"users"'::regclass
2016-10-26T04:21:54.439314+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2016-10-26T04:21:54.439315+00:00 app[web.1]: ORDER BY a.attnum
2016-10-26T04:21:54.439316+00:00 app[web.1]: ):
2016-10-26T04:21:54.439363+00:00 app[web.1]: F, [2016-10-26T04:21:54.439302 #3] FATAL -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21]
2016-10-26T04:21:54.439411+00:00 app[web.1]: F, [2016-10-26T04:21:54.439359 #3] FATAL -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] app/models/user.rb:23:in `authenticate'
2016-10-26T04:21:54.439458+00:00 app[web.1]: F, [2016-10-26T04:21:54.439406 #3] FATAL -- : [52da63d5-afbd-4e8d-9d8a-51b04d077a21] app/controllers/sessions_controller.rb:11:in `login_attempt'
Your error says this:
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
it's really easy to forget, but Heroku doesn't automatically run migrations.
From the heroku docs https://devcenter.heroku.com/articles/rake
# shell
heroku run rake db:migrate
heroku restart
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
You forgot to run the migrations on heroku. Run this command on your console
heroku run rake db:migrate