Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected block end YAML error

Tags:

yaml

When pasting this YAML file into an online yaml parser, I got an expected block end error:

ADDATTEMPTING: 'Tentative d ajout ' ATTEMPTINGTOGIVE: 'Tenter de donner ' ATTEMPTINGTOSET1: 'Tentative de définition ' ATTEMPTINGTOSET2: ' avec ' ALREADYEXISTS: 'Erreur. Package existe déjà’ CANCEL1: 'Annulation...' (...) 

Error

ERROR:  while parsing a block mapping   in "<unicode string>", line 1, column 1:     ADDATTEMPTING: 'Tentative d ajout '     ^ expected <block end>, but found '<scalar>'   in "<unicode string>", line 6, column 11:     CANCEL1: 'Annulation...'               ^ 
like image 603
aman207 Avatar asked Jan 15 '14 17:01

aman207


2 Answers

The line starting ALREADYEXISTS uses as the closing quote, it should be using '. The open quote on the next line (where the error is reported) is seen as the closing quote, and this mix up is causing the error.

like image 156
matt Avatar answered Sep 18 '22 14:09

matt


This error also occurs if you use four-space instead of two-space indentation.

e.g., the following would throw the error:

fields:     - metadata: {}         name: colName         nullable: true 

whereas changing indentation to two-spaces would fix it:

fields:   - metadata: {}     name: colName     nullable: true 
like image 31
Jared Wilber Avatar answered Sep 17 '22 14:09

Jared Wilber