# Error al manejar la excepción en el middleware de la aplicación de excepción: PG::UndefinedTable: ERROR: la relación "themes" no existe

**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:** [7 Febrero, 2019 12:32 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:** 4
**Page:** 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: [7 Febrero, 2019 12:32 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

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7 Febrero, 2019 21:47 UTC](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594/2 "2019-02-07T21:47:52Z")

</div>

Can you try?

```plaintext
cd /var/discourse
./launcher rebuild app

```

---

<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: [7 Febrero, 2019 23:04 UTC](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594/3 "2019-02-07T23:04:03Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [23 Febrero, 2022 04:18 UTC](https://meta.discourse.org/t/failed-to-handle-exception-in-exception-app-middleware-pg-error-relation-themes-does-not-exist/108594/4 "2022-02-23T04:18:18Z")

</div>


