I apparently bricked Fly on my PC

So recently when I run ANY fly command, I get the following error:

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

The only thing that I have done that maybe out of the ordinary is that I shutdown a deploy while it was in the midst of deploying.

I have tried reinstalling but it didn’t help. Any ideas?

I think your fly.toml file is invalid. Are you able to edit it and delete any weird (non-ascii) characters? You could also try deleting fly.toml and running fly config save -a <app name> to recreate it.

I haven’t touched the fly.toml and the problem is persistent on all apps. I tried fly config save -a <app name> but sadly it didn’t work.

The problem might also be with ~/.fly/config.yml. Try deleting that file (or renaming it to keep a backup). You’ll probably have to run fly auth login again.

I think that seems to be the problem! ~/.fly/config.yml is none existent. I don’t have an inkling on a idea how it got “deleted”…

But I have tried lots of things, including reinstalling multiple times and the issue still persists, I kinda stumped with this one.

Running fly auth login should bring back that file. Can you try that?

unfortunately ALL fly commands are bricked

What does fly auth login output?

If nothing is working, the best solution I have for you is to remove ~/.fly in its entirety. You’ll have to re-login to the CLI, but that should get you running again.

Really sorry for the frustrating experience, I hope this helps

the same error:

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

The whole directory ~/.fly doesn’t exist! I am confused as to how do I even begin to debug this, every command I try gives the same error:

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

According to Error yaml: control characters are not allowed - #7 by pekac45 and .fly/config.yml corrupted on Windows (control characters not allowed) · Issue #908 · superfly/flyctl · GitHub, deleting that ~/.fly directory and fly auth login should resolve your issue. Not sure why you’re still getting that error if that directory doesn’t exist.

My only guess is, that directory still exists, but whatever ui you’re on isn’t showing it. Can you run rm -rf ~/.fly (or the equivalent for your OS) and try again?

the next angle we can take is to run some (any) flyctl command with debug logging enabled.
this should at least give you some debug output so that you can see what’s going on behind the scenes

Windows:

cmd /C "set LOG_LEVEL=debug && flyctl apps list"

Linux/macOS:

LOG_LEVEL=debug flyctl apps list

Thanks for your answer but weirdly enough this also returns the now infamous error:

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

Just to make sure, what version of flyctl are you running?

afaik, any run of flyctl loads that config file. so you’ll have to find a way to fix it without invoking flyctl. (else you’re going to keep seeing that same error)

This fixed it! for some reason, windows decided to completely bamboozle us and not view the folder (I enable view hidden folders/files by default). So essentially windows didn’t want me to see that the folder existed at all.

Turns out Windows 11 is a mess, who would’ve thought. the ~/.fly directory existed after all but Windows was too shy show it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.