config
config copied to clipboard
YAML error: found character that cannot start any token
Maybe I'm doing something wrong, but when I parse this file:
smtp:
port: 25
host: smtp.mail.com
username: johndoe
password: secretpassword
with
config.ParseYaml(configData)
I get
YAML error: line 1: found character that cannot start any token
Check if you are using tabs for indentation. YAML doesn't allow tabs; it requires spaces.
This is a year late, but... thank you moraes, you solved my issue. :)
Mine too ;)
Doh
Glad I'm not the only one here overlooking simple things, thanks @moraes
So helpful.
Looks like YAML syntax should be reconsidered..
:+1:
And I wondered whole fu**ing day why does Vim replace tabs with spaces when I edit yaml... :D
Thanks
Thanks. 👍
Thanks a lot! Took me half a day to resolve this issue.
Simple but strong. Helped me too.
it helped me as well :)
it helps me too
found character '' that cannot start any token -
pwd`/auth:/usr/local/apache2/conf
Thanks
ahah yup! one more! thanks man :)
thanks!!
me too~ thanks
thanks!!
Thank you
Thank you, savior.
Big thx) -
Thanks much. :)
And my axe! Solved my issue!
thanks!
Same here. Thanks If you use VIM,
set list
set listchars=tab:>-
will find those busters
Had the same problem with menus. Was using tabs (as per the video I was watching). Changing to spaces solved it. Thank you.
Thanks a lot !
A great day must be remembered!!! Thank you!
Thanks so much!!!! I've spent too much time on finding any spelling error T_T
I have just used 4 space to indent got the same error. Please guide me where I am wrong.
@Akash187 you sure it's spaces, maybe your editor does some smartness on save etc? if your unsure have a look with hexdump -C
etc
thanks a lot! saved a lot of time.
Thanks a lot @moraes
+1 for the Thanks a lot section :grinning:
+1 for the Thanks a lot
+1 Thanks !!!
+1 Thanks a lot, :)
Thanks!!!
5 years later and moares comment saved my ass.
Saved my day... 5yrs later
Thank you so so much.
Found this when trying to config a bond network interface under Ubuntu 18.04 for HOURS! yaml and netplan SUCK!! The old plain style in /etc/network/interfaces
worked for decades, and now we all need something new? What a waste of lifetime!
Damn. Thank you so much man. Cheers. :smile:
Yup, still useful knowledge.
@Akash187 you sure it's spaces, maybe your editor does some smartness on save etc? if your unsure have a look with
hexdump -C
etc
Thank you @Akash187 Your comment saved me a lot of pain. Nano left some tabs below where I was editing, flushed it, cleaned it, and it's now working!
Mine too ;)
我也是,就是tab缩进的问题
great!
few years later... :) Big Thanks.. @moraes ...... I scratched my head for hours over this one, because I explicitly set my editor for tab == 2 spaces, never thought that could be a problem hehe
Watch for trailing lines at the end of the file - a tab there breaks things too
Tried removing the space but still got the same error.
Deleted the file and created a new one with same stuff ... worked for me.
Added for reference :)
Came here for the same issue on a totally unrelated project and this saved my day: thanks @moraes!
find tabs across all yaml files in current dir recursively :
grep -rn --include=*.{yaml,yml} "\t" ./
Thank you.
Thank you!
Check if you are using tabs for indentation. YAML doesn't allow tabs; it requires spaces.
6 years after your answer, you solved my issue. Thank you
@moraes Greatly appreciated! @nemanjan00 weird, cause my Vim didn't do it, and that's how I ended up here :)
Sounds like you need to take a look at my dotfiles
@nemanjan00 actually not. I wrote a Vim plugin for myself a while ago and forgot the nuances of what exactly it does. Turns out, among other things it replaces spaces with hard tabs, and I forgot it does. So it either undoes what Vim does by default or just overrides it.
Anyways, your config is really nice, especially the bottom stripe, it's much more informative than the one I got. Thank you for sharing it!
5 Years later still helping people (myself included) !
Thanks :)
@moraes it seems to me that tab is actually an valid character in yaml by the spec https://yaml.org/spec/1.2/spec.html , see section 5.5. White Space Characters
Lol this is such a great post, I had no idea why my site wasn't rendering and I just re wrote it! I made sure there were no tabs and it worked! 6.5 years later still relevant!
@moraes Dude you are awesome
@moraes Thanks man /| Never too late :)
@moraes one more lol thanks
@moraes thx from 2020 :)
thanks!
I'm going to unsubscribe this issue. My email inbox is already full. hahahaha
thanks!
Thank you!!!!!
@moraes Thank you very much, while googling I got this link, I was struck with this from last 2 days, With your one line comment i solved my issues in deployment file, Application running in AKS now, Thank you very much, Great information never gets older:)
This issue cost me for an hour!
Thank you!!! I feel better now!
Well, I had a problem with a variable containing @
character at the start. Fixed by | quote
Cheers bud
7 years after your answer, you saved my time. Thank you
works for me, thanks!!!
Thank you, I had some evil tabs. You saved me a lot of hair-pulling.
@moraes, Dude, Thank you. Saved my day!.
Thanks !!! Solved my headache
Same here. Thanks If you use VIM,
set list set listchars=tab:>-
will find those busters
Thanks !
Nano users don't have this problem, because mixed tabs/spaces show in red. But they have other problems.
Solved my issue too !! thanks
Thank you!
Thank you!!
This is madness!
Check if you are using tabs for indentation. YAML doesn't allow tabs; it requires spaces.
This post is the defacto google answer for that error. Thanks for that. Besides that, if the error message has gotten a little bit more love, we could all saved 5 mins of our life :D
This helped me a lot. Thank you!
I don't know how but a wild tab appeard in the config.
Thanks
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Thank you .. saved my day
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Best answer ever! :)
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
9 years later: Here I am, saying thank you as well :D
Yep, happened to me today. Thank you.