Error building: context deadline exceeded (bom)

Hello, I am trying to deploy a Phoenix project on Fly.io

Here are the logs

➜  (main) ✗ fly launch
An existing fly.toml file was found for app .....
? Would you like to copy its configuration to the new app? Yes
Scanning source code
....
....
....

Installing application dependencies
Running Docker release generator
Wrote config file fly.toml
Validating /.../fly.toml
✓ Configuration is valid
==> Building image
==> Building image
Error: failed to fetch an image or build from source: error building: context deadline exceeded


➜  git:(main) ✗ fly deploy --depot=false
==> Verifying app config
Validating /.../fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
WARN Failed to start remote builder heartbeat: failed to create volume: no capacity available in bom

==> Building image
WARN Failed to start remote builder heartbeat: failed to create volume: no capacity available in bom

Error: failed to fetch an image or build from source: failed to create volume: no capacity available in bom 

➜  git:(main) ✗ fly deploy --remote-only
==> Verifying app config
Validating /.../fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image

WARN failed to finish build in graphql: Post "https://api.fly.io/graphql": context canceled

==> Building image
WARN failed to create build in graphql: Post "https://api.fly.io/graphql": context canceled

Can anyone help me with this ?

Have you solved your problem because, I’m facing the same kind of problem.
Not able to deploy

==> Building image
Waiting for depot builder…
Waiting for depot builder…
Waiting for depot builder…
Waiting for depot builder…
Waiting for depot builder…
Error: failed to fetch an image or build from source: error building: context deadline exceeded

only the above line is printing multiple times

No, I haven’t solved the problem.

Here’s the issue:

This was mentioned in another thread recently:

Does BOM mean BOMBAY region ?

If so is the case, I have not picked that as the region I wanna deploy in. I have selected SYD (Sydney)

Or does it mean something else ?

In fly.toml, I have

...
primary_region = 'syd'
...

Right, Bombay at the time the airport code was originally chosen…

I think the builder is based on where your WireGuard gateway is, rather than the primary_region.

You may be able to shake free with…

$ fly agent stop
$ fly wg remove <org-name>  # repeat as necessary.  (there can be a lot!)
$ FLY_AGENT_WG_REGION=syd fly deploy --depot=false

(Assumes Bash syntax.)

I tried the above but it didn’t work.

 (main) FLY_AGENT_WG_REGION=syd fly deploy --depot=false
==> Verifying app config
Validating .../fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
WARN Failed to start remote builder heartbeat: failed to create volume: no capacity available in bom

==> Building image
WARN Failed to start remote builder heartbeat: failed to create volume: no capacity available in bom

Error: failed to fetch an image or build from source: failed to create volume: no capacity available in bom ......

What do you have under region and endpointip in ~/.fly/config.yml?

(Caution: don’t paste that entire file, since it contains authentication keys, :dragon:.)

access_token: .....
metrics_token: ....
wire_guard_state: {}

This is it

How about FLY_REMOTE_BUILDER_REGION, in place of FLY_AGENT_WG_REGION?

(Maybe add in --recreate-builder, just for completeness…)

Hello, thank you so much for your help on this.

FLY_REMOTE_BUILDER_REGION worked, I cleaned everything from dashboard, and did FLY_REMOTE_BUILDER_REGION=syd fly launch but not getting

-------
 ✖ release_command failed
