-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeated crash on 4.3.2-alpine with no log output #256
Comments
EDIT: it crash when I upload a picture. |
I am able to reproduce this issue consistently by uploading a page image. Reproducible on 4.3.2, not reproducible on 4.2.0 |
@pascalandy Does the issue occur when you upload a page image for a new Page? |
Here it's been crashing when it serves a static content I've uploaded previously. Version: 4.3.2-alpine Using the non-alpine image temporarily fixes the issue. |
I was able to replicate the issue as well. |
If I had to take a guess, I'd imagine the sharp dependency got updated, and we're missing some library somewhere on alpine that's causing the crash. |
Yeah, I remember this sharp thing, thanks for you time :) |
From a core developer from Ghost:
|
This is correct, but the migrations bug isn't related to the issue with alpine. |
definitely looks like sharp is the issue here - it bumped from v0.25 => v0.28 recently, which bumped the required version of libvips |
Not entirely sure what to do here unfortunately.... Sharp v0.28 requires v8.10.6 of libvips, but the latest version available on the 3.13 branch of alpine's package index is 8.10.5 😞 The |
Ok, it's definitely a sharp issue - after doing some additional debugging/adding some log statements I was able to get this:
That said, I'm not experienced enough with C/C++ to know how to fix/debug much further 😕 In the meantime, I'll look and see if there's a way to improve Ghost's validation checks so that it will not run sharp at all if something didn't install correctly. |
Ok - I think I've got at least a temporary solution. Switching back to node 12 for the alpine image fixes the issue for me. Will make a PR for that here shortly. |
refs docker-library#256 - node:14-alpine3.13 has an issue where the underlying sharp image library causes a segfault - node:12-alpine3.12 doesn't appear to have this problem, so we'll use it for now
refs #256 - node:14-alpine3.13 has an issue where the underlying sharp image library causes a segfault - node:12-alpine3.12 doesn't appear to have this problem, so we'll use it for now
the fixed 4-alpine image should hopefully go out today. Will keep this issue open until the underlying issue is discovered/resolved 👍🏻 |
I confirm that rolling back to node 12 fixed the issue for Ghost v4.3.3. See here. |
As this is not the first time sharp is causing trouble, we should create a test in our CI. I guess we need to:
But I don't know how to automate steps 2-3. Here is my Github Action test for my Ghost image. |
Ooof, sharp is causing issues for all non-amd64 architectures too... 🤕
(Debian's libvips is only 8.7.4) |
Hmm, I wonder if that will actually cause an issue with the running container though. Ghost has some checks in the source code and will skip running sharp code if sharp didn't install correctly. The issue afaict with Alpine is that sharp thinks It's installed correctly, and then segfaults whenever there's a call to its code. That isn't to say we shouldn't try and fix sharp on non-amd64, but I'd be interested to know if it actually breaks the container at present. |
All the non-amd64 builds of Ghost 4.x are failing completely (although frankly, the Node + Yarn + gyp error spam is really hard to parse through to find the actual root cause for why it's completely balking). |
(Failing to build, to be clear.) |
ohhhhh ok, didn't realize the build itself was failing. I have some code that I was working with locally earlier to try and debug the alpine issue that was essentially repeating our "force sqlite3 install" process, but for sharp instead of sqlite - I'll see if that approach works for debian. ( |
If you're using Docker Desktop (Mac or Windows) you should be able to get pretty far with |
TIL - thanks! 😄 |
I can confirm it's working now 👍 Thank you! |
Yes, it works with From: https://github.com/firepress-org/ghostfire/blob/master/.github/workflows/build.yml#L256 |
Yep, that's this:
Which turns out to be related to/caused by |
I did figure out why the build error's occurring. In theory, sharp's an optional dep and should just be ignored if the build fails; however, we're force-installing sqlite3 with the --build-from-source option on non-amd64 architectures (or rather, arch w/o pre-built binaries). When we attempt to force install sqlite3, sharp also attempts to reinstall + build from source at the same time. I went down the rabbit hole a bit trying to see if we could get sharp to install/build on non-amd64, and it looks like the only way to get it to work is to upgrade the version of glibc used in Debian Buster, which requires compiling glibc from source, and then (after maybe re-compiling the other intermediary tools used?) compiling libvips from source. I'm not experienced enough with C compilation to really understand all the steps involved, so I probably wouldn't be able to figure out (in a relatively timely manner) how to fix the sharp installation issue. I'm thinking our best bet to fix the Debian build issue is to figure out how to get yarn to not attempt to re-install/recompile sharp from source when we're attempting to install sqlite3. If we're able to do that, sharp will still not be installed, but the Ghost code already knows how to handle that case and will still function |
refs docker-library#256 - add --ignore-optional to sqlite force install so sharp doesn't try and rebuild at the same time
This was fixed and confirm by the Ghost Core team: I was able to build Ghost using |
I'll test updating to node 14 again on alpine to see if it's fixed 👍🏻 |
closes docker-library#256 - sharp's issue has been fixed, node 14 doesn't cause segfaults on alpine anymore
confirmed alpine + node 14 works again 🎉 |
closes #256 - sharp's issue has been fixed, node 14 doesn't cause segfaults on alpine anymore
Container mysteriously exits without error output (
docker logs ghost
shows only a standard restart message).Site shows "We'll be right back" / updating screen during startup.
Tested with SQLite & MySQL.
Downgrading to 4.2.2 appears to fix temporarily.
Multiple other users have reported the same issue.
The text was updated successfully, but these errors were encountered: