Deploy Vapor App with JWT package Error

Hello, Fly!

My name is Nikita, I use Fly for deploying my Vapor App.

I want to deploy the Vapor App with the ‘Sign in with Apple’ package called JWT.

So I added this to my package file.

When I deployed the Vapor App without this package, everything worked fine.

But when I include the JWT package, my deploy process every time shows an error.

Last updates in the terminal look like this:

#15 189.6 [1367/1369] Compiling FluentPostgresDriver DatabaseID+PostgreSQL.swift

#15 233.2 [1369/1370] Compiling Vapor Application.swift

#15 233.4 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization

#15 233.4 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization

#15 235.4 [1371/1373] Compiling JWT Application+JWT.swift

#15 236.6 [1373/1374] Compiling Fluent FluentProvider+Concurrency.swift

#15 236.6 remark: Incremental compilation has been disabled: it is not compatible with whole module optimization

#15 242.0 [1375/1376] Compiling App BangsController.swift

#15 249.4 error: link command failed with exit code 254 (use -v to see invocation)

#15 249.4 clang-13: error: unable to execute command: Killed

#15 249.4 clang-13: error: linker command failed due to signal (use -v to see invocation)

#15 249.4 [1376/1377] Linking App

Error: failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c swift build -c release --static-swift-stdlib]: exit code: 1

Also, you sent my mail that ‘it seems I ran out of memory’, so I upgraded my plan.

But I don’t know if this is enough. Or if the problem is with the memory or something else.

Could you help me please here?

Also seeing the exact same issue when deploying Vapor app with JWT package.

Hi @nikitakuzmin

Which app ran out of memory?

It sounds like the build process is running out of memory and that process usually runs during a deployment which uses the Fly Builder app.

If that’s the case, you’ll need to increase the memory of the fly builder app instead of your app.

I have discussed this with support from Fly.
Definitely it is because of lack of memory I had to add.
I’ve added the memory and it was finally deployed!

The main problem is that I increased the memory not properly, that’s why my saviour Brian Li from Fly helped me here.

Take a look that we have to specify:

  • “fly-builder-red-silence-5604”, is a special “builder app”
  • “e28650eeb565d8”, Machine ID

So the code I entered was (make sure you add your builder app and machine id credentials):
fly m update e28650eeb565d8 --memory 8192 -a fly-builder-red-silence-5604

It looks like your builder app has 4096 MB (4 GB) of memory. Can you try running fly m update e28650eeb565d8 --memory 8192 -a fly-builder-red-silence-5604 to see if that makes a difference? This should increase the RAM to 8 GB.

So, fly-builder-red-silence-5604 and bangvapor-1 are both APPS that contain one or more MACHINES. The fly-builder-red-silence-5604 is a special “builder app” that is used to build Docker image for all the other apps in your org. When you deploy a new version of bangvapor-1 or any other app on your org, fly-builder-red-silence-5604 will read the Dockerfile and build the Docker image as needed. The Machine IDs like e28650eeb565d8 simply refer to individual Machines within their respective apps.

In this case, it looks like the Docker image you were building required more RAM to build. This can happen when something in the build process requires a lot of in-memory temporary storage. So to solve the problem, you boosted the RAM for fly-builder-red-silence-5604 to give it the resources it needed to finish building the image.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.