Godfilms
Godfilms

Reputation: 41

YAML Error ERROR: while parsing a block mapping in "<unicode string>",

I have looked everywhere and found no answer, this is my YAML file and this has been bothering me for hours.

The Error

This is my yml filegroups:

  default:
    default: true
    permissions:
    - modifyworld.*
    - modifyworld.chat
    - essentials.afk
    - essentials.home
    - essentials.home.bed
    - essentials.sethome
    - lwc.protect
    - essentials.help
    - essentials.list
    - essentials.motd
    - essentials.rules
    - essentials.spawn
    - essentials.tpaccept
    - essentials.tpdeny
    - essentials.mail
    - essentials.mail.send
    - essentials.balance
    - essentials.msg
    - essentials.ping
    - essentials.balancetop
    - essentials.balance.others
    - essentials.tpahere
    - essentials.tpa
    - essentials.delhome
    - essentials.sethome.multiple.default
    - essentials.chat.url
    - essentials.kit
    - essentials.kits.tools
    - essentials.kits.food
    - essentials.kits.halloween
    - essentials.pay
    - essentials.r
    - essentials.signs.create.protection
    - essentials.signs.create.trade
    - essentials.signs.use.balance
    - essentials.signs.use.buy
    - essentials.signs.disposal
    - essentials.signs.use.kit
    - essentials.signs.use.mail
    - essentials.signs.use.sell
    - essentials.signs.use.trade
    - essentials.signs.use.warp
    - essentials.time
    - essentials.warp
    - essentials.warp.list
    - essentials.spawner.bat
    - essentials.spawner.wolf
    - essentials.spawner.pig
    - essentials.spawner.squid
    - essentials.spawner.creeper
    - essentials.spawner.sheep
    - essentials.spawner.spider
    - essentials.spawner.cavespider
    - essentials.spawner.zombie
    - essentials.spawner.slime
    - essentials.spawner.chicken
    - essentials.spawner.blaze
    - essentials.spawner.skeleton
    - essentials.spawner.enderman
    - essentials.spawner.cow
    - essentials.spawner.magmacube
    - essentials.spawner.pigzombie
    - essentials.spawner.ocelot
    - essentials.spawner
    - essentials.seen
    - essentials.afk.auto
    - usb.island.warp
    - usb.island.topten
    - usb.island.sethome
    - usb.island.create
    - essentials.warps.parkour
    - essentials.warps.jail
    - mcmmo.commands.party.all
    - mcmmo.chat.partychat
    - essentials.ignore
    - auction.bid
    - auction.start
    - auction.cancel
    - auction.end
    - bukkit.command.help
    - bukkit.command.tell
    - mcmmo.commands.mctop
    - mcmmo.ability.herbalism.greenthumb.blocks.smoothbrick
    - mcmmo.ability.herbalism.greenthumb.blocks.dirt
    - mcmmo.ability.herbalism.greenthumb.blocks.cobblewall
    - mcmmo.ability.herbalism.greenthumb.blocks.cobblestone
    - mcmmo.ability.unarmed.disarm
    - mcmmo.ability.unarmed.blockcracker
    - commandrank.password
    - bookrules.info
    - sb.account.bypass
    - sb.use.atm
    - sb.use.money
    - chunkown.limit.4
    - bookrules.get
    - bookrules.list
    - towny.wild.*
    inheritance:
    - null
    options:
       rank: '1000'
       build: true
       suffix: ''
    prefix: '&8&l[&r&7Member&8&l]&7'
  Mod: {}
    prefix: '&2&l[&r&aMod&2&l]&c'
    permissions:
    - essentials.sethome.multiple.mod
    - modifyworld.*
    - essentials.enderchest
    - essentials.workbench
    - essentials.wb
    - usb.island.create
    - essentials.spawner.silverfish
    - essentials.back
    - essentials.warps.*
    - essentials.whois
    - essentials.gc
    - essentials.togglejail.offline
    - essentials.togglejail
    - essentials.jails
    - essentials.seen.extra
    - essentials.seen.banreason
    - essentials.socialspy
    - essentials.mute
    - essentials.invsee
    - bukkit.command.unban.ip
    - bukkit.command.ban.ip
    - bukkit.command.unban.player
    - bukkit.command.ban.player
    - bukkit.command.kick
    - bukkit.command.plugins
    - logblock.tools.tool
    - logblock.tools.toolblock
    - logblock.spawnTools
    - logblock.spawn.Tools
    - logblock.me
    - logblock.tp
    - logblock.rollback
    - logblock.lookup
    - essentials.teleport.timer.bypass
    - essentials.tphere
    - essentials.tp.others
    - essentials.tp
    - chunkown.limit.10
    - essentials.broadcast
    - essentials.unbanip
    - essentials.unban
    - essentials.tempban.offline
    - essentials.tempban
    - essentials.mute.notify
    - essentials.kick.notify
    - essentials.kick
    - essentials.banip
    - essentials.ban.offline
    - essentials.ban.notify
    - essentials.ban
    - mcbans.kick
    - mcbans.lookup.player
    - mcbans.view.staff
    - mcbans.unban
    - mcbans.ban.ip
    - mcbans.ban.temp
    - mcbans.ban.local
    - mcbans.ban.global
    inheritance:
    - default
    options:
      rank: '600'
      build: true
      suffix: ''
  Mod+: {}
    prefix: '&2&l[&r&aMod&2+&l]&r&c'
    permissions:
    - essentials.sethome.multiple.mod+
    - essentials.whois
    - towny.claimed.*
    - essentials.suicide
    - essentials.gc
    - essentials.togglejail.offline
    - essentials.togglejail
    - essentials.setjail
    - essentials.deljail
    - essentials.jails
    - essentials.weather
    - essentials.fly.safelogin
    - lwc.admin
    - permissions.user.demote.*
    - permissions.user.promote.*
    - modifyworld.*
    - commandrank.password
    - essentials.fly
    inheritance:
    - mod
    options:
      rank: '500'
      build: true
      suffix: ''
  Admin: {}
    prefix: '&c&l[&r&4Admin&c&l]&c'
    permissions:
    - '*'
  Owner:
    default: false
    prefix: '&c&l[&r&4Owner&c&l]&c'
    permissions:
    - '*'
    inheritance:
    - admin
    options:
      rank: 1
      build: true
      suffix: '&f'
