nextcloud / translate

A Machine translation provider using Opus models by University of Helsinki running locally on CPU
11 stars 1 forks source link

Runtime Exception: Translate process failed after update Nextcloud AIO to v7.0.0 #27

Open IntegrITSol opened 1 year ago

IntegrITSol commented 1 year ago

Hi, I get this RuntimeException on my Nextcloud instance after the update, when trying to translate a Talk message. Language models are downloaded successfully.

This is what I find in the admin logs:

[translate] Warning: node:internal/modules/cjs/loader:1243 return process.dlopen(module, path.toNamespacedPath(filename)); ^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /var/www/html/custom_apps/translate/node_modules/onnxruntime-node/bin/napi-v3/linux/x64//libonnxruntime.so.1.13.1) at Module._extensions..node (node:internal/modules/cjs/loader:1243:18) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/var/www/html/custom_apps/translate/node_modules/onnxruntime-node/dist/binding.js:9:1) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) { code: 'ERR_DLOPEN_FAILED' }

Node.js v18.12.1

POST /ocs/v2.php/translation/translate from 78.42.139.249 by admin at 2023-08-23T22:48:37+00:00

Do you have any idea how to fix it?

marcelklehr commented 1 year ago

Are you on linux? Are you on x86_64? Do you have a system with GNU libc?

integrITsolutions commented 1 year ago

Yes, it's a DigitalOcean CVM

Docker 23.0.6 on Ubuntu 22.04 4 GB Memory / 2 AMD vCPUs

This is the cmd output for ldd --version:

ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.

And uname -a:

Linux nextcloud-docker-generic #86-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

teambvd commented 1 year ago

Yes, it's a DigitalOcean CVM And uname -a:

Linux nextcloud-docker-generic #86-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

You're showing the output from the host itself, not from the docker container. Per their dockerfile, Nextcloud AIO is Alpine based, meaning you're using musl, not glibc, which isn't compatible.

You can try to get this to work using something like gcompat (or several other options), though keep in mind that for this to be a fully 'validated/tested' config, you'll need to convert to using a glibc based container/distribution.

marcelklehr commented 1 year ago

I think I've found a way to make this work on AIO: Using onnxruntime-web from npm we can run the models in WASM which should be possible without glibc

guerby commented 2 weeks ago

I think I've found a way to make this work on AIO: Using onnxruntime-web from npm we can run the models in WASM which should be possible without glibc

Note that text2image_stablediffusion has the exact same issue and so doesn't work on nextcloud 29.0.8 AIO, don't know if it's fixed on 30.0 (not released in stable channel for AIO yet)

1c6fa9d9e32c:/var/www/html/custom_apps/text2image_stablediffusion$ ./bin/node src/stablediffusion.mjs "sun" 1
node:internal/modules/cjs/loader:1243
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /var/www/html/custom_apps/text2image_stablediffusion/node_modules/onnxruntime-node/bin/napi-v3/linux/x64//libonnxruntime.so.1.15.1)
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/var/www/html/custom_apps/text2image_stablediffusion/node_modules/onnxruntime-node/dist/binding.js:9:1)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.12.1