wa-sticker-formatter icon indicating copy to clipboard operation
wa-sticker-formatter copied to clipboard

error when run on vps ubuntu 20.04 ARMv8 x64

Open erickythierry opened this issue 2 years ago • 4 comments

hello. I tried to run the example code below:

const { Sticker } = require('wa-sticker-formatter')

const image = 'https://c.tenor.com/WZBvSgw5JMgAAAAC/watson-amelia-amelia-watson.gif'


const stickerMetadata = {
    type: 'full',
    pack: 'watson',
    author: 'amelia',
    categories: [
        '🌹'
    ]
}
const sticker = new Sticker(image, stickerMetadata).build()

and I returned this error that I didn't understand:

node:child_process:397
      ex = new Error('Command failed: ' + cmd + '\n' + stderr);
           ^

Error: Command failed: "/app/node_modules/wa-sticker-formatter/bin/libwebp_linux/bin/gif2webp" /tmp/0.5qhsrtj739g.gif -o /tmp/0.5qhsrtj739g.webp
/bin/sh: 1: /app/node_modules/wa-sticker-formatter/bin/libwebp_linux/bin/gif2webp: Exec format error

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:394:28)
    at Pipe.<anonymous> (node:net:672:12) {
  killed: false,
  code: 2,
  signal: null,
  cmd: '"/app/node_modules/wa-sticker-formatter/bin/libwebp_linux/bin/gif2webp" /tmp/0.5qhsrtj739g.gif -o /tmp/0.5qhsrtj739g.webp',
  stdout: '',
  stderr: '/bin/sh: 1: /app/node_modules/wa-sticker-formatter/bin/libwebp_linux/bin/gif2webp: Exec format error\n'
}

is this some incompatibility with ARM systems?

erickythierry avatar Aug 26 '21 18:08 erickythierry

I'm using an oracle vps with arm ampere processors

erickythierry avatar Aug 26 '21 18:08 erickythierry

v3 does not work on arm. Upgrade to v4, which does not include any libwebp binaries, uses sharp and works on arm

AlenVelocity avatar Aug 27 '21 04:08 AlenVelocity

v3 does not work on arm. Upgrade to v4, which does not include any libwebp binaries, uses sharp and works on arm

Thanks for the quick response

I did a clean install using version 4.0.3 and the code didn't show any more errors

but now I have another problem. the function executes but freezes and starts to allocate ram until it runs out analyzing the executed processes, i identified that it is the ffmpeg that starts to execute and occupy all the ram memory. I'm using the readme sample code. this situation occurs both in vps ARM ubuntu as well as on my intel pc with windows.

any idea why this anomaly?

erickythierry avatar Aug 27 '21 18:08 erickythierry

v3 does not work on arm. Upgrade to v4, which does not include any libwebp binaries, uses sharp and works on arm

Thanks for the quick response

I did a clean install using version 4.0.3 and the code didn't show any more errors

but now I have another problem. the function executes but freezes and starts to allocate ram until it runs out analyzing the executed processes, i identified that it is the ffmpeg that starts to execute and occupy all the ram memory. I'm using the readme sample code. this situation occurs both in vps ARM ubuntu as well as on my intel pc with windows.

any idea why this anomaly?

i did some tests now, and this problem occurs with mp4 and gif. but with jpg, png or webp the problem does not occur

erickythierry avatar Aug 27 '21 18:08 erickythierry

@erickythierry can you share the file or url that causes the issue? I'd like to try to replicate it. I'm currently running this on an Ampere OCI and it works.

Helvio88 avatar Feb 09 '23 17:02 Helvio88

@erickythierry can you share the file or url that causes the issue? I'd like to try to replicate it. I'm currently running this on an Ampere OCI and it works.

currently is already functioning normally in arm architecture, the problem was in version 3.xx or lower, it was an incompatibility with a dependency that had no version available to arm at the time (2 years ago approximately)

erickythierry avatar Feb 09 '23 19:02 erickythierry

Thank you for confirming. I'll close the issue, then!

Helvio88 avatar Feb 09 '23 19:02 Helvio88