`flyctl deploy` from Github CI leads to HTTP ERROR 500

Hi,

If I run flyctl deploy --local-only in my repository on my computer, the deployment works fine.

However, if I run this same command in Github CI, the deployment doesn’t work. I get a page with an HTTP ERROR 500:

Here is what is inside .github/workflows/main.yml:

name: Deploy
on: [push]
env:
  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: ./deploy.sh

Do you have any idea why deployment works from my computer but not from Github CI?

Hmm sort of sounds like the build is missing something when you do the deploy from GitHub CI. If you run flyctl logs in a local shell and try hitting that page do the logs show you any more info about what might be going wrong?

Hi @jphenow ,

First, I get the same issue if I use flyctl deploy --remote-only in my Github CI. Here is the app with HTTP ERROR 500 deployed with Github CI and --remote-only:

https://lw-www2.fly.dev

In the logs, I can see HTTP ERROR 500.

Second, on my computer, flyctl deploy --remote-only gives me this error:

“Error failed to fetch an image or build from source: error connecting to docker: failed building options: failed probing “personal”: context deadline exceeded”

My Dockerfile:

FROM php:7.4-apache
RUN a2enmod rewrite
RUN docker-php-ext-install pdo pdo_mysql
COPY . /var/www
EXPOSE 80

Do you have any idea of how I could further debug? Thanks!

Hi!

  1. Can you also show your fly.toml?
  2. Just to confirm, fly logs shows you new incoming requests and a 500 response? (So it looks like the request is reaching the code base?). I want to confirm that because often a PHP app will have it’s own custom error handling page (are you using a framework?)
  3. Are you accessing the site as https://lw-www2.fly.dev or https://www.lucaswillems.com/ (as your screenshot suggests)? maybe you’re editing your /etc/hosts file to make https://www.lucaswillems.com/ point to the Fly app?

Hi @fideloper-fly !

  1. Here is the fly.toml
app = "lw-www2"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]
  APP_ENV = "production"
  LOG_CHANNEL = "stderr"
  LOG_LEVEL = "info"
  LOG_STDERR_FORMATTER = "Monolog\\Formatter\\JsonFormatter"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 80
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"
  1. Lastest logs:
2022-10-05T07:53:45.284 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:07:53:45 +0000] "GET / HTTP/1.1" 500 211 "-" "Discourse Forum Onebox v2.9.0.beta9"

2022-10-05T07:54:18.418 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:07:54:18 +0000] "GET / HTTP/1.1" 500 211 "https://fly.io/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:02:30.215 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:02:30 +0000] "GET / HTTP/1.1" 500 211 "https://community.fly.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:03:59.251 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:03:59 +0000] "HEAD / HTTP/1.1" 500 192 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

2022-10-05T14:03:59.423 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:03:59 +0000] "GET / HTTP/1.1" 500 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

2022-10-05T14:03:59.800 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:03:59 +0000] "GET / HTTP/1.1" 500 211 "-" "Discourse Forum Onebox v2.9.0.beta9"

2022-10-05T14:04:00.140 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:00 +0000] "GET / HTTP/1.1" 500 211 "-" "Discourse Forum Onebox v2.9.0.beta9"

2022-10-05T14:04:08.711 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:08 +0000] "HEAD / HTTP/1.1" 500 192 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

2022-10-05T14:04:09.034 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:09 +0000] "GET / HTTP/1.1" 500 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

2022-10-05T14:04:09.365 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:09 +0000] "GET / HTTP/1.1" 500 211 "-" "Discourse Forum Onebox v2.9.0.beta9"

2022-10-05T14:04:09.691 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:09 +0000] "GET / HTTP/1.1" 500 211 "-" "Discourse Forum Onebox v2.9.0.beta9"

2022-10-05T14:04:15.539 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:15 +0000] "GET / HTTP/1.1" 500 211 "https://community.fly.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:04:51.104 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:04:51 +0000] "GET / HTTP/1.1" 500 211 "https://community.fly.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:09:05.470 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:09:05 +0000] "GET / HTTP/1.1" 500 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"

2022-10-05T14:22:19.333 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:22:19 +0000] "GET / HTTP/1.1" 500 211 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:22:23.786 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:22:23 +0000] "GET / HTTP/1.1" 500 211 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"

2022-10-05T14:23:04.782 app[8eb3799f] cdg [info] 8eb3799f.vm.lw-www2.internal:80 172.19.8.249 - - [05/Oct/2022:14:23:04 +0000] "GET /en HTTP/1.1" 500 211 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
  1. lw-www2.fly.dev gives 500 errors, and www.lucaswillems.com now works. The screenshot is outdated.

Just to recall: if I deploy to lw-www2.fly.dev from my computer it works, but from the Github CI it doesn’t. In both cases, I deploy the same container.

It’s tough to say without seeing more of your app code. Could you share your apache config or any other parts that can be easily redacted or shared safely? Maybe your PHP.ini if you have one?

Perhaps you can change the log-level on php.ini to get more logs or add some more logging to get more information?

It’s possible this is related to Deploys are still often failing and Deploy timeout on gitlab ci which seem to have timeouts in the CI pipelines during docker build steps.

After 10 hours of debugging I have finaly found the reason of the issue, my app is a Laravel app and it needs to have the right to write in the folder storage. On my computer, it has the right but on the CI, it didn’t…

Thank you everybody for having tried to help me!