ubergeek77 / Lemmy-Easy-Deploy

Deploy Lemmy the easy way!
MIT License
133 stars 14 forks source link

xcaddy failure #65

Closed MarsAgainstVenus closed 1 year ago

MarsAgainstVenus commented 1 year ago

Did you check the FAQ & Troubleshooting section for answers to common questions and issues?

Yes

Describe the issue

I ran sudo ./deploy.sh but the script times out during RUN xcaddy build with this message:


=> => # go: downloading github.com/spaolacci/murmur3 v1.1.0                                               
=> => # go: downloading github.com/google/s2a-go v0.1.4                                                   
=> => # go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.5                         
=> => # go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da                   
=> => # 2023/08/10 16:14:54 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go build -o
=> => #  /usr/bin/caddy -ldflags -w -s -trimpath```

Diagnostic Information

Run ./deploy.sh -d and paste the output below:


==== Docker Information ====
Detected runtime: docker (Docker version 24.0.5, build ced0996)
Detected compose: docker compose (Docker Compose version v2.20.2)
Runtime state: OK

==== System Information ==== OS: Linux KERNEL: 5.15.0-1038-gcp (x86_64) HOSTNAME: OK SHELL: bash MEMORY: total used free shared buff/cache available Mem: 953Mi 266Mi 272Mi 12Mi 414Mi 518Mi Swap: 0B 0B 0B

DISTRO:

NAME="Ubuntu" PRETTY_NAME="Ubuntu 20.04.6 LTS" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

==== Lemmy-Easy-Deploy Information ==== Version: 1.3.0

IMAGE CREATED STATUS

Integrity: 0d3e213450ba646ab61881103a7ffcb2283b8152f36fff97ab735a704f069aa7 ./deploy.sh 587ca168ac5a0d1644df650d100711197c66fb6bf854f7cce0e29df35369e9c1 ./templates/Caddy-Dockerfile.template c1202e70662dd2228da36a35a0f38ec8fc81bec8964d7315d02e8671a58dd7d7 ./templates/Caddyfile.template 2537678c7971df36c1ed95f4228d3cfcb15bb4a28a60d939eaf8dd75b5d64a36 ./templates/cloudflare.snip c494a610bcb4cd1cfc0a4fe4fb0f6d437b2a84a0ad1625daee240e6dd6f1c910 ./templates/compose-email-volumes.snip c9cb4c5fee12930e17798a02ae1bd12e2dc69e149a394c24511bc9d4e6b776d4 ./templates/compose-email.snip f5325a9e26b29da51c6d3295aa278ff08ce71ffd2cd63dc4bebf00e54c468899 ./templates/docker-compose.yml.template 1c202b1b6e87c65b2fcda6035c9fe3f8631d76662907ffd38f24b14686e30647 ./templates/lemmy-email.snip c834cdce9eaf77f38155b404724fdfe66845575386ee516987452aa715642a6f ./templates/lemmy.hjson.template

Custom Files: No custom files

==== Settings ==== CLOUDFLARE: Yes CADDY_DISABLE_TLS: false CADDY_HTTP_PORT: 80 CADDY_HTTPS_PORT: 443 LEMMY_TLS_ENABLED: true ENABLE_EMAIL: false SMTP_PORT: 25 ENABLE_POSTFIX: false POSTGRES_POOL_SIZE: 5

==== Generated Files ==== Deploy Version: 0.18.3;0.18.3

total 36K drwxr-xr-x 2 0 0 4.0K Jul 26 19:40 caddy -rw-r--r-- 1 0 0 81 Aug 10 16:23 caddy.env -rw-r--r-- 1 0 0 1.7K Aug 10 16:23 docker-compose.yml -rw-r--r-- 1 0 0 50 Jul 26 19:40 lemmy.env -rw-r--r-- 1 0 0 461 Aug 10 16:23 lemmy.hjson -rw-r--r-- 1 0 0 49 Jul 26 19:40 pictrs.env -rw-r--r-- 1 0 0 31 Aug 10 16:23 postfix.env -rw-r--r-- 1 0 0 51 Jul 26 19:40 postgres.env -rw-r--r-- 1 0 0 14 Jul 28 14:39 version

ubergeek77 commented 1 year ago

This looks like a temporary network error on your end when pulling sources from GitHub. Please try the build again!

MarsAgainstVenus commented 1 year ago

I've tried a few times over the last 24 hours. It happens every time.

ubergeek77 commented 1 year ago

Do you see any other errors that you might have omitted from your logs?

It looks like you're running into these upstream issues in Go that I don't have any control over:

https://www.github.com/caddyserver/caddy/issues/5301

https://www.github.com/golang/go/issues/56494

ubergeek77 commented 1 year ago

You can potentially avoid this issue by running docker builder prune and trying the deployment again.

ubergeek77 commented 1 year ago

This seems to be part of a much bigger issue impacting a lot of people...

https://www.github.com/greenpau/caddy-security/issues/254

MarsAgainstVenus commented 1 year ago

I just tried the prune route and am getting the same failures. I'll see if there's anything else I can do.

ubergeek77 commented 1 year ago

I'm not sure what else to suggest, my apologies. In 1.3.0 I locked Caddy to a certain version to avoid such errors.

Are you still having issues?

MarsAgainstVenus commented 1 year ago

Yeah... Still having the same issues. I've tried it a few more times but always the same thing. I'm just sticking with 18.3 for now and I'll see if I can jump to 18.5 whenever it's released.

MarsAgainstVenus commented 1 year ago

What is the issue with the latest Caddy release? I wonder if I could update to 2.7.4 manually and try again...

These notes were posted on 2.7.4 and references issues with GO: "Caddy 2.7.4 rounds out some bug fixes from the 2.7 release. For example, Go made a last-minute breaking change to a new API that broke quic-go (HTTP/3) on Go 1.21 just before Go 1.21 was released; we resolved a few issues with on-demand TLS that are now much improved from the 2.6 tree; a couple race conditions were fixed in dynamic reverse proxy upstreams. We hope you will be pleased with this new version!"

MarsAgainstVenus commented 1 year ago

UPDATE!

After rolling back the latest changes to this file templates/Caddy-Dockerfile.template I was able to finally install Lemmy 18.4.

FROM caddy:builder AS builder

RUN xcaddy build \
    --with github.com/caddy-dns/cloudflare

FROM caddy:latest

COPY --from=builder /usr/bin/caddy /usr/bin/caddy
ubergeek77 commented 1 year ago

Sorry, I'm in the process of moving so I'll be quite busy for a few weeks

What is the issue with the latest Caddy release? I wonder if I could update to 2.7.4 manually and try again...

They failed to publish an updated version of their Docker container for a week, and additionally closed/locked all of my requests to tag the Cloudflare plugin to a specific version. I added those changes to the template to work around how inflexible Caddy is on keeping their official plugins working on specific versions of Caddy.

It seems like that issue has been resolved, but I would like to learn more about why my changes failed to begin with. There might have been some upstream changes in dependencies they pull that had issues, 2.7.2 was an enormous mess.

For now, I'll revert those changes since it seems Caddy finally got their act together, but in the future I'll keep an eye out for issues like this.

I really appreciate your thorough investigation, you saved me a lot of diagnostic time 🙏

ubergeek77 commented 1 year ago

I've reverted that change to the template, and bumped the version number to 1.3.1. That should officially include the changes you made, so please let me know if you have any further issues!

MarsAgainstVenus commented 1 year ago

No worries! I had a little bit of free time so I'm glad I was able to help out!