users:
  Godfilms_:
    group:
    - Owner

Upvotes: 1

Views: 9724

Answers (2)

Akshay Vijay Jain
Akshay Vijay Jain

Reputation: 15945

Please use following website to correct errors and prettify YAML.

https://onlineyamltools.com/validate-yaml

Upvotes: 2

Anthon
Anthon

Reputation: 76599

You shouldn't look everywhere, you should just look at your file and reduce in a few steps, while retaining the error to end up with the following two lines:

  Mod+: {}
    prefix: '&2&l[&r&aMod&2+&l]&r&c'

Those two will still give you the error. Please note that it is not the first key prefix in you example that causes the error, it has a different value)

On the first line you have mapping key Mod+ with as value an empty mapping {} (YAML can only include empty mappings using flow style).

So you have to ask yourself what you have on the second line, which is indented relative to the first line, as if it is supposed to be a value for some non-existing key.

Without knowing your program, there is an infinite way on how to solve this. It could be that the second line should not be outdented:

  Mod: {}
  prefix: '&2&l[&r&aMod&2&l]&c'

Or that the empty mapping should not be inserted there:

  Mod:
    prefix: '&2&l[&r&aMod&2&l]&c'

Or that the empty mapping is actually a key itself, the beginning of a mapping (less likely as there are some YAML loaders that can parse, but not construct this).

  Mod:
   {}
    prefix: '&2&l[&r&aMod&2&l]&c'

If you have some data structure that you try to load from YAML, I recommend that you construct it programmatically (without loading YAML), i.e. just by assigning values, created the equivalent of mappings and sequences in the programming language you use, and then dump that data structure. That will show you clearly what the layout in your YAML file will be.

Upvotes: 2

Related Questions