Failed to handle exception in exception app middleware : PG::UndefinedTable: ERROR: relation "themes" does not exist

Our forum stopped working recently. I’m not sure that I actually did something myself, but I’m finding this in rails/production.log:

Started GET "/latest.rss" for 3.87.95.100 at 2019-02-07 10:28:28 +0000
Processing by ListController#latest_feed as */*
Completed 500 Internal Server Error in 24ms (ActiveRecord: 14.9ms)
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "themes" does not exist
LINE 8:                WHERE a.attrelid = '"themes"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                     c.collname, col_description(a.attrelid, a.attnum) AS comment
                FROM pg_attribute a
                LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                LEFT JOIN pg_type t ON a.atttypid = t.oid
                LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
               WHERE a.attrelid = '"themes"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
)
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.1/lib/patches/db/pg.rb:110:in `async_exec'
Failed to handle exception in exception app middleware : PG::UndefinedTable: ERROR:  relation "themes" does not exist
LINE 8:                WHERE a.attrelid = '"themes"'::regclass

Can you try?

cd /var/discourse
./launcher rebuild app
2 Likes

Thank. Tried this. It ends here:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 17046 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
c030fefce019f920d63d1a20f305939551dc33d46a5fb1623bea4c544b79ac34
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one