My forum goes down when I do launcher rebuild app

hello there,
my forum goes down every time i do ./launcher rebuild app.
I have attached screen shot of what error it gives.

If I’m understanding correctly, the error message says that there is a problem on line 9.

Try typing this command:

cat -n containers/app.yml

That will print out the contents of the file with line numbers, and you can check line 9 for syntax errors.

It would probably be a good idea to run that chmod command mentioned in the output too, though it isn’t related to the error.

2 Likes

Well, nano -l is much easier way to find right line and fix it right away :wink:

If you haven’t change too much app.yml line 9 is just before templates: — can there be something strange as extra whitespace?

But one thing I’ve learned about YAML is there can be a whitespace almost anywhere, missing space, missing quote or wrong type - and error is pointing to wrong place.

I would say it is easier delete app.yml and do setup again.

1 Like

I have removed that line 9 items completely but still it says line 9 is syntax error.

how do i delete and rebuild it ?

I would first do backup, if there is some content. And after that:

cd /var/discourse
mv containers/app.yml .
./discourse-setup

is that gonna delete my forum data ? like posts and users and all that ?

No. But that’s why you have done full backup first.

But you can give a try for this too:

i have tried to validate YAML validation it says it all ok

i think its a glitch

Something it is.

But you can copy&paste your app.yml here as it is. Then someone wiser could take a look. Because now no one knows what there is or is not.

1 Like

Can you share your full app.yml without secure informations (passwords etc…)?


## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
hooks:  after_code:    - exec:        cd: $home/plugins        cmd:          - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git          - sudo -E -u discourse git coe tp/gtu.c/dcusedcu-pile-rti
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
  - "80:80"   # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "256MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed
  ## Maximum upload size (default: 900m)
  upload_size: 900m

env:
  # DISCOURSE_DEFAULT_LOCALE: en  
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8  

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  UNICORN_WORKERS: 4

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.
  DISCOURSE_HOSTNAME: 

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")
  #DOCKER_USE_HOSTNAME: true

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: ''

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: ###
  DISCOURSE_SMTP_PASSWORD: "##-07e2c238-419aaa92"
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: 
  DISCOURSE_NOTIFICATION_EMAIL: 

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com
  
  ## The maxmind geolocation IP address key for IP address lookup
  ## see https://meta.discourse.org/t/-/137387/23 for details
  #DISCOURSE_MAXMIND_LICENSE_KEY: ##

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"

I think this shouldn’t be the beginning of the file:
hooks: after_code: - exec: cd: $home/plugins cmd: - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git - sudo -E -u discourse git coe tp/gtu.c/dcusedcu-pile-rti

And there are two missing lines under LANG: en_US.UTF-8 line.

LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en

Maybe there are more I didn’t notice but here is the default file and you can compare.

Very first actual line starting hooks: can’t be right. It should be something like

hooks:
  after_assets_precompile:
    - exec:
        cd: $home
        cmd:
          - sudo -E -u discourse bundle exec rake s3:upload_assets
          - sudo -E -u discourse bundle exec rake posts:rebake
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

Well, not exacly like that because this is from mine, but lines, intends etc should be similar.

1 Like

You overrun me :rofl:

What do you think — would new ./discourse-setup be the fastest and easiest way to fix that mess?