Deployment fails with: Error Validation failed: Image is not allowed for app

Hello,

suddenly the deployment via Github Actions isn’t working anymore…

flyctl deploy -a my-nice-app-staging --remote-only -e GIT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`
2
  flyctl deploy -a my-nice-app-staging --remote-only -e GIT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`
3
  shell: /usr/bin/bash -e {0}
4
  env:
5
    FLY_API_TOKEN: ***
6
==> Verifying app config
7
--> Verified app config
8
==> Building image
9
Waiting for remote builder fly-builder-floral-shadow-3613...
10
Remote builder fly-builder-floral-shadow-3613 ready
11
==> Creating build context
12
--> Creating build context done
13
==> Building image with Docker
14
--> docker host: 20.10.12 linux x86_64
15
#1 [internal] load remote build context
16
Sending build context to Docker daemon  1.905MB
17
18
#1 DONE 0.0s
19
20
#2 copy /context /
21
#2 DONE 0.1s
22
23
#4 [internal] load metadata for docker.io/hexpm/elixir:1.13.4-erlang-24.3.4-alpine-3.15.3
24
#4 DONE 0.9s
25
26
#3 [internal] load metadata for docker.io/library/alpine:3.15.3
27
#3 DONE 0.9s
28
29
#9 [build  1/13] FROM docker.io/hexpm/elixir:1.13.4-erlang-24.3.4-alpine-3.15.3@sha256:54f467278615de7dd821aeecbee425537508f19241950ee121e7a4b6c7b11991
30
#9 DONE 0.0s
31
32
#5 [app 1/5] FROM docker.io/library/alpine:3.15.3@sha256:f22945d45ee2eb4dd463ed5a431d9f04fcd80ca768bb1acf898d91ce51f7bf04
33
#5 DONE 0.0s
34
35
#16 [build  8/13] COPY priv priv
36
#16 CACHED
37
38
#13 [build  5/13] COPY mix.exs mix.lock ./
39
#13 CACHED
40
41
#14 [build  6/13] COPY config config
42
#14 CACHED
43
44
#15 [build  7/13] RUN mix deps.get --only prod &&     mix deps.compile
45
#15 CACHED
46
47
#10 [build  2/13] RUN apk add --no-cache build-base git
48
#10 CACHED
49
50
#12 [build  4/13] RUN mix local.hex --force &&     mix local.rebar --force
51
#12 CACHED
52
53
#11 [build  3/13] WORKDIR /app
54
#11 CACHED
55
56
#17 [build  9/13] COPY assets assets
57
#17 CACHED
58
59
#18 [build 10/13] COPY lib lib
60
#18 DONE 0.0s
61
62
#19 [build 11/13] RUN mix assets.deploy
73
#19 7.366 Compiling 185 files (.ex)
#19 26.41 Generated my_nice_app app
77
#19 28.14 Check your digested files at "priv/static"
78
#19 DONE 28.3s
79
80
#20 [build 12/13] COPY rel rel
81
#20 DONE 0.0s
82
83
#21 [build 13/13] RUN mix do compile, release
84
#21 1.412 * assembling my_nice_app-0.1.0 on MIX_ENV=prod
85
#21 1.413 * using config/runtime.exs to configure the release at runtime
86
#21 1.942 * creating _build/prod/rel/my_nice_app/releases/0.1.0/vm.args
87
#21 1.958 * creating _build/prod/rel/my_nice_app/releases/0.1.0/env.sh
88
#21 4.206 
89
#21 4.206 Release created at _build/prod/rel/my_nice_app!
90
#21 4.206 
91
#21 4.206     # To start your system
92
#21 4.206     _build/prod/rel/my_nice_app/bin/my_nice_app start
93
#21 4.206 
94
#21 4.206 Once the release is running:
95
#21 4.206 
96
#21 4.206     # To connect to it remotely
97
#21 4.206     _build/prod/rel/my_nice_app/bin/my_nice_app remote
98
#21 4.206 
99
#21 4.206     # To stop it gracefully (you may also send SIGINT/SIGTERM)
100
#21 4.206     _build/prod/rel/my_nice_app/bin/my_nice_app stop
101
#21 4.206 
102
#21 4.206 To list all commands:
103
#21 4.206 
104
#21 4.206     _build/prod/rel/my_nice_app/bin/my_nice_app
105
#21 4.206 
106
#21 DONE 4.4s
107
108
#6 [app 2/5] RUN apk add --no-cache libstdc++ openssl ncurses-libs
109
#6 CACHED
110
111
#7 [app 3/5] WORKDIR /app
112
#7 CACHED
113
114
#8 [app 4/5] RUN chown nobody:nobody /app
115
#8 CACHED
116
117
#22 [app 5/5] COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/my_nice_app ./
118
#22 DONE 0.5s
119
120
#23 exporting to image
121
#23 exporting layers
122
#23 exporting layers 0.5s done
123
#23 writing image sha256:3509a843b57ff801b85773464973181b75984ee8cb033f829b4fcb7db106c91f done
124
#23 naming to registry.fly.io/my-nice-app:deployment-1656238066 done
125
#23 DONE 0.5s
126
--> Building image done
127
==> Pushing image to fly
128
The push refers to repository [registry.fly.io/my-nice-app]
129
af97f41c7446: Preparing
130
8b822ac4476b: Preparing
131
a1ebd3830bd3: Preparing
132
60dfcbe0496a: Preparing
133
a1c01e366b99: Preparing
134
60dfcbe0496a: Layer already exists
135
a1ebd3830bd3: Layer already exists
136
8b822ac4476b: Layer already exists
137
a1c01e366b99: Layer already exists
138
af97f41c7446: Pushed
139
deployment-1656238066: digest: sha256:b9c6cdd48105604811b21f05b25b536395b7ef28b40cf01272ab927794787bc4 size: 1365
140
--> Pushing image done
141
image: registry.fly.io/my-nice-app:deployment-1656238066
142
image size: 42 MB
143
==> Creating release
144
Error Validation failed: Image is not allowed for app
superfly/flyctl-actions/setup-flyctl@master
flyctl 0.0.337 is installed

Any ideas?

The problem is the just released flyctl v.0.0.337 that is faulty. See more info here. I adjusted the GitHub action to use the previous stable version and it worked again.

Well this is a strange one. Does your fly.toml have a different app = <name> by chance?

I’m 99% sure this was the bug you hit. Sorry about that, it’ll be fixed in the latest release in a few minutes: fix regression: app arg should override app in config by mrkurt · Pull Request #1031 · superfly/flyctl · GitHub

Yes, indeed. It’s Staging, and the Fly app name is different in this case.