# Neustart schlägt fehl wegen Theme-Fehler, Site startet nicht

**URL:** https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713
**Category:** Support
**Created:** [8. Februar 2019 um 20:30 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713 "2019-02-08T20:30:55Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [8. Februar 2019 um 20:30 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/1 "2019-02-08T20:30:55Z")

</div>

Hello, this morning my Discourse failed for me mid-usage, and rebuilding has me stuck. Initially I had the “Oops!” page, but after my first rebuild it won’t start at all.

- I’ve removed _all_ plugins, official or otherwise, leaving only `docker_manager.git`
- I’ve `git pull`ed from within `/var/discourse` and am `Already up-to-date.`
- I’ve tried `./launcher cleanup`, but `./launcher rebuild app` still fails

The error shown is:

```plaintext
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 17092 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'"]}
f3a13e3833fdc05123d7232621e11b0a0abdcfadad416474f12ee87f319e0f1e
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

Going up, I see a `rake aborted!` error:

> **Log**
>
> ```plaintext
> Start compiling CSS: 2019-02-08 20:21:39 UTC
> Compiling css for default 2019-02-08 20:21:39 UTC
> precompile target: desktop Dark
> rake aborted!
> ArgumentError: comparison of Integer with nil failed
> /var/www/discourse/app/models/theme.rb:132:in `sort!'
> /var/www/discourse/app/models/theme.rb:132:in `block in transform_ids'
> /var/www/discourse/app/models/theme.rb:88:in `get_set_cache'
> /var/www/discourse/app/models/theme.rb:123:in `transform_ids'
> /var/www/discourse/app/models/theme.rb:332:in `all_theme_variables'
> /var/www/discourse/lib/stylesheet/importer.rb:43:in `block in <class:Importer>'
> /var/www/discourse/lib/stylesheet/importer.rb:151:in `instance_eval'
> /var/www/discourse/lib/stylesheet/importer.rb:151:in `imports'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sassc-1.11.4/lib/sassc/import_handler.rb:29:in `block in import_function'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sassc-1.11.4/lib/sassc/engine.rb:40:in `compile_data_context'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/sassc-1.11.4/lib/sassc/engine.rb:40:in `render'
> /var/www/discourse/lib/stylesheet/compiler.rb:38:in `compile'
> /var/www/discourse/lib/stylesheet/compiler.rb:20:in `compile_asset'
> /var/www/discourse/lib/stylesheet/manager.rb:162:in `compile'
> /var/www/discourse/lib/stylesheet/manager.rb:96:in `block (2 levels) in precompile_css'
> /var/www/discourse/lib/stylesheet/manager.rb:89:in `each'
> /var/www/discourse/lib/stylesheet/manager.rb:89:in `block in precompile_css'
> /var/www/discourse/lib/stylesheet/manager.rb:88:in `each'
> /var/www/discourse/lib/stylesheet/manager.rb:88:in `precompile_css'
> /var/www/discourse/lib/tasks/assets.rake:60:in `block (2 levels) in <top (required)>'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:63:in `with_connection'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.6/lib/rails_multisite/connection_management.rb:73:in `each_connection'
> /var/www/discourse/lib/tasks/assets.rake:53:in `block in <top (required)>'
> /var/www/discourse/lib/tasks/assets.rake:235:in `block in <top (required)>'
> /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
> 
> ```

I gather there may be a theme and/or component error, but I cannot enter [safe mode](https://meta.discourse.org/t/53504?silent=true) to disable anything because my site won’t start at all.

What do you recommend to do next in this scenario?

Thank you.

---

<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: [8. Februar 2019 um 20:55 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/3 "2019-02-08T20:55:46Z")

</div>

Can you try running

```plaintext
./launcher start app

```

That should bring the site back online (on the old version). Once it’s back up, please can you run

```plaintext
./launcher enter app
rails c

SiteSetting.default_theme_id

```

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [8. Februar 2019 um 21:02 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/4 "2019-02-08T21:02:02Z")

</div>

Thanks @david,

`./launcher start app` fails to bring the site back up:

```plaintext
Unable to find image 'local_discourse/app:latest' locally
/usr/bin/docker: Error response from daemon: repository local_discourse/app not found: does not exist or no pull access.
See '/usr/bin/docker run --help'.

```

`docker ps` returns empty, there’s no app container to enter.

---

<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: [8. Februar 2019 um 21:13 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/5 "2019-02-08T21:13:19Z")

</div>

Ah, it’s possible that the old container was cleaned up when you ran `launcher cleanup` (since it wasn’t running).

Ok, can you try editing your `app.yml` file, and add this under the `env` section. Make sure the indentation is the same as all the other variables in that section.

```plaintext
DONT_PRECOMPILE_CSS: 1

```

Then try rebuilding again.

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [8. Februar 2019 um 21:41 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/6 "2019-02-08T21:41:11Z")

</div>

Perfect, that’s just what I needed.

Thanks, I appreciate it!

---

<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: [8. Februar 2019 um 21:58 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/7 "2019-02-08T21:58:06Z")

</div>

Hold up! You don’t want to leave it like that forever - we precompile CSS for a reason 😉

Now that the site is up, can you try running the commands I listed above:

```plaintext
./launcher enter app
rails c

SiteSetting.default_theme_id

```

That should give you a number. If so, try

```plaintext
Theme.find(SiteSetting.default_theme_id).name

```

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [8. Februar 2019 um 22:06 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/8 "2019-02-08T22:06:33Z")

</div>

Oh yeah I know lol. I used it to get back into safe-mode, adjusted what I needed, and then removed it. All good, I ended up not needing to enter the app or rails console.

Thanks for checking though!

---

<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: [8. Februar 2019 um 22:10 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/9 "2019-02-08T22:10:59Z")

</div>

Did you figure out what caused the issue in the first place? If possible I’d like to find out the root cause so that we can prevent it happening to anyone in the future - broken rebuilds are pretty annoying!

---

<div class="post-metadata">

### Author: ![FoohonPie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foohonpie/32/119648_2.png) [@FoohonPie](https://meta.discourse.org/u/FoohonPie)
#### Post date: [8. Februar 2019 um 22:47 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/10 "2019-02-08T22:47:51Z")

</div>

I’m not sure what caused my site to break mid-use, but I do believe the rebuild breaking has something to do a recurring issue with an unofficial plugin.

The details are [here](https://meta.discourse.org/t/mingle-an-introductions-plugin/95634/13) if you’re curious, but it doesn’t seem to be an issue with core or any official plugins as far as I can tell.

---

<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: [8. Februar 2019 um 23:10 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/11 "2019-02-08T23:10:48Z")

</div>

Thanks for the information.

My _suspicion_ is that somehow the “default” theme got deleted, which would explain the site breaking, and then the rebuild failing. I’m not exactly sure how that could happen, but I’ll double check our safeguards on that next week (I’m working on this code anyway).

---

<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: [10. März 2019 um 23:15 UTC](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/12 "2019-03-10T23:15:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
