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

**URL:** <https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594>\
**Category:** Support\
**Created:** [February 7, 2019, 12:32pm UTC](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594 "2019-02-07T12:32:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kaspers](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaspers/32/120148_2.png) [@kaspers](https://meta.discourse.org/u/kaspers)\
**Post date:** [February 7, 2019, 12:32pm UTC](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594/1 "2019-02-07T12:32:12Z")

</div>

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

```plaintext
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

```

---

_[View the full topic](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594)._
