# Can't rebuild because ssh template is removed

**URL:** https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285
**Category:** Self-hosting
**Created:** [May 4, 2020, 5:52am UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285 "2020-05-04T05:52:55Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![multicam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/multicam/32/98435_2.png) [@multicam](https://meta.discourse.org/u/multicam)
#### Post date: [May 4, 2020, 5:52am UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/1 "2020-05-04T05:52:55Z")

</div>

We are trying to rebuild our discourse installation (as asked by the admin interface)  
Here are the errors, please help, we are not verse in docker

```bash
    root@school-forum:/var/discourse# ./launcher rebuild app
    Ensuring launcher is up to date
    Fetching origin
    Launcher is up-to-date
    cat: templates/sshd.template.yml: No such file or directory
    cd /pups && git pull && /pups/bin/pups --stdin
    /usr/bin/docker: invalid reference format: repository name must be lowercase.
    See '/usr/bin/docker run --help'.
    cat: cids/app_bootstrap.cid: No such file or directory
    "docker rm" requires at least 1 argument.
    See 'docker rm --help'.

    Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]

    Remove one or more containers
    rm: cannot remove ‘cids/app_bootstrap.cid’: No such file or directory
    **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.
    root@school-forum:/var/discourse#

```

Please help – we dont’ seem to find people with similar problems recently.

Edit: after apt-get update/upgrade, I get a new error message:

```bash
/usr/bin/docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:297: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
Your Docker installation is not working correctly

See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam
root@school-forum:/var/discourse# ./launcher rebuild app
/usr/bin/docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:297: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
Your Docker installation is not working correctly

See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam
```

---

<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: [May 4, 2020, 12:25pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/2 "2020-05-04T12:25:13Z")

</div>

Have you rebooted after a docker upgrade? What version of os and docker do you have?

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [May 4, 2020, 1:25pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/3 "2020-05-04T13:25:28Z")

</div>

> [@multicam](#):
>
> templates/sshd.template.yml

I had this error myself.

I fixed it by editing App.yml and commenting that line in Templates. Use # to comment the line.

Rebuild app worked fine after.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [May 4, 2020, 1:26pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/4 "2020-05-04T13:26:48Z")

</div>

That file is missing after(not sure if it was there before) the git pull.

---

<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: [May 4, 2020, 1:39pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/5 "2020-05-04T13:39:41Z")

</div>

That’s it!

[https://github.com/discourse/discourse\_docker/commit/8c8dbd03d41925da367ee7deb82dc0afd0305230](https://github.com/discourse/discourse_docker/commit/8c8dbd03d41925da367ee7deb82dc0afd0305230)

I edited the title to indicate the issue

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [May 4, 2020, 1:45pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/6 "2020-05-04T13:45:17Z")

</div>

After trying a few things. Figured just try commenting it out. Up until today’s post hadn’t found any one else had this rebuild issue. 🍻😎👍✨

---

<div class="post-metadata">

### Author: ![multicam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/multicam/32/98435_2.png) [@multicam](https://meta.discourse.org/u/multicam)
#### Post date: [May 5, 2020, 1:59am UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/7 "2020-05-05T01:59:45Z")

</div>

Hi all, quick update: commenting out the line in app.yml fixed this problem, however the rebuild fails further along with this message:

```plaintext
cd /pups && git pull && /pups/bin/pups --stdin
fatal: unable to access 'https://github.com/discourse/pups.git/': Could not resolve host: github.com
1e4e6a45815a1196e4687a17e44a0beb1dd6229cd61ba2a3b657903e6cd2b56e
**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.

```

Also `./discourse-doctor` fails after trying to rebuild – with the same message

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [May 5, 2020, 2:07am UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/8 "2020-05-05T02:07:49Z")

</div>

Sorry to hear. Likely need a team member to assist. As didn’t have an issue after.

---

<div class="post-metadata">

### Author: ![tjands](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tjands/32/179154_2.png) [@tjands](https://meta.discourse.org/u/tjands)
#### Post date: [May 5, 2020, 6:31am UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/9 "2020-05-05T06:31:06Z")

</div>

I’ve been working with @multicam as we go through this, and it looks like it might be something to do with the DNS asigned by docker.

This is the best example of a similiar problem I could find, but their fixes didnt resolve it for us.

> [@Could not resolve host: github.com for SamSaffron/pups.git](https://meta.discourse.org/t/could-not-resolve-host-github-com-for-samsaffron-pups-git/32050/3):
>
> Hi @sam thanks for taking the time to review. I have that option uncommented in /etc/defaults/docker, and I’ve restarted the docker service many times. To clarify, after restarting the docker service the laucher rebuild will work once, after that I have to restart the service. You can see this via my systemd status. CGroup: /system.slice/docker.service └─22232 /usr/bin/docker -d -H fd:// --dns 8.8.8.8 --dns 8.8.4.4

---

<div class="post-metadata">

### Author: ![snakeninny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/snakeninny/32/115522_2.png) [@snakeninny](https://meta.discourse.org/u/snakeninny)
#### Post date: [May 6, 2020, 4:47pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/10 "2020-05-06T16:47:56Z")

</div>

Had this exact same problem upgrading from 2.4.2 to 2.4.3, with the log as follows:

```plaintext
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cat: templates/sshd.template.yml: No such file or directory
cd /pups && git pull && /pups/bin/pups --stdin
/usr/bin/docker: invalid reference format: repository name must be lowercase.
See '/usr/bin/docker run --help'.
cat: cids/app_bootstrap.cid: No such file or directory
"docker rm" requires at least 1 argument(s).
See 'docker rm --help'.

Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers
rm: cannot remove 'cids/app_bootstrap.cid': No such file or directory
**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.

```

After running `./discourse-doctor` app rebuild failed again but the container was restarted so the website is back to normal on version 2.4.2.

Any solutions so far?

---

<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: [May 6, 2020, 4:57pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/11 "2020-05-06T16:57:10Z")

</div>

> [@snakeninny](#):
>
> Any solutions so far?

Stop including the missing ssh template, as described here:

> [@multicam](#):
>
> quick update: commenting out the line in app.yml fixed this problem,

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [May 6, 2020, 5:58pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/12 "2020-05-06T17:58:24Z")

</div>

Sent in a PR to re-add the file, blank:

[https://github.com/discourse/discourse\_docker/pull/463](https://github.com/discourse/discourse_docker/pull/463)

This should fix the errors for existing setups.

* * *

Additionally, sent another PR to actually give people a warning this is an issue:

[https://github.com/discourse/discourse\_docker/pull/464](https://github.com/discourse/discourse_docker/pull/464)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [May 6, 2020, 6:36pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/13 "2020-05-06T18:36:13Z")

</div>

This is solved @Heliosurge @tjands @snakeninny - do another `./launcher rebuild` and it should work fine.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [May 6, 2020, 6:36pm UTC](https://meta.discourse.org/t/cant-rebuild-because-ssh-template-is-removed/150285/14 "2020-05-06T18:36:17Z")

</div>


