Formatting issues adding plugins to app.yml

Hello, I have been a discourse user since yesterday, using the given code I have not been able to install the plugin since it always says the following error:

(): did not find expected key while parsing a block mapping at line 10 column 1 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.

However, I have managed to install at least 1 plugins, using this code to the right of the first base code

&& sudo -E -u discourse git clone GitHub - discourse/discourse-solved: Allow accepted answers on topics

But then I can’t install more because that error always appears.

It should be noted that my installation is in the Spanish language, I tried changing en_US to es_ES but the problem was not solved either.

1 Like

Could you share a snippet of your after_code block? yaml is very sensitive to spacing, and you might have accidentally indented a line that shouldn’t have been.

4 Likes

As Fireup suggested, ensure you did not add or remove extra spaces for the indentation.

You can use a tool like https://yamlchecker.com/ to check if everything is correct. :+1:

2 Likes

This

Your line should be at the same indentation level as the one above. For example:

      cmd:
         - git clone...
         - git clone...
5 Likes

hey friend, thank you very much. With that site I have been able to solve the problem, that website will definitely be my best friend from now on. :grin:

4 Likes

Now after compiling, it gives me this error at the end

From this picture that you previously posted:

You would also want to follow the format of the first original line, as mentioned here:

So yours would probably need to look like this:


hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-akismet.git
          - git clone https://github.com/discourse/discourse-whos-online.git

4 Likes

just wanted to add on to this topic, if you are using VS Code, I highly recommend installing the Extension called indent-rainbow

Name: indent-rainbow
Id: oderwat.indent-rainbow
Description: Makes indentation easier to read
Version: 8.3.1
Publisher: oderwat
VS Marketplace Link: indent-rainbow - Visual Studio Marketplace

Looks like this

makes it MUCH easier to see the indentation in your YAML file. In VS Code also you should use the shortcut keys such as Cmd + [ or Cmd + ] to increase or decrease indents.

oh also forgot to mention, turn on visible whitespace as well, thats the little grey dots you can see in the screenshot

2 Likes