YAML Error while parsing a block mapping & xpected <block end>, but found Anchor

Discussion in 'Bukkit Help' started by AkBKukU, Apr 2, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    AkBKukU

    I'm trying to use Death Notifier and I can't get it too load my config. I found dozens of threads with this error in permissions but none of them helped me.

    My config.yml
    Code:
    ## Available Tags:
    # %player = The player
    # %opponent = PVP Opponent
    # %weapon = weapon person was killed with, only available in PvP.
     
    # You can add unlimited items to each node. Messages are randomly chosen from that li
     
    # Why do we have PVPFist and PVPWeapon? because, grammatically, it is difficult to ma
    # "fist" work with messages that include weapons
     
    # This requires CraftIRC 3.1
    report-to-irc: true
     
    # If true, all items and blocks will be named
    # If false, all items apart from weapons will be called 'Fists'
    enable-all-names: true
     
    PVPFist:
    - "&9%opponent &fbeat &2%player &fto a pulp&f."
    - "&9%opponent &fslapped &2%player &faround a bit too hard&f."
    - "&9%opponent &fjust laid a beat down on &2%player&f."
    - "&9%opponent &fand &2%player's sparring match went to far&f."
    PVPWeapon:
    - "&2%player &fwas killed with a &C%weapon &fby &9%opponent&f!"
    - "&2%player &fgot beat to a pulp by &9%opponent &fwho was holding a &C%weapon&f!"
    - "&9%opponent &ffound a &C%weapon &fto be suitable for dispatching &2%player&f."
    - "&9%opponent &fshowed &2%player &fthe cold release of death&f."
    PVPBow:
    - "&9%opponent &fshot &2%player &fin the knee."
    - "&9%opponent &fended the adventure of &2%player&f."
    - "&2%player &fwas target practice for &9%opponent&f."
    PVPWolf:
    - "&2%player &fgot ripped to shreds by &9%opponent%'s &CWolf&f!"
    - "&2%player &fgot his ankles chewed off by &9%opponent%'s &CWolf&f!"
    - "&2%player &flooked juciy to &9%opponent's &CWolf!"
    Wolf:
    - "&2%player &fgot slaughtered by a &CWolf&f!"
    - "&2%player &fbecame lunch for a hungry &CWolf&f!"
    Skeleton:
    - "&2%player &fwas out adventuring, much like yourself.. and then he took an arrow to the knee."
    - "&2%player &fjust got snipe'd by a &CSkeleton&f!"
    - "&2%player &fis now rushing for their loot, thanks a lot &CSkeleton&f."
    Spider:
    - "&2%player &fgot munched on by a &CSpider&f&f!"
    - "&2%player &fdid not receive fantastic powers from their &CSpider &fbite."
    CaveSpider:
    - "&2%player &fgot poisoned by a &CCave Spider&f. Gave up the ghost."
    - "&2%player &fwas out treasure hunting but ended up as lunch for a &CCave Spider&f."
    Creeper:
    - "&2%player &fwas blown to bits by a &CCreepy Creeping Creeper&f!"
    - "&fHugging &CCreepers &fis not recommended, &2%player&f. Remember that next time."
    Silverfish:
    - "&2%player &fjust got killed by an ankle-biting &CSilverfish&f. How pathetic."
    Zombie:
    - "&2%player &flost their mind to a &CZombie&f!"
    - "&2%player &fbecame breakfast for a hungry &CZombie&f!"
    Giant:
    - "&9%opponent &fended the adventure of &2%player&f."
    PVPWolf:
    - "&2%player &fgot ripped to shreds by &9%opponent%'s &CWolf&f!"
    - "&2%player &fgot his ankles chewed off by &9%opponent%'s &CWolf&f!"
    Wolf:
    - "&2%player &fgot slaughtered by a &CWolf&f!"
    - "&2%player &fbecame lunch for a hungry &CWolf&f!"
    - "&fWolf: NOM NOM NOM &2%player&f: X("
    Skeleton:
    - "&2%player &fwas out adventuring, much like yourself.. and then he took an arrow to$
    - "&2%player &fjust got snipe'd by a &CSkeleton&f!"
    Spider:
    - "&2%player &fgot munched on by a &CSpider&f&f!"
    CaveSpider:
    - "&2%player &fgot poisoned by a &CCave Spider&f. Gave up the ghost."
    - "&2%player &fwas out treasure hunting but ended up as lunch for a &CCave Spider&f."
    Creeper:
    - "&2%player &fwas blown to bits by a &CCreepy Creeping Creeper&f!"
    - "&fHugging &CCreepers &fis not recommended, &2%player&f. Remember that next time."
    - "&2%player &fmade a little green buddy."
    - "&f there is a new crater thanks to &2%player&f."
    Silverfish:
    - "&2%player &fjust got killed by an ankle-biting &CSilverfish&f. How pathetic."
    Zombie:
    - "&2%player &flost their mind to a &CZombie&f!"
    - "&2%player &fbecame breakfast for a hungry &CZombie&f!"
    - "&fZombie: Ima poke u! &2%player&f: AAAAaaaahhhhh..... .  ."
    Giant:
    - "&2%player &fjust got stomped on by a &CGiant&f!"
    - "&2%player &fis now a waffle."
    Ghast:
    - "&2%player &fgot &Cfireball'd &fby a &CGhast&f!"
    - "&2%player &fgot gibbed by a &CGhast&f!"
    PigZombie:
    - "&2%player &flost their mind to a &CPig Zombie&f!"
    - "&2%player &fangered the &CPig Zombies&f!"
    Blaze:
    - "&2%player &fwas set ablaze by a &CBlaze&f."
    - "&2%player &fis smokin'. Needs to avoid the &CBlaze&f."
    Slime:
    - "&2%player &fjust got &CSlimed&f!"
    - "&2%player &fdiscovered that &CSlime &fis not something you wear&."
    MagmaCube:
    - "&2%player &fjust got splattered with &Chot magma&f."
    - "&2%player &fintroduced theirself to the kind and gentle &CMagma Cube. &fSince you are seeing this message, it wasn't terribly kind nor gentle."
    Enderman:
    - "&2%player's &flife got ended by an &CEnderman&f."
    - "&2%player &fgot griefed by an &CEnderman. &fThen killed by said &CEnderman&f."
    EnderDragon:
    - "&2%player &fmet with the lord of the End. The End."
    - "&2%player &ftried to steal &CHerobrine's &fsweet ride. Turned into lunch."
    - "&2%player &freached their final chapter."
    - "&2%player &ftry to put out the pillars!"
    Dispenser:
    - "&2%player &fdid not see the &CDispenser &fand is now full of holes."
    TNT:
    - "&2%player &fwas blown to bits by a pile of &CTNT&f!"
    - "&2%player &ftried to launch himself into orbit using &CTNT&f. Result: &CFailure&f!"
    Lava:
    - "&2%player &fhad hoped to take a warm bath. Didn't realize said bath was filled with &Clava&f."
    - "&2%player &fis now expressing great remorse over the loss of an inventory. &b#Lavaisbad"
    - "&2%player &f thought they were part Zombiepigman."
    Fire:
    - "&2%player &fdied in a &Cfire&f!"
    - "&2%player &fhas a new, slightly charred look!"
    - "&2%player &&flearned, fire bad."
    Fall:
    - "&fThat first step is a real doozy. &2%player &fis a real mess now."
    - "&fSkydiving without a parachute again, &2%player&f?"
    - "&2%player &fis now more pancake than man&f."
    - "&2%player &fwondered if the ground would be friends with them&f."
    - "&2%player &ftook a trip and had a great fall."
    - "&2%player &fremembered about falling."
    Suffocate:
    - "&2%player &fforgot that breathing is necessary for the maintenance of life. He is no longer with us."
    - "&2%player &fsuccessfully held his breath until he died! I think we need a new definition for 'success'."
    Drowning:
    - "&2%player &fmade sounds somewhat similar to, 'gurgle, gurgle, splurt, sputter', before sinking into the darkness."
    - "&2%player &fis now hanging out with Davey Jones. In his locker. Creepy."
    - "&2%player &fattempted to grow gills."
    Cactus:
    - "&2%player discovered that mounting ones' self upon a &Ccactus &fcan be rather uncomfortable. In fact, it can lead to death. As it did in this case."
    - "&2%player &fmistook the cactus for a creeper. Went in for a hug. &CCactus &fwon."
    Lightning:
    - "&2Zeus &fgot ticked off at &2%player &fand gave him a shocking revelation."
    - "&2%player &fjust had a rather &Cshocking &fexperience."
    - "&2Zeus &f was tired of &2%player's insolence."
    Void:
    - "&2%player &ffound the &Cvoid&f."
    - "&fYou need to avoid the &Cvoid&f, &2%player&f."
    Suicide:
    - "&2%player &fwas feeling &Cforeveralone.jpg &fand slayed himself most brutally."
    - "&2%player &fdiscovered &CHerobrine's realm&f. It did not end well."
    Starve:
    - "&2%player &fstarved."
    - "&2%player &fdieted a bit too much."
    - "&2%player &ffailed to nom.
    Unknown:
    - "&2%player &fwas killed for no reason."
    - "&2%player &fwas there and then they weren't."
    
    Console Output Relevant to Error
    Code:
    [SEVERE] Cannot load plugins/DeathNotifier/config.yml
    org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping
    in "<string>", line 12, column 1:
        report-to-irc: true
        ^
    expected <block end>, but found Anchor
    in "<string>", line 68, column 4:
        - "&2%player &fjust got snipe'd by  ...
    

    http://yaml-online-parser.appspot.com/ Output
    Code:
    ERROR:
     
    while parsing a block mapping
      in "<unicode string>", line 13, column 1:
        report-to-irc: true
        ^
    expected <block end>, but found '<anchor>'
      in "<unicode string>", line 69, column 4:
        - "&2%player &fjust got snipe'd by  ... 
     
  2. Offline

    ZeroZX4

    http://pastebin.com/NU0pTdT4

    after u realize it works bless this post with me

    [​IMG]


    lines with missing marks

    Skeleton:
    - "&2%player &fwas out adventuring, much like yourself.. and then he took an arrow to$"
    Starve:
    - "&2%player &fstarved."
    - "&2%player &fdieted a bit too much."
    - "&2%player &ffailed to nom."
     
    AkBKukU likes this.
  3. Offline

    AkBKukU

    *Blessed*

    Thank you so much! I feel ashamed it was something so trivial. Did you look through the whole document to find those or is there some mystic meaning to the errors that I was missing?
     
  4. Offline

    Sayshal

    Here is how he (and I) figured it out:
    Basically if you look at the last line, if it were complete it wouldv'e shown:
    - "&2%player &fjust got snipe'd by ..."
    NOT
    - "&2%player &fjust got snipe'd by ...

    notice the ' " ' at the end. Also, block end in a string is usually a ' " '.
     
  5. Offline

    ZeroZX4

    loook lets say this is ur file in lines


    11111111
    22222222
    333333
    444
    5555555
    66666666666
    77
    888888
    9999


    and so i from top select some part of lines and paste them to parser

    11111111
    22222222
    333333

    ok so this was working so i add more

    11111111
    22222222
    333333
    444
    5555555
    66666666666

    and that works too so i just add more lines untill i found out that after adding this

    Skeleton:
    - "&2%player &fwas out adventuring, much like yourself.. and then he took an arrow to$

    there was an error and i was wondering why and than i notice that on end u miss " mark so i just add this to check if it helps

    and it does so i just continue to check rest of ur yml



    [​IMG]


    lies case im so extremely annoying i found easier way

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  6. Offline

    Sayshal

    Your way looks like it's written by a 3 year old. I'm trying to supply concrete, researched information, as well as tips, on how this problem can be avoided in the future. Yes, staring at the file for 5 minutes to 8 hours can solve your problems eventually, but if you look at the error and think a bit, it tells you exactly what's wrong. There was a misplaced/missing block end (quotation mark) on line X and column Y. A lot easier to debug then "just add a bunch of numbers until you have an epiphany!"
     
  7. Offline

    AkBKukU

    Thank you for the methods behind the madness. I will definitely try both of those next time. I'll remember most to do all of my yaml writing in a parser so I can get instant notification!
     
  8. Offline

    ZeroZX4

    problem is most ppl dont understand what errors say most of us just see errors

    i only understand \t cause i know that is tab but all other yml errors r magic for me

    so i prefer to teach others how to find any yml problem

    simple
     
  9. Offline

    fenukottero

    Hello dude can you help me?
    This is my permissions file: http://pastebin.com/TXkh7z3F
    And there are 2 errors! Can you help me? :p

    Output

    ERROR:

    while parsing a block mapping
    in "<unicode string>", line 2, column 3:
    default:
    ^
    expected <block end>, but found '<block sequence start>'
    in "<unicode string>", line 261, column 4:
    - dynmap.webchat
    ^
     
Thread Status:
Not open for further replies.

Share This Page