-------
Error release_command failed running on machine 2865945f643308 with exit code 1.
Checking logs: fetching the last 100 lines below:
2025-06-05T06:19:46Z 2025-06-05T06:19:46.597543367 [01JWZBXFTB86VVC7WA8MCDNDX4:main] Running Firecracker v1.7.0
2025-06-05T06:19:47Z  INFO Starting init (commit: 28e33be24)...
2025-06-05T06:19:47Z  INFO Preparing to run: `/app/bin/migrate` as nobody
2025-06-05T06:19:47Z  INFO [fly api proxy] listening at /.fly/api
2025-06-05T06:19:47Z Machine started in 949ms
2025-06-05T06:19:47Z 2025/06/05 06:19:47 INFO SSH listening listen_address=[fdaa:1b:306c:a7b:1b2:e7d2:1729:2]:22
2025-06-05T06:19:48Z 06:19:48.124 [error] :gen_statem #PID<0.151.0> terminating
2025-06-05T06:19:48Z ** (RuntimeError) connect raised MatchError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:395: Exqlite.Connection.get_pragma/2
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:404: Exqlite.Connection.maybe_set_pragma/3
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:543: Exqlite.Connection.do_connect/2
2025-06-05T06:19:48Z     (db_connection 2.7.0) lib/db_connection/connection.ex:74: DBConnection.Connection.handle_event/4
2025-06-05T06:19:48Z     (stdlib 6.1.2) gen_statem.erl:3737: :gen_statem.loop_state_callback/11
2025-06-05T06:19:48Z     (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
2025-06-05T06:19:48Z Queue: [internal: {:connect, :init}]
2025-06-05T06:19:48Z Postponed: []
2025-06-05T06:19:48Z 06:19:48.124 [error] :gen_statem #PID<0.150.0> terminating
2025-06-05T06:19:48Z ** (RuntimeError) connect raised MatchError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:395: Exqlite.Connection.get_pragma/2
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:404: Exqlite.Connection.maybe_set_pragma/3
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:543: Exqlite.Connection.do_connect/2
2025-06-05T06:19:48Z     (db_connection 2.7.0) lib/db_connection/connection.ex:74: DBConnection.Connection.handle_event/4
2025-06-05T06:19:48Z     (stdlib 6.1.2) gen_statem.erl:3737: :gen_statem.loop_state_callback/11
2025-06-05T06:19:48Z     (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
2025-06-05T06:19:48Z Queue: [internal: {:connect, :init}]
2025-06-05T06:19:48Z Postponed: []
2025-06-05T06:19:48Z 06:19:48.136 [error] :gen_statem #PID<0.154.0> terminating
2025-06-05T06:19:48Z ** (RuntimeError) connect raised MatchError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:395: Exqlite.Connection.get_pragma/2
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:404: Exqlite.Connection.maybe_set_pragma/3
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:543: Exqlite.Connection.do_connect/2
2025-06-05T06:19:48Z     (db_connection 2.7.0) lib/db_connection/connection.ex:74: DBConnection.Connection.handle_event/4
2025-06-05T06:19:48Z     (stdlib 6.1.2) gen_statem.erl:3737: :gen_statem.loop_state_callback/11
2025-06-05T06:19:48Z     (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
2025-06-05T06:19:48Z Queue: [internal: {:connect, :init}]
2025-06-05T06:19:48Z Postponed: []
2025-06-05T06:19:48Z ** (EXIT from #PID<0.94.0>) shutdown
2025-06-05T06:19:48Z 06:19:48.136 [error] :gen_statem #PID<0.153.0> terminating
2025-06-05T06:19:48Z ** (RuntimeError) connect raised MatchError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:395: Exqlite.Connection.get_pragma/2
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:404: Exqlite.Connection.maybe_set_pragma/3
2025-06-05T06:19:48Z     (exqlite 0.30.1) lib/exqlite/connection.ex:543: Exqlite.Connection.do_connect/2
2025-06-05T06:19:48Z     (db_connection 2.7.0) lib/db_connection/connection.ex:74: DBConnection.Connection.handle_event/4
2025-06-05T06:19:48Z     (stdlib 6.1.2) gen_statem.erl:3737: :gen_statem.loop_state_callback/11
2025-06-05T06:19:48Z     (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
2025-06-05T06:19:48Z Queue: [internal: {:connect, :init}]
2025-06-05T06:19:48Z Postponed: []
2025-06-05T06:19:48Z  INFO Main child exited normally with code: 1
-------
Error: release command failed - aborting deployment. machine 2865945f643308 exited with non-zero status of 1

Any ideas what might this be ?

1 Like

Glad to hear there was progress! This new one looks like you’re trying to access a SQLite database from a release_command. That won’t work, since that phase runs in a temporary Machine that doesn’t have a volume attached.

Perhaps you wanted Postgres instead, for production?

(Volumes are rather nuanced and disaster-prone on the Fly.io platform.)

Hello, thank you so much for your help :folded_hands: :folded_hands: :folded_hands: :folded_hands: :folded_hands: :folded_hands:

One generic question, is their a way I can tell Ecto to always generate migrations which are postgres complaint, but adaptor to be Mix env specific ?

Hm… I don’t use Ecto migrations that much, myself, but my impression was that they were trying to abstract away such details at the level of the source code—and then only commit to a particular SQL dialect at the last minute (at runtime).

defmodule MyApp.Repo.Migrations.CreateTestTable do
  use Ecto.Migration

  def change do
    create table("test") do
      add :city,    :string, size: 40
      add :temp_lo, :integer
      add :temp_hi, :integer
      add :prcp,    :float

      timestamps()
    end
  end
end

(from a 2021 blog post)

Perhaps it would make sense to post this question as new top-level thread (via the New Topic button), to maximize the odds that the local Elixir experts come across it…

(They might not necessarily venture down 16 replies deep into a builders thread.)