Spawn bin/genieacs-ext ENOENT - 1.2-beta.0

I have installed the latest beta, and have copied a working extensions file (cpe-config.js) and as per the install instructions I have placed it in /opt/genieacs/ext/cpe-config.js and call it in my provisioning script with const token=ext("cpe-config", "getToken", null) but I get a fault / error in the logs of spawn bin/genieacs-ext ENOENT

This is a vanilla install of the new GenieACS beta, any idea why this is?

Shouldn’t the path be /opt/genieacs/config/ext?

I have created the Path /opt/genieacs/config/ext with the file cpe-config.js in there and I still get the same error.

Is there an value I need to put into the genieacs.env file to let CWMP know where the extensions are stored?

Think I have found the issue, in lib/extensions.ts, line 46:

const p = spawn("bin/genieacs-ext", [scriptName], {

having changed this to:

 const p = spawn(ROOT_DIR + "bin/genieacs-ext", [scriptName], {

seems to rectify my problem, when executing the ‘ext()’ function, it wasn’t finding genieacs-ext file in bin, and was nothing to do with my script, adding ROOT_DIR to the line, allows it to find genieacs-ext and all is good in the world, not sure if you want to amend the code on GITHUB?

Good catch! Feel free to submit a PR for this fix. Make sure to run ‘npm run lint’ before you commit. Thanks!

is there a possiblity to edit somewhere a file to get run ext scripts I have the same issue on CentOS7 but i dont really find -->>> Think I have found the issue, in lib/extensions.ts, line 46:

can anyone help me :=D

@breakiboy You’d have to download the whole repository, edit lib/extensions.ts and then recompile it.
I can give you a simple workaround (it’s pretty dirty, though): you can actually edit the binary file directly. Search for a file called genieacs-cwmp in your filesystem, edit it and add the mentioned fix. In my case it was in /usr/local/lib/node_modules/genieacs/bin/ . Don’t be scared by the fact that there are some non-readable binary data at the beginning of the file, just skip it. The whole Nodejs code resides there in a minified cleartext form.

1 Like

oh thx dude, I will try it in the next days. Really thank you for the fast response.