ruby on rails - Need help in understanding Heroku logs -


i have rails 5 app works in local machine postgresql locally installed.

i pushed app heroku , login page of app appears correctly. when try login app error. checking 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 "/" 182.57.131.204 @ 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 sessionscontroller#login_attempt 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" not exist 2016-10-26t04:21:54.439306+00:00 app[web.1]: line 8:                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 pg_collation c, pg_type t 2016-10-26t04:21:54.439311+00:00 app[web.1]:                c.oid = a.attcollation , t.oid = a.atttypid , a.attcollation <> t.typcollation), 2016-10-26t04:21:54.439311+00:00 app[web.1]:                      col_description(a.attrelid, a.attnum) comment 2016-10-26t04:21:54.439312+00:00 app[web.1]:                 pg_attribute left join pg_attrdef d 2016-10-26t04:21:54.439313+00:00 app[web.1]:                   on a.attrelid = d.adrelid , a.attnum = d.adnum 2016-10-26t04:21:54.439313+00:00 app[web.1]:                a.attrelid = '"users"'::regclass 2016-10-26t04:21:54.439314+00:00 app[web.1]:                  , a.attnum > 0 , not a.attisdropped 2016-10-26t04:21:54.439315+00:00 app[web.1]:                order 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" not exist 

it's easy forget, heroku doesn't automatically run migrations.

from heroku docs https://devcenter.heroku.com/articles/rake

# shell heroku run rake db:migrate heroku restart 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -