flyctl secrets import issue

Hi there community!
I’ve been trying to import a .env file using flyctl but the process seems to be stuck for some reason.

This is what I’ve been trying:

$ flyctl secrets import .env

My fly.toml looks like this:

app = "*******"

kill_signal = "SIGINT"
kill_timeout = 5

[metrics]
port = 4195
path = "/metrics"

[experimental]
auto_rollback = true

Has anyone encountered a similar issue? Is it a cli bug?

Note: Forgot to mention that setting secrets with flyctl secrets set works just fine.

Hi @mariosant

At which point does the process get stuck? Is there any output?

Do you have any extremely large environment variables? I’m pretty sure there’s a limit to how big they can be. Also, I doubt this would work but try anyway, have you tried specifying the full path to the file?

Thanks for your respond @charsleysa !

It gets stuck right after I run the command. There’s no output at all.

I don’t have any large env vars - they are short enough and only 5-6 in total amount. Specifying the the full path to the file did not work unfortunately.

Not sure if it helps, I am on Linux - nothing fancy, using latest Elementary OS (it’s an Ubuntu derivative).

So it looks like this might be working normally-- fly secrets import takes input from stdin!

I found that explained in the following post, alongside some other really good discussion on declarative configs and other fun stuff:

1 Like

Thanks so much for your response, @eli! Will try this and will respond on this thread in case I need further help!

Maybe worth making this super clear in the cli tool?

I just started using fly.io and had a similar issue/question. I was thinking that secrets could be imported from a file, kinda like kubernetes --from-file (would be a nice feature!).

I’m using cat .fly/secrets.dev | fly secrets import

Make sure to update your .gitignore if you do this and add:

.fly/secrets*