# Rebuild fails because still on \`master\` branch. Fix with \`git checkout main\`

**URL:** https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277
**Category:** Support
**Created:** [February 15, 2022, 6:06pm UTC](https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277 "2022-02-15T18:06:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 15, 2022, 6:06pm UTC](https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277/1 "2022-02-15T18:06:00Z")

</div>

I guess this missing `yarn` is the issue? I don’t what what could be causing it or anything else that might be an explanation…

```plaintext
discourse-checklist is already at latest compatible version
discourse-spoiler-alert is already at latest compatible version
discourse-affiliate is already at latest compatible version

I, [2022-02-15T18:02:48.675851 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
I, [2022-02-15T18:02:55.018972 #1] INFO -- : 
I, [2022-02-15T18:02:55.019167 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
sh: 1: yarn: not found
I, [2022-02-15T18:03:00.609631 #1] INFO -- : Checking 'Easy Footer (TH)' for 'default'... up to date
Checking 'discourse-user-field-prompt' for 'default'... up to date
Checking 'Rotate Global Banner(JP)' for 'default'... 

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 5437 exit 127>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
d6ac4e7c27174dd04269576be15628207fe7d8d19f99c6ea524836f8ee43b895
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 15, 2022, 6:30pm UTC](https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277/2 "2022-02-15T18:30:51Z")

</div>

Our base image ships with yarn for a while. What is the base image version you are running?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 15, 2022, 6:52pm UTC](https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277/3 "2022-02-15T18:52:33Z")

</div>

I thought I was going crazy.

The issue was that this host was still on `master`; `git checkout main` has solved the problem.

I guess I should be doing a `git checkout main` on ~~all hosts~~ two-container hosts where the procedure is to bootstrap/destroy/start rather than rebuild ~~in case they’re old enough to need it~~.

---

<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: [March 17, 2022, 6:53pm UTC](https://meta.discourse.org/t/rebuild-fails-because-still-on-master-branch-fix-with-git-checkout-main/218277/4 "2022-03-17T18:53:25Z")

</div>

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