Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Message: Psych::SyntaxError: (/<snip>/config.yml): did not find expected key while parsing a block mapping at line 4 column 1 #870

Closed
caschbre opened this issue Aug 17, 2016 · 7 comments
Labels

Comments

@caschbre
Copy link

Just downloaded the latest DrupalVM today, updated config.yml like I normally do and $ vagrant up gave me the following...

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/caschbre/virtualmachines/voyant/Vagrantfile
Line number: 0
Message: Psych::SyntaxError: (/<snip>/config.yml): did not find expected key while parsing a block mapping at line 4 column 1
@caschbre
Copy link
Author

Hmm... so it looks like my alteration to the cron setup in config.yml was the culprit. Here's what I had changed.

from:
job: "drush -r {{ drupal_core_path }} core-cron"
to
job: "drush -r {{ drupal_core_path }} elysia-cron"

I'm guessing that's just not allowed?

@thom8
Copy link
Collaborator

thom8 commented Aug 17, 2016

@caschbre it's most likely a YAML syntax error, YAML is very fussy about spacing.

@geerlingguy
Copy link
Owner

geerlingguy commented Aug 17, 2016

@caschbre - Are you using tabs at all? YAML doesn't allow tabs to be used anywhere, and will do funny things if you have them (http://www.yaml.org/faq.html)

The job as formatted in your comment looks fine; I'm wondering if you might have your editor set to automatically force tabs. Also, make sure that spacing is correct for each config directive, e.g.

drupalvm_cron_jobs:
  - name: "Drupal Cron"
    minute: "*/30"
    job: "drush -r {{ drupal_core_path }} core-cron"

(there should be four spaces before minute and job, two spaces before the - name line).

@thom8
Copy link
Collaborator

thom8 commented Aug 17, 2016

YAML loves them spaces -- https://www.youtube.com/watch?v=SsoOG6ZeyUI

@kamkejj
Copy link

kamkejj commented Oct 22, 2016

I'm also getting the same error with the Cron Job section uncommented using the default settings

drupalvm_cron_jobs: []
  - name: "Drupal Cron",
    minute: "*/30",
    job: "drush -r {{ drupal_core_path }} core-cron"

Haven't figured out what the correct syntax should be.

@oxyc
Copy link
Collaborator

oxyc commented Oct 22, 2016

You need to remove the empty set [] declaration

drupalvm_cron_jobs:
  - name: "Drupal Cron"
    minute: "*/30"
    job: "drush -r {{ drupal_core_path }} core-cron"

oxyc added a commit to oxyc/drupal-vm that referenced this issue Oct 22, 2016
@oxyc
Copy link
Collaborator

oxyc commented Oct 22, 2016

Also just noticed those trailing commas in the example. That doesn't look like valid yaml.

geerlingguy added a commit that referenced this issue Oct 22, 2016
Followup #870: Fix invalid cron example by removing trailing commas
brandonratz pushed a commit to confcats/drupal-vm that referenced this issue Nov 18, 2016
kekkis pushed a commit to kekkis/drupal-vm that referenced this issue Feb 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants