Error with fly postgres attach command

I have an issue while using fly postgres attach.

My steps are

  • created a new elixir app
  • created a new postgres app
  • attach postgres app to my elixir app.
  • got some errors

my solution is to repeat the command until it is successful. :joy:

I’m not sure it related with Unable to attach database to app w/ "Unknown Error" - #22 by shaun

1 Like

That’s strange, are there any notable errors within your Postgres logs?


Just saw the error at the very top of the screenshot regarding the tunnel issue. What region are you deploying in?

Oh, sorry that I didn’t check for a Postgres log at the time I’m using fly postgres attach command.

I deployed to the Singapore region for both elixir and Postgres apps.

my colleague also experienced this issue a few days ago when they attach new Postgres to the new elixir app also.

May be it related to Singapore region? :thinking:

I’m seeing the same thing for my test-app in Frankfurt :confused:

fly postgres attach --postgres-app pg-dev-test
Running flyadmin user-list
Running flyadmin user-create
Running flyadmin grant-access
Error unexpected end of JSON 

@Hannes_Nevalainen Are you finding that this is an intermittent issue? Or is it happening consistently?

I retried it a few times, then I found this thread which suggested I should try some more… and now it worked. So yes, I would call it intermittent :slight_smile:

I also ran into this issue a couple of times deploying to the Chennai region. Succeeded on the third try.

I want to use very much indeed. However it keeps making my life miserable, right now I hit this very issue in Frankfurt and London. Should I keep on trying in all the regions?

it worked in Madrid

You’re running fly pg attach and it’s failing? Can you paste the output you’re seeing when you run it?

$ flyctl pg attach --postgres-app <APP NAME>
Running flyadmin database-list
Running flyadmin user-list
Error unexpected end of JSON input