Question

Error when trying to start discourse could not find expected while scanning a simple key

Below is the error I am getting. I’ve manually installed lighttpd, which removed that error and manually installed rails but I still get this. I haven’t found much out there so i hope i’m not overlooking something simple. Thanks:

Please press enter when you are read to configure discourse.

Enter the email address to use for the Discourse admin account (ex. user@example.org) noreply@mg.thetines.org Enter the domain or subdomain pointed to this Discourse instance (ex. forum.example.org): www.thetines.org Enter the SMTP server to use to send email (ex: smtp.example.org): smtp.mailgun.org SMTP Port (default 587): SMTP Username (ex. user@example.org): postmaster@mg.thetines.org SMTP Password: Thanks! Your Discourse instance is now being configured…this can take a few minutes…

Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install… Executing /lib/systemd/systemd-sysv-install enable docker

(<unknown>): could not find expected ‘:’ while scanning a simple key at line 63 column 1 -e LANG=en_US.UTF-8 YAML syntax error. Please check your containers/*.yml config files. Error response from daemon: No such container: rails

Discourse has now been configured. You may now finish setting up Discourse by creating an account at:


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
July 31, 2023

Heya,

The error message you encountered indicates a YAML syntax error in one of the configuration files for Discourse. YAML is a data serialization language used for configuration files, and the error you see often occurs when there is a mistake in the formatting.

To resolve this issue, follow these steps:

  1. Open the file where the error is occurring: /var/discourse/containers/app.yml.

  2. Check the syntax carefully, especially around the line specified in the error message (line 63). Ensure that all indentation, colons, and other special characters are correct. YAML is sensitive to indentation, and even a single space can lead to syntax errors.

  3. Double-check for any missing colons, extra spaces, or incorrect indentation in the configuration file. Make sure each key-value pair has a colon and that the indentation is consistent.

  4. Save the changes to the file after correcting any errors.

  5. After fixing the YAML syntax, try running the Discourse configuration command again:

cd /var/discourse
./discourse-setup
  1. Follow the prompts and provide the necessary information as requested during the setup.

If there are other configuration files involved (such as web_only.yml, etc.), you may need to check those as well for any syntax errors.

After successfully configuring Discourse, it should run without any issues. If you encounter any additional errors, carefully review the error messages and logs for clues about the problem.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel