flyctl launch laravel dockerfile not able to build image

A few days ago I was able to deploy perfectly fine. Yesterday I started running into this issue:

flyctl deploy --remote-only
==> Verifying app config
--> Verified app config
==> Building image
Remote builder [REDACTED] ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
Sending build context to Docker daemon  232.4kB
[+] Building 1.4s (6/6) FINISHED
 => CACHED [internal] load remote build context                                                                                   0.0s
 => CACHED copy /context /                                                                                                        0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                             0.9s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa46  0.0s
 => [internal] load metadata for docker.io/library/node:16                                                                        0.3s
 => ERROR [internal] load metadata for docker.io/serversideup/php:8.1-fpm-nginx                                                   0.4s
------
 > [internal] load metadata for docker.io/serversideup/php:8.1-fpm-nginx:
------
Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = unexpected status code [manifests 8.1-fpm-nginx]: 500 Internal Server Error

I’m using Fly’s default Dockerfile that gets included when you run fly launch.

Many other threads suggested destroying the build container and trying this has not worked. I’ve also attempted PHP 8.0, but getting the exact same error.

Considering it worked a few days ago, I am at a complete loss as to what might cause this issue.

I’ve attempted a few more things to resolve the issue:

Changing region:
I’ve tried changing region from fra to ams which didn’t yield any different results.

Default laravel application:
To make sure there was nothing in my codebase that was causing issues so I created a new Laravel application, using composer create-project laravel/laravel example-app. Once installed I proceeded to run flyctl launch and deployed right after.

This also caused the same error, with serversideup/php:7.4-fpm-nginx instead of 8.1.

Remote builder [REDACTED] ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 0.0s (0/1)
[+] Building 1.5s (6/6) FINISHED
 => [internal] load remote build context                                                                                                           0.0s
 => copy /context /                                                                                                                                0.1s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                              0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5         0.0s
 => [internal] load metadata for docker.io/library/node:14                                                                                         0.3s
 => ERROR [internal] load metadata for docker.io/serversideup/php:7.4-fpm-nginx                                                                    0.4s
------
 > [internal] load metadata for docker.io/serversideup/php:7.4-fpm-nginx:
------
Error error building: failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = unexpected status code [manifests 7.4-fpm-nginx]: 500 Internal Server Error

Currently at 4 days of not being able to deploy.

That’s strange.

I don’t know if there have been any updates to it but I just gave it a try myself, doing what you did:

composer create-project laravel/laravel delete-this-laravel
fly launch

… and it worked. Deployed (in my case to lhr), loaded, all good. Strange! :thinking:

May be worth fly destroy name-of-your-remote-builder to force a new one to be created on the next deploy, just in case that old one had any network issues or was out of space? Not sure what else would differ. I’m using the latest Fly CLI (fly version update).

As mentioned in the original post I’ve already attempted destroying the builder. And when I attempted a different region I made sure to also destroy the builder such that the new builder would be in the new region properly. Sadly, no dice.

Also running the latest version of flyctl.

I just gave the deploy command yet another go at it and finally, it works. Honestly, have no idea why it would work now but not the last 10 times I’ve tried.

Thanks for trying to help @greg :slight_smile:

1 Like

Er … no idea! Weird.

Yeah I read you’d previously tried destroying the builder but figured that was worth a shot again as that was pretty much the only variable. Apart from the region. But that shouldn’t matter.

Good that it’s working now though :slight_smile:

@rediche Ah, may have found the culprit: docker.io having issues. Given this issue looks remarkably similar to yours: a random error that shouldn’t be there, and randomly isn’t:

1 Like

Same issue indeed! Fixed for me as well now :thinking:

1 Like

I want to make it clear it wasn’t docker hub this time! Our registry mirror had a configuration issue that prevented disk cache from getting pruned correctly, and a few regions filled up and began erroring. Why docker bombs completely on a 500 from a known mirror is beyond me, but we fixed the issue and haven’t seen any issues for about 90 minutes now.

Sorry about that.

1 Like