Score:0

Why am I getting error: `found a tab character that violate indentation` in my Netplan YAML file?

lt flag

I am getting the following error when trying to do sudo netplan apply:

Invalid YAML at //etc/netplan/lan-segment.yaml line 11 column 0: found a tab character that violate indentation

This happened after modifying a copy of the original file to set a static IP to the Network adaptor as follows:

network:
    ethernets:
        ens33:
            addresses: []
            dhcp4: true
            optional: true
        ens38:
            addresses: [10.0.0.200/24]
            dhcp4: false
    version: 2

Screen shot of YAML config file

Score:1
do flag

The syntax of Netplan YAML files are very particular. You're not allowed to use tab characters. Instead, you have to use space characters only. So your error indicates that there is a tab on line 11.

I think your screen grab showing your YAML file is cut off at the top. But line 11 looks like it's probably the line with version: 2. So that's probably where the error is. So check line 11. Make sure you don't have any tab characters and you're only using space characters.

Here's a link to the YAML Configuration.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.