langgenius / dify-sandbox

A lightweight, fast, and secure code execution environment that supports multiple programming languages
https://docs.dify.ai/development/backend/sandbox
Apache License 2.0
441 stars 97 forks source link

node execute javascript fail once in a while #100

Open guogeer opened 1 month ago

guogeer commented 1 month ago

it is a accidental bug screenshot-20241017-135017

code:

function main({arg1}) {
    return {
        result: JSON.stringify(arg1)
    }
}

error: 20.11.1 dbox-459e0614-a459-4bbe-8cf1-70b824f02d4a/var/sandbox/sandbox-nodejs/nodejs-project/node_temp/node_temp/node_modules/koffi/index.js:562 let lib = load(...args); ^ Error: Failed to load shared library: cannot open shared object file: No such file or directory at module.exports.load (/tmp/sandbox-459e0614-a459-4bbe-8cf1-70b824f02d4a/var/sandbox/sandbox-nodejs/nodejs-project/node_temp/node_temp/node_modules/koffi/index.js:562:13) at Object. (/tmp/sandbox-459e0614-a459-4bbe-8cf1-70b824f02d4a/var/sandbox/sandbox-nodejs/nodejs-project/node_temp/node_temp/test.js:4:19) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49 Node.js v20.11.1 error: exit status 1