Did not find expected '-' indicator in app.yml

Hi Everyone,

I just try to rebuild the app and I get this error:

(<unknown>): did not find expected '-' indicator while parsing a block collection at line 11 column 3 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.

Line 11 in my app.yml

- "templates/cron.template.yml"

I need some help to fix it. Thank You :angel:

Perhaps you have a tab rather than a space?

There are yaml checkers on the net. You will need to be able to copy and paste rather than take a picture.

What changes did you make?

Looks to me like the ratelimited and socketed lines have one too many spaces in front. They should have the same number of spaces as the 5 templates above, not the 2 commented out templates.

6 Likes
## 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

templates:
  - "templates/cron.template.yml"
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/sshd.template.yml"
  - "templates/web.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"
   - "templates/web.ratelimited.template.yml"
   - "templates/web.socketed.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:
 # - "443:443" # https
 # - "80:80" # http
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: "2048MB"

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

Hi again,

Even I moved the line 11:
- "templates/cron.template.yml"

I get the error on the same line, 11 col 3 where now is

- "templates/postgres.template.yml" This line was there.

Thank You! :slight_smile: That fix the issue. I was still looking at the line 11.

You have an extra space or two In front of the - on the ratelimited and socketed lines it doesnt line up with the above section. Also as mentioned above ensure that only spaces not tabs are used.

https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html#spaces-vs-tabs

2 Likes

This topic was automatically closed after 30 hours. New replies are no longer allowed.