question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when processing larger images on Alpine Linux

See original GitHub issue

Sharp/libvips fails when processing “larger” images on Alpine Linux. The same test works fine on Debian.

Error

(node:111) UnhandledPromiseRejectionWarning: Error: VipsImage: unable to write to "/tmp/vips-0-3199096164.v"
unix error: Not supported
vips2png: unable to write to buffer

A simple test project

The following project reproduces the issue for a large png image. Smaller pngs works fine. Large jpeg images seems to work fine as long as it is resized to a smaller jpeg. https://github.com/bodaniel/sharp-test

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Oct 28, 2018

Hello, to avoid libvips writing temporary files try setting the VIPS_DISC_THRESHOLD environment variable to a value greater than the default of 100MB.

https://libvips.github.io/libvips/API/current/VipsImage.html#vips-image-new-from-file

(Or alternatively provide Docker with a volume mapping for /tmp.)

0reactions
jpsearcommented, Apr 3, 2019

Yup, that worked. For anyone else, for now you can use this in your package.json:

  "resolutions": {
    "sharp": "^0.22.0"
  },

Note: only works with yarn

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker armV7 apk add: script exited with error 127
The hardware platform I use is Cortex-A7. The image I pulled is alpine:latest, and setup build-base by used "apk --no-cache add build-base".
Read more >
docker can't build because of alpine error - Stack Overflow
I'm speaking about the Alpine image. Just change the tag from latest to the one from the week ago and probably the build...
Read more >
Using Alpine can make Python Docker builds 50× slower
Alpine Linux is often recommended as a smaller, faster Docker base image. But if you're using Python, it will slow down your build...
Read more >
Optimizing the image size - DevOps with Docker
The bigger your image is the larger the surface area for an attack is. The following tutorial to ... Alpine Linux provides a...
Read more >
Use Bash With Alpine Based Docker Image | Baeldung on Linux
Predominantly, the Alpine Images are well-known for their smaller size ... docker run -it a3562aa0b991 /bin/bash docker: Error response from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found