ERRO[0605] Can't add file <some_file> to tar: io: read/write on closed pipe

I have been trying to deploy for about 48h now and still no luck so I don’t think this is due to a temporary issue.

Whenever i run fly deploy --remote-only I get a ERRO[0605] Can't add file <some_file> to tar: io: read/write on closed pipe error.
My app is in fra with ams and cdg as backup.

Here is a log with some more information:

Remote builder fly-builder-lively-sea-2360 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.10 linux x86_64
ERRO[0605] Can't add file <some_file>.beam to tar: io: read/write on closed pipe
ERRO[0605] Can't close tar writer: io: read/write on closed pipe
Error error building: error building with docker: error during connect: Post "http://[fdaa:0:357c:a7b:5bd4:0:6da2:2]:2375/v1.41/build?buildargs=%7B%7D&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=null&memory=0&memswap=0&networkmode=&platform=linux%2Famd64&rm=0&shmsize=0&t=registry.fly.io%2Fnara%3Adeployment-1640533681&target=&ulimits=null&version=": write unix ->/Users/Vidy/.fly/fly-agent.sock: use of closed network connection

Cna you check the size of the files you’re uploading? It’s possible you’re uploading a file that should be created by the build.

du -shx * | sort -rh | head -n 10 will show you the top 10 larges files/dirs.

Adding the offending file/directory to .dockerignore can help, if you find anything.

Thanks for your help Joshua!

I did notice a few files that needed to be added to my .dockerignore but it unfortunately didn’t help.
Furthermore, I had no problem with big files in the past and I haven’t added new ones recently.

However, I am currently on holiday with a rather slow internet speed. Could it be the culprit?

Actually, you put me on the right track. I switch to a 4G connection on my phone and because the upload speed was faster, the deploy succeeded.

Thank you!

Glad to hear it! If you don’t mind, could you paste the output of your successful build?

Sure thing! Can I ask what you are interested in looking at?

Here it is:

Deploying nara
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 4000
Remote builder fly-builder-lively-sea-2360 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.10 linux x86_64
Sending build context to Docker daemon  74.22MB
Step 1/32 : FROM elixir:1.13-alpine AS build
1.13-alpine: Pulling from library/elixir
59bf1c3509f3: Pull complete
649de50fe142: Pull complete
3e72a5f65f15: Pull complete
Digest: sha256:14302fb86b2bcede730ac4ca890675537a395f4a2f67c119947a88a5a077285d
Status: Downloaded newer image for elixir:1.13-alpine
 ---> d3ba6dbedb6e
Step 2/32 : RUN apk add --no-cache build-base npm git
 ---> Running in 921c6cd0948c
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/29) Installing binutils (2.37-r3)
(2/29) Installing libmagic (5.41-r0)
(3/29) Installing file (5.41-r0)
(4/29) Installing libgomp (10.3.1_git20211027-r0)
(5/29) Installing libatomic (10.3.1_git20211027-r0)
(6/29) Installing libgphobos (10.3.1_git20211027-r0)
(7/29) Installing gmp (6.2.1-r0)
(8/29) Installing isl22 (0.22-r0)
(9/29) Installing mpfr4 (4.1.0-r0)
(10/29) Installing mpc1 (1.2.1-r0)
(11/29) Installing gcc (10.3.1_git20211027-r0)
(12/29) Installing musl-dev (1.2.2-r7)
(13/29) Installing libc-dev (0.7.2-r3)
(14/29) Installing g++ (10.3.1_git20211027-r0)
(15/29) Installing make (4.3-r0)
(16/29) Installing fortify-headers (1.1-r1)
(17/29) Installing patch (2.7.6-r7)
(18/29) Installing build-base (0.5-r2)
(19/29) Installing brotli-libs (1.0.9-r5)
(20/29) Installing nghttp2-libs (1.46.0-r0)
(21/29) Installing libcurl (7.80.0-r0)
(22/29) Installing expat (2.4.1-r0)
(23/29) Installing pcre2 (10.39-r0)
(24/29) Installing git (2.34.1-r0)
(25/29) Installing c-ares (1.18.1-r0)
(26/29) Installing icu-libs (69.1-r1)
(27/29) Installing libuv (1.42.0-r0)
(28/29) Installing nodejs-current (17.2.0-r0)
(29/29) Installing npm (8.1.3-r0)
Executing busybox-1.34.1-r3.trigger
OK: 288 MiB in 53 packages
 ---> ce12f093c0eb
Step 3/32 : WORKDIR /app
 ---> Running in 51bb7527bb5c
 ---> e420851082d4
Step 4/32 : ENV HEX_HTTP_TIMEOUT=20
 ---> Running in 8e421ef088ae
 ---> 049dc9103fa2
Step 5/32 : RUN mix local.hex --force &&   mix local.rebar --force
 ---> Running in a6faf255dfce
* creating /root/.mix/archives/hex-1.0.1
* creating /root/.mix/rebar
* creating /root/.mix/rebar3
 ---> b960e6831143
Step 6/32 : ENV MIX_ENV=prod
 ---> Running in dca8f33d5763
 ---> 8eebf8bcfda6
Step 7/32 : ENV SECRET_KEY_BASE=nokey
 ---> Running in 8dd642fc405d
 ---> a2f3f960b69e
Step 8/32 : ENV LV_SIGNING_SALT=nokey
 ---> Running in 38aec0a68416
 ---> 94f3aaf1f79c
Step 9/32 : COPY mix.exs mix.lock ./
 ---> 83e3398c6e30
Step 10/32 : COPY config config
 ---> 6b6a97e16427
Step 11/32 : RUN mix deps.get --only prod &&   mix deps.compile
 ---> Running in fdead3703b03
* Getting horde (https://github.com/RealVidy/horde.git)
remote: Enumerating objects: 2933, done.
remote: Counting objects: 100% (2933/2933), done.
remote: Compressing objects: 100% (776/776), done.
remote: Total 2933 (delta 1823), reused 2933 (delta 1823), pack-reused 0
* Getting nostrum (https://github.com/RealVidy/nostrum)
remote: Enumerating objects: 8380, done.
remote: Counting objects: 100% (2542/2542), done.
remote: Compressing objects: 100% (389/389), done.
remote: Total 8380 (delta 2303), reused 2271 (delta 2151), pack-reused 5838
* Getting ueberauth_discord (https://github.com/RealVidy/ueberauth_discord)
remote: Enumerating objects: 139, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 139 (delta 23), reused 52 (delta 16), pack-reused 69
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  bcrypt_elixir 2.3.0
  castore 0.1.13
  certifi 2.8.0
  chacha20 1.0.3
  comeonin 5.3.2
  connection 1.1.0
  cowboy 2.9.0
  cowboy_telemetry 0.4.0
  cowlib 2.11.0
  csv 2.4.1
  curve25519 1.0.4
  db_connection 2.4.1
  decimal 2.0.0
  decorator 1.3.2
  delta_crdt 0.6.4
  earmark 1.4.18
  earmark_parser 1.4.17
  ecto 3.7.1
  ecto_sql 3.7.1
  ed25519 1.3.3
  elixir_make 0.6.3
  equivalex 1.0.2
  esbuild 0.3.4
  gen_stage 1.1.2
  gen_state_machine 3.0.0
  gettext 0.18.2
  gun 2.0.0-rc.2
  hackney 1.18.0
  hashids 2.0.5
  httpoison 1.8.0
  idna 6.1.1
  jason 1.2.2
  kcl 1.4.0
  libcluster 3.3.0
  libring 1.5.0
  merkle_map 0.2.1
  metrics 1.0.1
  mime 1.6.0
  mimerl 1.2.0
  oauth2 2.0.0
  parallel_stream 1.0.6
  parse_trans 3.3.1
  phoenix 1.6.2
  phoenix_ecto 4.4.0
  phoenix_html 3.1.0
  phoenix_live_dashboard 0.5.3
  phoenix_live_view 0.16.4
  phoenix_pubsub 2.0.0
  phoenix_view 1.0.0
  plug 1.12.1
  plug_cowboy 2.5.2
  plug_crypto 1.2.2
  poison 3.1.0
  poly1305 1.0.3
  porcelain 2.0.3
  postgrex 0.15.13
  ranch 1.8.0
  retrieval 0.9.1
  retry 0.15.0
  salsa20 1.0.3
  ssl_verify_fun 1.1.6
  surface 0.5.2
  telemetry 1.0.0
  telemetry_metrics 0.6.1
  telemetry_poller 1.0.0
  ueberauth 0.6.3
  ueberauth_google 0.10.0
  unicode_util_compat 0.7.0
* Getting bcrypt_elixir (Hex package)
* Getting cowlib (Hex package)
* Getting csv (Hex package)
* Getting decorator (Hex package)
* Getting ecto_sql (Hex package)
* Getting ecto (Hex package)
* Getting esbuild (Hex package)
* Getting gen_state_machine (Hex package)
* Getting gettext (Hex package)
* Getting gun (Hex package)
* Getting hashids (Hex package)
* Getting httpoison (Hex package)
* Getting jason (Hex package)
* Getting libcluster (Hex package)
* Getting oauth2 (Hex package)
* Getting phoenix_ecto (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting earmark (Hex package)
* Getting earmark_parser (Hex package)
* Getting phoenix (Hex package)
* Getting plug_cowboy (Hex package)
* Getting postgrex (Hex package)
* Getting retrieval (Hex package)
* Getting retry (Hex package)
* Getting surface (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting telemetry (Hex package)
* Getting ueberauth_google (Hex package)
* Getting ueberauth (Hex package)
* Getting poison (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting connection (Hex package)
* Getting db_connection (Hex package)
* Getting decimal (Hex package)
* Getting cowboy (Hex package)
* Getting cowboy_telemetry (Hex package)
* Getting ranch (Hex package)
* Getting phoenix_pubsub (Hex package)
* Getting phoenix_view (Hex package)
* Getting hackney (Hex package)
* Getting certifi (Hex package)
* Getting idna (Hex package)
* Getting metrics (Hex package)
* Getting mimerl (Hex package)
* Getting parse_trans (Hex package)
* Getting ssl_verify_fun (Hex package)
* Getting unicode_util_compat (Hex package)
* Getting kcl (Hex package)
* Getting porcelain (Hex package)
* Getting gen_stage (Hex package)
* Getting curve25519 (Hex package)
* Getting ed25519 (Hex package)
* Getting poly1305 (Hex package)
* Getting salsa20 (Hex package)
* Getting chacha20 (Hex package)
* Getting equivalex (Hex package)
* Getting delta_crdt (Hex package)
* Getting libring (Hex package)
* Getting merkle_map (Hex package)
* Getting castore (Hex package)
* Getting parallel_stream (Hex package)
* Getting comeonin (Hex package)
* Getting elixir_make (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more
==> chacha20
Compiling 1 file (.ex)
Generated chacha20 app
==> earmark_parser
Compiling 1 file (.yrl)
Compiling 2 files (.xrl)
Compiling 3 files (.erl)
Compiling 32 files (.ex)
Generated earmark_parser app
===> Analyzing applications...
===> Compiling parse_trans
==> gen_state_machine
Compiling 3 files (.ex)
Generated gen_state_machine app
==> equivalex
Compiling 1 file (.ex)
Generated equivalex app
==> poly1305
Compiling 1 file (.ex)
Generated poly1305 app
===> Analyzing applications...
===> Compiling mimerl
==> connection
Compiling 1 file (.ex)
Generated connection app
==> merkle_map
Compiling 7 files (.ex)
Generated merkle_map app
==> decorator
Compiling 2 files (.ex)
Generated decorator app
==> hashids
Compiling 4 files (.ex)
Generated hashids app
===> Analyzing applications...
===> Compiling metrics
===> Analyzing applications...
===> Compiling unicode_util_compat
===> Analyzing applications...
===> Compiling idna
==> gettext
Compiling 1 file (.yrl)
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
==> gen_stage
Compiling 10 files (.ex)
Generated gen_stage app
===> Analyzing applications...
===> Compiling ranch
===> Analyzing applications...
===> Compiling telemetry
==> telemetry_metrics
Compiling 7 files (.ex)
Generated telemetry_metrics app
===> Analyzing applications...
===> Compiling telemetry_poller
==> delta_crdt
Compiling 5 files (.ex)
Generated delta_crdt app
==> retry
Compiling 3 files (.ex)
Generated retry app
==> curve25519
Compiling 1 file (.ex)
Generated curve25519 app
==> decimal
Compiling 4 files (.ex)
Generated decimal app
warning: found quoted keyword "coveralls" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores do not require quotes
  /app/deps/parallel_stream/mix.exs:17:30

==> parallel_stream
Compiling 11 files (.ex)
warning: Stream.chunk/4 is deprecated. Use Stream.chunk_every/4 instead
  lib/parallel_stream/producer.ex:16: ParallelStream.Producer.build!/4

Generated parallel_stream app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> libcluster
Compiling 13 files (.ex)
Generated libcluster app
warning: String.strip/1 is deprecated. Use String.trim/1 instead
  /app/deps/poison/mix.exs:4: Poison.Mixfile

==> poison
Compiling 4 files (.ex)
warning: Integer.to_char_list/2 is deprecated. Use Integer.to_charlist/2 instead
  lib/poison/encoder.ex:173: Poison.Encoder.BitString.seq/1

Generated poison app
==> comeonin
Compiling 4 files (.ex)
Generated comeonin app
==> ssl_verify_fun
Compiling 7 files (.erl)
Generated ssl_verify_fun app
==> porcelain
Compiling 9 files (.ex)
warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:6: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:7: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:8: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:9: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:11: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:12: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:13: Porcelain.Driver.Common

warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead
  lib/porcelain/drivers/driver_common.ex:14: Porcelain.Driver.Common

warning: the Behaviour module is deprecated. Instead of using this module, use the @callback and @macrocallback module attributes. See the documentation for Module for more information on these attributes
  lib/porcelain/drivers/driver_common.ex:4: (module)
  (elixir 1.13.1) src/elixir_compiler.erl:73: :elixir_compiler.dispatch/4
  (elixir 1.13.1) src/elixir_compiler.erl:58: :elixir_compiler.compile/3
  (elixir 1.13.1) src/elixir_module.erl:369: :elixir_module.eval_form/6
  (elixir 1.13.1) src/elixir_module.erl:105: :elixir_module.compile/5
  (elixir 1.13.1) src/elixir_lexical.erl:15: :elixir_lexical.run/3

warning: function init/1 required by behaviour GenServer is not implemented (in module Porcelain.Driver.Common.StreamServer).

We will inject a default implementation for now:

    def init(init_arg) do
      {:ok, init_arg}
    end

You can copy the implementation above or define your own that converts the arguments given to GenServer.start_link/3 to the server state.

  lib/porcelain/drivers/stream_server.ex:1: Porcelain.Driver.Common.StreamServer (module)

warning: variable "result" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  lib/porcelain/drivers/driver_common.ex:165: Porcelain.Driver.Common.send_result/4

warning: Atom.to_char_list/1 is deprecated. Use Atom.to_charlist/1 instead
  lib/porcelain.ex:408: Porcelain.convert_env_name/1

warning: String.to_char_list/1 is deprecated. Use String.to_charlist/1 instead
Invalid call found at 2 locations:
  lib/porcelain.ex:405: Porcelain.convert_env_name/1
  lib/porcelain.ex:412: Porcelain.convert_env_val/1

warning: String.to_char_list/1 is deprecated. Use String.to_charlist/1 instead
  lib/porcelain/init.ex:78: Porcelain.Init.init_shell/0

Generated porcelain app
==> salsa20
Compiling 1 file (.ex)
Generated salsa20 app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> esbuild
Compiling 3 files (.ex)
Generated esbuild app
==> elixir_make
Compiling 1 file (.ex)
Generated elixir_make app
==> bcrypt_elixir
mkdir -p /app/_build/prod/lib/bcrypt_elixir/priv
cc -g -O3 -Wall -Wno-format-truncation -I"/usr/local/lib/erlang/erts-12.2/include" -Ic_src -fPIC -shared  c_src/bcrypt_nif.c c_src/blowfish.c -o /app/_build/prod/lib/bcrypt_elixir/priv/bcrypt_nif.so
Compiling 3 files (.ex)
Generated bcrypt_elixir app
==> csv
Compiling 10 files (.ex)
Generated csv app
==> ed25519
Compiling 2 files (.ex)
Generated ed25519 app
==> kcl
Compiling 2 files (.ex)
Generated kcl app
===> Analyzing applications...
===> Compiling certifi
===> Analyzing applications...
===> Compiling hackney
==> earmark
Compiling 15 files (.ex)
Generated earmark app
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> httpoison
Compiling 3 files (.ex)
Generated httpoison app
==> ecto
Compiling 56 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 11 files (.ex)
Generated phoenix_pubsub app
==> oauth2
Compiling 13 files (.ex)
Generated oauth2 app
===> Analyzing applications...
===> Compiling cowlib
===> Analyzing applications...
===> Compiling cowboy
===> Analyzing applications...
===> Compiling cowboy_telemetry
==> mime
Compiling 2 files (.ex)
Generated mime app
==> libring
Compiling 5 files (.ex)
Generated libring app
==> horde
Compiling 13 files (.ex)
Generated horde app
==> postgrex
Compiling 62 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 26 files (.ex)
Generated ecto_sql app
warning: variable "description" does not exist and is being expanded to "description()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/retrieval/mix.exs:8: Retrieval.Mixfile.project/0

warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/retrieval/mix.exs:9: Retrieval.Mixfile.project/0

warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/retrieval/mix.exs:12: Retrieval.Mixfile.project/0

==> retrieval
Compiling 3 files (.ex)
Generated retrieval app
===> Analyzing applications...
===> Compiling gun
==> nostrum
Compiling 102 files (.ex)
Generated nostrum app
==> plug_crypto
Compiling 5 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 41 files (.ex)
warning: System.stacktrace/0 is deprecated. Use __STACKTRACE__ instead
  lib/plug/conn/wrapper_error.ex:23: Plug.Conn.WrapperError.reraise/3

Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> phoenix_view
Compiling 5 files (.ex)
Generated phoenix_view app
==> plug_cowboy
Compiling 5 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 68 files (.ex)
Generated phoenix app
==> phoenix_live_view
Compiling 28 files (.ex)
Generated phoenix_live_view app
==> phoenix_live_dashboard
Compiling 40 files (.ex)
warning: Phoenix.HTML.sigil_E/2 is deprecated. use the ~H sigil instead
  lib/phoenix/live_dashboard/pages/os_mon_page.ex:176: Phoenix.LiveDashboard.OSMonPage.cpu_hint/1

warning: Phoenix.HTML.sigil_E/2 is deprecated. use the ~H sigil instead
  lib/phoenix/live_dashboard/pages/home_page.ex:29: Phoenix.LiveDashboard.HomePage

Generated phoenix_live_dashboard app
==> surface
Compiling 102 files (.ex)
Generated surface app
==> ueberauth
Compiling 9 files (.ex)
Generated ueberauth app
==> ueberauth_discord
Compiling 3 files (.ex)
Generated ueberauth_discord app
==> ueberauth_google
Compiling 3 files (.ex)
Generated ueberauth_google app
==> phoenix_ecto
Compiling 7 files (.ex)
Generated phoenix_ecto app
 ---> c94e08b1e5a2
Step 12/32 : COPY assets/package.json assets/package-lock.json ./assets/
 ---> bec66669a802
Step 13/32 : RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
 ---> Running in 98cf1774d064

added 150 packages in 7s

22 packages are looking for funding
  run `npm fund` for details
 ---> 5c590e90c940
Step 14/32 : COPY priv priv
 ---> e3ec226048d2
Step 15/32 : COPY assets assets
 ---> 29fe8e761c8c
Step 16/32 : COPY CHANGELOG.md ./
 ---> 87ac489fdc0e
Step 17/32 : COPY lib lib
 ---> 1e0e4f70c690
Step 18/32 : RUN npm run --prefix ./assets deploy
 ---> Running in 8660036b5af7

> deploy
> NODE_ENV=production tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css


Done in 88180ms.
 ---> 6a54e6b2ec45
Step 19/32 : RUN mix phx.digest
 ---> Running in 1cadd079671f
Compiling 183 files (.ex)
Generated nara app
Check your digested files at "priv/static"
 ---> db4dd9af9c1d
Step 20/32 : COPY rel rel
 ---> d5686ebf6ec2
Step 21/32 : RUN mix release
 ---> Running in f3b49c787635
* assembling nara-0.7.0 on MIX_ENV=prod
* using config/runtime.exs to configure the release at runtime
* creating _build/prod/rel/nara/releases/0.7.0/vm.args
* creating _build/prod/rel/nara/releases/0.7.0/remote.vm.args
* creating _build/prod/rel/nara/releases/0.7.0/env.sh

Release created at _build/prod/rel/nara!

    # To start your system
    _build/prod/rel/nara/bin/nara start

Once the release is running:

    # To connect to it remotely
    _build/prod/rel/nara/bin/nara remote

    # To stop it gracefully (you may also send SIGINT/SIGTERM)
    _build/prod/rel/nara/bin/nara stop

To list all commands:

    _build/prod/rel/nara/bin/nara

 ---> 705000c3bb92
Step 22/32 : FROM alpine:3.13.3 AS app
3.13.3: Pulling from library/alpine
9aae54b2144e: Pull complete
Digest: sha256:826f70e0ac33e99a72cf20fb0571245a8fee52d68cb26d8bc58e53bfa65dcdfa
Status: Downloaded newer image for alpine:3.13.3
 ---> 302aba9ce190
Step 23/32 : RUN apk add --no-cache libstdc++ openssl ncurses-libs
 ---> Running in dbe9739f1ef1
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
(1/5) Installing libgcc (10.2.1_pre1-r3)
(2/5) Installing libstdc++ (10.2.1_pre1-r3)
(3/5) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(4/5) Installing ncurses-libs (6.2_p20210109-r0)
(5/5) Installing openssl (1.1.1l-r0)
Executing busybox-1.32.1-r3.trigger
OK: 9 MiB in 19 packages
 ---> 5e1f65c41749
Step 24/32 : WORKDIR /app
 ---> Running in f3506f50c622
 ---> 2b7a9914bbda
Step 25/32 : RUN chown nobody:nobody /app
 ---> Running in f4c9ca4f6e53
 ---> 0a04be9efd60
Step 26/32 : USER nobody:nobody
 ---> Running in 3b21394ba2d4
 ---> 848033fda789
Step 27/32 : COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/nara ./
 ---> 4449b4d8c642
Step 28/32 : ENV HOME=/app
 ---> Running in 7985aa205c9a
 ---> ae6cfe3e1be6
Step 29/32 : ENV MIX_ENV=prod
 ---> Running in becba8614db4
 ---> be493808b3ca
Step 30/32 : ENV SECRET_KEY_BASE=nokey
 ---> Running in 093c678c54ca
 ---> 7f7fe135b894
Step 31/32 : ENV PORT=4000
 ---> Running in df3d2f155765
 ---> d2539e01b8cf
Step 32/32 : CMD ["bin/nara", "start"]
 ---> Running in fcff152f8d8d
 ---> 4bde1d1cedba
Successfully built 4bde1d1cedba
Successfully tagged registry.fly.io/nara:deployment-1640627853
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/nara]
a94978cdd39d: Pushed
3d5fb163b47d: Pushed
01e852a371cc: Pushed
fe0863946661: Pushed
0f7b3ff8b310: Layer already exists
deployment-1640627853: digest: sha256:3c9f6e3cfafb61825b462c5aa748bb2b3535964c4cba9d169216a0d678a23c1f size: 1364
--> Pushing image done
Image: registry.fly.io/nara:deployment-1640627853
Image size: 78 MB
==> Creating release
Release v85 created
Release command detected: this new release will not be available until the command succeeds.

You can detach the terminal anytime without stopping the deployment
==> Release command
Command: /app/bin/nara eval Nara.Release.migrate
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Configuring firecracker
	 Starting virtual machine
	 Starting init (commit: 7943db6)...
	 2021/12/27 18:09:20 listening on [fdaa:0:357c:a7b:23c4:aaea:d751:2]:22 (DNS: [fdaa::3]:53)
	 Reaped child process with pid: 561 and signal: SIGUSR1, core dumped? false
	 Main child exited normally with code: 0
	 Reaped child process with pid: 563 and signal: SIGUSR1, core dumped? false
	 Starting clean up.
Monitoring Deployment

2 desired, 2 placed, 2 healthy, 0 unhealthy [health checks: 2 total, 2 passing]
--> v85 deployed successfully

Thanks!

I suspected that you did not have buildkit enabled. This is the newer, more efficient way to build Docker images. We’ve seen problems like this in the past when it was disabled. I recommend using it for all your builds.

To enable it, just make sure DOCKER_BUILDKIT is set to any value in your shell environment.

More info here: Build images with BuildKit | Docker Documentation

Oh great I’ll add that to my deploy scripts right away.

I actually read that you recommended this in another thread, but I thought it had been enabled by default.

I am running into the same problem.

Using Buildkit didn’t help things. I can’t add the large files to the .dockerignore because those large files are part of the app I am trying to deploy. It’s about 250MB worth of images and sound files.

Is there some sort of timeout that can be extended?

(assuming you haven’t considered) To unblock your deploys right away, you could:

  1. Download (ADD or RUN wget) the files when building the docker image (instead of COPYing it from the filesystem).
  2. Do a local build by supplying --local-only switch to flyctl deploy.

1 is what I do for a project that has files 100M in size, downloaded from R2/S3 (at build time).

Cool, thanks.

I did end up finding out about --local-only and used that, but hadn’t considered downloading files at build time as an alternative.