# Failed to bootstrap due to plugins using deprecated constants

**URL:** https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581
**Category:** Self-hosting
**Created:** [2017年十二月21日 20:28 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581 "2017-12-21T20:28:47Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![LordAres](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lordares/32/80605_2.png) [@LordAres](https://meta.discourse.org/u/LordAres)
#### Post date: [2017年十二月21日 20:28 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/1 "2017-12-21T20:28:47Z")

</div>

I guess you could say this is my first issue with Discourse. I tried to update to 1.9.0.beta17, When I try to run the `./launcher rebuild app` it starts out fine and then after a few short moments I get hit with this error

> FAILED  
> Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’ failed with return #\<Process::Status: pid 397 exit 1\>  
> Location of failure: /pups/lib/pups/exec\_command.rb:108: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’”]}  
> fc82dcd39523e668bcf12f479d2c4d59b129217050feb34f59960d74f1794fb0  
> \*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one

Any help would be nice.

Thanks 🙂

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2017年十二月21日 20:30 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/2 "2017-12-21T20:30:34Z")

</div>

Can you share the rest of the logs? From the section you shared:

> [@LordAres](#):
>
> please scroll up and look for earlier error messages, there may be more than one

---

<div class="post-metadata">

### Author: ![LordAres](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lordares/32/80605_2.png) [@LordAres](https://meta.discourse.org/u/LordAres)
#### Post date: [2017年十二月21日 20:32 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/3 "2017-12-21T20:32:47Z")

</div>

```plaintext
2017-12-21 20:20:12.295 UTC [450] discourse@discourse LOG: duration: 182.979 ms bind &lt;unnamed&gt;: SELECT COUNT(*) FROM (SELECT 1 FROM "users" LIMIT 20) subquery_for_count
rake aborted!
NameError: uninitialized constant USERNAME_ROUTE_FORMAT
/var/www/discourse/plugins/discourse-voting/plugin.rb:278:in `block (2 levels) in activate!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `eval_block'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:433:in `block in finalize!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:433:in `each'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:433:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:59:in `each'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:59:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:19:in `reload!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in &lt;module:Finisher&gt;'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `&lt;top (required)&gt;'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `&lt;top (required)&gt;'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `&lt;main&gt;'
Tasks: TOP =&gt; db:migrate =&gt; environment
(See full trace by running task with --trace)
I, [2017-12-21T20:20:13.406715 #13] INFO -- : gem install omniauth-discord -v 0.1.5 -i /var/www/discourse/plugins/discourse-plugin-discord-auth/gems/2.4.2 --no-document --ignore-dependencies
Successfully installed omniauth-discord-0.1.5
1 gem installed

I, [2017-12-21T20:20:13.407307 #13] INFO -- : Terminating async processes
I, [2017-12-21T20:20:13.407382 #13] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 42
I, [2017-12-21T20:20:13.407459 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 155
2017-12-21 20:20:13.407 UTC [42] LOG: received fast shutdown request
2017-12-21 20:20:13.407 UTC [42] LOG: aborting any active transactions
2017-12-21 20:20:13.408 UTC [49] LOG: autovacuum launcher shutting down
2017-12-21 20:20:13.410 UTC [46] LOG: shutting down
155:signal-handler (1513887613) Received SIGTERM scheduling shutdown...
2017-12-21 20:20:13.435 UTC [46] LOG: database system is shut down
155:M 21 Dec 20:20:13.474 # User requested shutdown...
155:M 21 Dec 20:20:13.475 * Saving the final RDB snapshot before exiting.
155:M 21 Dec 20:20:13.495 * DB saved on disk
155:M 21 Dec 20:20:13.495 # Redis is now ready to exit, bye bye...

```

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017年十二月21日 21:46 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/4 "2017-12-21T21:46:00Z")

</div>

If I’m reading that backtrace correctly, the `discourse-voting` plugin needs to be updated to use the new dynamic `RouteFormat` support. We’ll get to it Real Soon Now.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2017年十二月21日 21:56 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/5 "2017-12-21T21:56:58Z")

</div>

Had the same issue with one of my plugins. A quick search of [GitHub - discourse/all-the-plugins · GitHub](http://github.com/discourse/all-the-plugins) suggests that a couple of other plugins will also need updating in addition to the voting plugin:

> [@Chinese/Japanese/Korean localized username support 中文用户名支持](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954):
>
> here is a simple plugin for add CJK charset allowed as username or group name. 中日韩用户名/群组名支持插件 [https://github.com/zh99998/discourse-username-localization](https://github.com/zh99998/discourse-username-localization)Features Allow Chinese、Japanese、Korean as username or group name. 允许使用中文、日文、韩文做用户名和群组名称 use Pinyin or Romaji first letter as default avatar for Chinese, Hiragana and Katakana username. 对于中文和日文假名用户名，将使用拼音首字母作为系统默认头像 Install I don’t know how to replace the constant in routes and javascript, so i made a bash script to replace it. you may add…

and also `dl-license-keys` @joebuhlig

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017年十二月21日 22:20 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/6 "2017-12-21T22:20:19Z")

</div>

Sorry about this - I did not realize any plugins were using constants from our `routes.rb` file. I’ve added them back with a note about them being deprecated.

[https://github.com/discourse/discourse/commit/d0b44520bd36e271e0b935a6bd11fc9dc66a19d5](https://github.com/discourse/discourse/commit/d0b44520bd36e271e0b935a6bd11fc9dc66a19d5)

In a plugin you can support both with a piece of code like this:

```ruby
defined?(RouteFormat) ? RouteFormat.username : USERNAME_ROUTE_FORMAT

```

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2017年十二月21日 22:41 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/7 "2017-12-21T22:41:37Z")

</div>

Also I have updated our official plugins using these constants with that suggestion 👍

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [2017年十二月21日 23:18 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/8 "2017-12-21T23:18:07Z")

</div>

So, to close the loop on this, @LordAres you should be able to rebuild now without a problem. Sorry for the inconvenience.

---

<div class="post-metadata">

### Author: ![LordAres](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lordares/32/80605_2.png) [@LordAres](https://meta.discourse.org/u/LordAres)
#### Post date: [2017年十二月21日 23:20 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/9 "2017-12-21T23:20:10Z")

</div>

Thank you! Rebuilding now, so far so good. 👍

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年十二月22日 01:49 UTC](https://meta.discourse.org/t/failed-to-bootstrap-due-to-plugins-using-deprecated-constants/76581/10 "2017-12-22T01:49:37Z")

</div>


