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?
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.
i tried to delete the corrupted yaml file but it said it was not found
PS C:\Users\alial\Desktop\Software\project1-Ali-Alsaedi> remove-item ~/.fly/config.yaml
remove-item : Cannot find path ‘C:\Users\alial.fly\config.yaml’ because it does not exist.
At line:1 char:1