App.yml is giving error (not validating). Where can I get help?

What should I do if a small line in app.yml is proving to be invalid?
Its very first line is proving to be invalid. What are the steps needed to know and rectify the fault?

cd: $home/plugins
cmd:
  - git clone https://github.com/discourse/docker_manager.git
  - git clone https://github.com/discourse/discourse-adplugin.git
  - git clone https://github.com/davidtaylorhq/discourse-telegram-notifications
## Useless now          - git clone https://github.com/discourse/discourse-push-notifications
  - git clone https://github.com/discourse/discourse-chat-integration
  - git clone https://github.com/discourse/new-like-icon
## above is for changing icons. told here: https://meta.discourse.org/t/change-the-like-icon/87748
    - git clone https://github.com/discourse/discourse-sitemap
# for generating sitemap.xml

## 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 couldn’t find anyway in SSH terminal to select all the text of app.yml in one go. Either first half of the screen could be selected>copied or the last.
Is there any command which could select all the text of the file? (At bottom, in the list of shortcuts, it is written ‘M-A’ to mark text. But pressing M and A do nothing except getting typed in the main window).

Your most reliable solution is probably to do something like this:

cd /var/discourse
./launcher stop app
cp containers/app.yml /tmp
grep DISCOURSE containers/app.yml
./discourse-setup

The grep command will give you a list of the settings that you can use
to copy-paste when you run discourse-setup.

grep clone /tmp/app.yml

to get a list of the plugins you think you want.

Then you can

nano containers/app.yml

to add the plugins back.

To add the plugins, you move to the first clone line in the file and copy-paste it. Then you replace the github address in the pasted line. Doing a copy-paste of the plugin line that actually works is the best way to see that you don’t screw up the formatting. It is what I do every single time.

If that doesn’t work, you can pay me to find the problem, which is probably a spurious tab or something that’s at once trivial and impossible to solve. Fix Your Broken Site – Literate Computing, LLC.

4 Likes

When some line of app.yml isn’t validating, isn’t there a way to tell what’s wrong with it?

E…g in my query, the very first line was not validating, i.e. “cd: $home/plugins”
Can we not know what is the wrong here?
I am not asking specifically for this case. I’m asking in general.

I mean, you told me to run the setup again, which I did and problem disappeared. But I was wondering why only single line stops us from fixing the mistake?

Only 1 line of code? Or I am thinking on wrong lines?

Yes. There is a way to fix it. There are yml validators and you can Google ‘yml syntax’ to find hours of reading. And it’s likely just one extra space in one line.

If you have the old file then you can do something like

diff -c oldfile newfile

And see what the differences are.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.