Skip to content
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

arm64 support? #264

Closed
jonasbg opened this issue Aug 13, 2021 · 4 comments · Fixed by #281
Closed

arm64 support? #264

jonasbg opened this issue Aug 13, 2021 · 4 comments · Fixed by #281

Comments

@jonasbg
Copy link

jonasbg commented Aug 13, 2021

Hi

I am having troubling with arm64 support. I would like to use image optimization, but I get an error when I'm enabling this. It looks like it is disabled by default? Which is the opposite of what Ghost documentation states it is.

Image: ghost:4 (tested for alpine and debian)
"Image": "sha256:b07775c88fc91a454477ce2947a9a7242d77e1f0140f6ffc79e601c2cfff35fb"

The error message that I receive is that sharp is not installed. Why isn't sharp installed in the default image for arm64?

InternalServerError: Sharp wasn't installed
    at Object.resizeFromPath (/var/lib/ghost/versions/4.11.0/node_modules/@tryghost/image-transform/lib/transform.js:81:31)
    at normalize (/var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/normalize-image.js:24:20)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/route.js:137:13)
    at uploadValidation (/var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/upload.js:88:9)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/route.js:137:13)
    at /var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/upload.js:42:9
    at Immediate._onImmediate (/var/lib/ghost/versions/4.11.0/node_modules/multer/lib/make-middleware.js:53:37)
    at processImmediate (internal/timers.js:466:21)

Error: Cannot find module 'sharp'
Require stack:
- /var/lib/ghost/versions/4.11.0/node_modules/@tryghost/image-transform/lib/transform.js
- /var/lib/ghost/versions/4.11.0/node_modules/@tryghost/image-transform/index.js
- /var/lib/ghost/versions/4.11.0/core/server/lib/mobiledoc.js
- /var/lib/ghost/versions/4.11.0/core/server/models/post.js
- /var/lib/ghost/versions/4.11.0/core/server/models/index.js
- /var/lib/ghost/versions/4.11.0/core/boot.js
- /var/lib/ghost/versions/4.11.0/ghost.js
- /var/lib/ghost/versions/4.11.0/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.resizeFromPath (/var/lib/ghost/versions/4.11.0/node_modules/@tryghost/image-transform/lib/transform.js:79:9)
    at normalize (/var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/normalize-image.js:24:20)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/route.js:137:13)
    at uploadValidation (/var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/upload.js:88:9)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/4.11.0/node_modules/express/lib/router/route.js:137:13)
    at /var/lib/ghost/versions/4.11.0/core/server/web/api/middleware/upload.js:42:9
    at Immediate._onImmediate (/var/lib/ghost/versions/4.11.0/node_modules/multer/lib/make-middleware.js:53:37)
    at processImmediate (internal/timers.js:466:21)
@acburdine
Copy link
Collaborator

@jonasbg is this actually causing issues (i.e. breaking image uploads/crashing the site)? there are certain cases where the sharp binary isn't able to be installed due to libvips compatibility issues, but in this case Ghost should handle the error and just opt not to auto-resize images. If it's causing an error on upload or crashing the site entirely, then that's likely a bug in Ghost itself.

@jonasbg
Copy link
Author

jonasbg commented Aug 14, 2021

It is not causing any error, ghost just disables image resize and optimization. I figure its about libvips compatibility issues. But I can't find it documented anywhere that this is causing issues, even though the site don't break, I do take a lot of photos, so those end up taking a lot of bandwidth when the client downloads full-res images.

Should libvips be installed as default on the official image for arm64?

@acburdine
Copy link
Collaborator

When we looked at this issue last for both the alpine and the debian distributions (see #256 for more context) I believe there were issues between the default version of libvips included on those distributions, and the version of libvips that newer versions of Sharp depend on. There were also issues with glibc incompatibilities as well.

@tianon
Copy link
Member

tianon commented Aug 16, 2021

🤔 maybe docker-library/official-images#10730 will help, since Bullseye has a newer version of libvips? 😄

(I guess we've gotta wait for the node folks to release a Bullseye-based image.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants