# ./launcher rebuild app has an error, but exit code is 0

**URL:** <https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414>\
**Category:** Product Support\
**Created:** [January 7, 2021, 8:02pm UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414 "2021-01-07T20:02:19Z")\
**Posts on this page:** 7\
**Page:** 1

## AI-generated summary

The user [trusktr](/t/-/175414/1) encountered an error during a `./launcher rebuild app` command, specifically: `awk: fatal: cannot open file '/root/.ssh/authorized_keys'`. The error occurred during a custom command in the `app.yml` file, which attempts to parse SSH keys. [Falco](/t/-/175414/2) identified the issue as a relic from an old template, noting it's safe to ignore. [itsbhanusharma](/t/-/175414/6) pinpointed the problematic line in the `app.yml` and suggested removing or commenting out the `sshd.template.yml` template and the related `awk` command. [trusktr](/t/-/175414/7) confirmed the issue was inherited and appreciated the help, acknowledging the error was not related to Discourse itself.

<div class="post-metadata">

**Author:** ![trusktr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trusktr/32/116841_2.png) [@trusktr](https://meta.discourse.org/u/trusktr)\
**Post date:** [January 7, 2021, 8:02pm UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/1 "2021-01-07T20:02:19Z")

</div>

The error I see is

```plaintext
awk: fatal: cannot open file '/root/.ssh/authorized_keys'

```

Here’s the full output:

 ![discourse-output](https://global.discourse-cdn.com/meta/original/3X/5/8/587466a188126dad6f0b61c010dfd0100907b225.jpeg)

The site seems to still work. Anything to worry about? Should I do something?

---

<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:** [January 7, 2021, 9:27pm UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/2 "2021-01-07T21:27:49Z")

</div>

If I remember correctly that is a relic of an old template we used to had, in the days before `docker exec -it bash` was a thing.

It’s safe to ignore, but you can also remove the related lines from your app.yml if it bothers you.

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trusktr/32/116841_2.png) [@trusktr](https://meta.discourse.org/u/trusktr)\
**Post date:** [January 10, 2021, 2:33am UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/3 "2021-01-10T02:33:10Z")

</div>

Which line may that be?

---

<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:** [January 10, 2021, 3:36am UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/4 "2021-01-10T03:36:14Z")

</div>

If you share your app.yml here we may be able to tell exactly which ones.

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trusktr/32/116841_2.png) [@trusktr](https://meta.discourse.org/u/trusktr)\
**Post date:** [January 12, 2021, 5:15am UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/5 "2021-01-12T05:15:34Z")

</div>

Hello again @Falco !

Here’s some of my app.yml without sensitive parts:

> **app.yml**
>
> ```yml
> templates:
> - "templates/redis.template.yml"
> - "templates/postgres.template.yml"
> - "templates/sshd.template.yml"
> - "templates/web.template.yml"
> - "templates/web.ssl.template.yml"
> - "templates/web.letsencrypt.ssl.template.yml"
> - "templates/web.ratelimited.template.yml"
> 
> expose:
> - "2222:22" # fwd host port 2222 to container port 22 (ssh)
> - "80:80" # fwd host port 80 to container port 80 (http)
> - "443:443" # fwd host port 443 to container port 443 (https)
> 
> params:
> db_default_text_search_config: "pg_catalog.english"
> 
> env:
> DISCOURSE_REFRESH_MAXMIND_DB_DURING_PRECOMPILE_DAYS: 30
> 
> LANG: en_US.UTF-8
> UNICORN_WORKERS: 2
> 
> DISCOURSE_DEVELOPER_EMAILS: "......................."
> 
> DISCOURSE_HOSTNAME: "lume.community"
> 
> DISCOURSE_SMTP_ADDRESS: "................." # (mandatory)
> DISCOURSE_SMTP_USER_NAME: "....................." # (optional)
> DISCOURSE_SMTP_PASSWORD: "...................." # (optional)
> DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
> 
> LETSENCRYPT_ACCOUNT_EMAIL: ".............."
> 
> volumes:
> - volume:
> host: /var/discourse/shared/standalone
> guest: /shared
> - volume:
> host: /var/discourse/shared/standalone/log/var-log
> guest: /var/log
> 
> hooks:
> after_code:
> - exec:
> cd: $home/plugins
> cmd:
> - mkdir -p plugins
> - git clone https://github.com/discourse/docker_manager.git
> after_web_config:
> - replace:
> filename: /etc/nginx/nginx.conf
> from: /sendfile.+on;/
> to: |
> server_names_hash_bucket_size 64;
> sendfile on;
> - file:
> path: /etc/nginx/conf.d/discourse_redirect_1.conf
> contents: |
> server {
> listen 80;
> server_name infamous.gadi.cc;
> return 301 $scheme://forums.old-site.io$request_uri;
> }
> run:
> - exec: echo "Beginning of custom commands"
> - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'
> - exec: echo "End of custom commands"
> 
> ```

---

<div class="post-metadata">

**Author:** ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)\
**Post date:** [January 12, 2021, 6:18am UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/6 "2021-01-12T06:18:44Z")

</div>

> [@trusktr](#):
>
> ` - "templates/sshd.template.yml"`

comment or remove this template and try rebuilding again. this is most probably the culprit.

EDIT:

The error is originating from this line:

> [@trusktr](#):
>
> ` - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'`

You can comment the following line and try again, the error should then disappear

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trusktr/32/116841_2.png) [@trusktr](https://meta.discourse.org/u/trusktr)\
**Post date:** [January 13, 2021, 8:31pm UTC](https://meta.discourse.org/t/launcher-rebuild-app-has-an-error-but-exit-code-is-0/175414/7 "2021-01-13T20:31:36Z")

</div>

> [@itsbhanusharma](#):
>
> The error is originating from this line:

Thank you! Looks like I inherited that from the previous person that ran the instance. Sorry for wasting your time on this issue that turns out not related to Discourse.
