Cannot attach Postgres to app.

I’m running flyctl postgres attach DB_NAME --app APP_NAME --verbose

I get this error: Error no active machines found and nothing else.

This a new app, and the db was created alongside the db, but immediately failed(because it did not have a DATABASE_URL and it crashed when attempting to run migrations(Phoenix App).

Is this related to the maintenance that is happening now?

Hey @marcello. Sorry to hear about the deployment troubles. There were some issues this afternoon with v1 apps (https://status.flyio.net/). We’ve implemented a fix shortly after your message. Apologies for the hiccup. Please try again and let us know how it goes.

Hi @nbw

I have deleted both the db and the app multiple times, but I’m now getting a different error! flyctl launch is not even working.

Everything works well until this:

==> Building image
WARN Failed to start remote builder heartbeat: Temporary error creating volume. Please run `fly volumes list` in a few minutes and see if it cleared up.
Error failed to fetch an image or build from source: error connecting to docker: Temporary error creating volume. Please run `fly volumes list` in a few minutes and see if it cleared up.

@nbw

I now tried using a new app/db name for the deployment to see if it will solve the error above and I got another different error.

==> Building image
Remote builder fly-builder-dawn-voice-958 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 0.6s (0/1)                                                                                                                                                                                                                                                                                                                                                             
[+] Building 0.9s (4/4) FINISHED                                                                                                                                                                                                                                                                                                                                                    
 => [internal] load remote build context                                                                                                                                                                                                                                                                                                                                       0.0s
 => copy /context /                                                                                                                                                                                                                                                                                                                                                            0.2s
 => [internal] load metadata for docker.io/library/debian:bullseye-20210902-slim                                                                                                                                                                                                                                                                                               0.3s
 => ERROR [internal] load metadata for docker.io/hexpm/elixir:1.14.1-erlang-25.1.2-debian-bullseye-20210902-slim                                                                                                                                                                                                                                                               0.7s
------
 > [internal] load metadata for docker.io/hexpm/elixir:1.14.1-erlang-25.1.2-debian-bullseye-20210902-slim:
------
Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.io/hexpm/elixir:1.14.1-erlang-25.1.2-debian-bullseye-20210902-slim: not found```

I think Postgres is completely busted.

If I run fly pg create it all seems to succeed just fine. When I run fly machine list --app db_app_name it finds no machines, if I run flyctl postgres connect -a db_app_name it returns: Error no active leader found

The UI shows machines running on my db app, the the command line seems busted.

version: fly v0.0.441 darwin/arm64 Commit: 7a9ec7be BuildDate: 2022-12-16T17:47:35Z

I resolve all issues by:

  1. uninstalling the brew cli
  2. installing using curl
  3. destroyed the db and the app
  4. created the db the same way as before, now using the new cli
  5. created the app
  6. attached the db to the app

This sounds like an issue with the wireguard agent. I wonder if there’s something about our brew setup that made that happen.

If you get similarly stuck next time, you can try running:

  1. fly agent restart
  2. fly wg reset

I will @kurt. I can tell you I had tried the fly agent restart command before and it did not seem to work. I did not try fly wg reset though.