Error yaml: control characters are not allowed

When I try to do anything, I get command

Error loading config While parsing config: yaml: control characters are not allowed
Error yaml: control characters are not allowed

However, everything was working fine earlier today. Anyone else experienced this error? It’s on any command, flyctl deploy, doctor…

I have not touched fly.toml. It happens on 2 different apps.

Strange.

Assuming there is indeed no white space in them causing it (you could double-heck with a validator like Best YAML Validator Online) it may be worth restarting the Fly agent to see if that helps? I had some (different) errors just now and doing that fixed it for me. Can’t hurt.

e.g

$ fly doctor
Testing authentication token... PASSED
Testing flyctl agent... FAILED
(Error: couldn't ping agent: dial unix /path/.fly/fly-agent.sock: connect: no such file or directory)

Can't communicate with flyctl's background agent.

Run 'flyctl agent restart'.

$ flyctl agent restart

$ fly doctor
Testing authentication token... PASSED
Testing flyctl agent... PASSED
Testing local Docker instance... Nope
Pinging WireGuard gateway (give us a sec)... PASSED
PS C:\Users\MonW> flyctl agent restart
Error loading config While parsing config: yaml: control characters are not allowed
Error yaml: control characters are not allowed

Still the same error. I’ll try completely reinstalling flyctl and see if that changes

This means there’s a weird character in ~/.fly/config.yml. We’ve seen this reported once before, but we don’t know how it got there. You can delete that file and get going again.

Are you sharing your home directory between Windows and WSL by chance?

No, I don’t have WSL installed on the machine, so unless some other program added it as a dependency, it shouldn’t be there.

When I try to open config.yml it’s only �������������������� as a binary file and not a yml file.

Should I just delete and start over?

Yes go ahead and delete it. I just created a bug report here: .fly/config.yml corrupted on Windows (control characters not allowed) · Issue #908 · superfly/flyctl · GitHub

OK I have ended up moving the broken config.yml file out of the folder and running flyctl command. That prompted me to auth again and after logging in, it created a new config with login information.

That allowed me to redeploy the app.

Many thanks