UCP node not running - marisql wont build to instal UCP - make failed - missing cdefs.h

I’m running FreePBX 15.0.17.34
Having a problem getting UCP node to run.
Dashboard shows UCP Daemon not running.
Read through many posts and tried:

fwconsole pm2 --list | grep ucp
| ucp | 0 | errored | 60 | 0 | 0% | 0.00B |

When I check ucp_err.log the following repeats:

2021-05-11 15:04 -04:00: { Error: Cannot find module ‘mariasql’
2021-05-11 15:04 -04:00: at Function.Module._resolveFilename (module.js:548:15)
2021-05-11 15:04 -04:00: at Module.Hook._require.Module.require (/var/www/html/admin/modules/pm2/node/node_modules/require-in-the-middle/index.js:61:29)
2021-05-11 15:04 -04:00: at require (internal/module.js:11:18)
2021-05-11 15:04 -04:00: at Object. (/var/www/html/admin/modules/ucp/node/lib/freepbx.js:11:15)
2021-05-11 15:04 -04:00: at Module._compile (module.js:653:30)
2021-05-11 15:04 -04:00: at Object.Module._extensions…js (module.js:664:10)
2021-05-11 15:04 -04:00: at Module.load (module.js:566:32)
2021-05-11 15:04 -04:00: at tryModuleLoad (module.js:506:12)
2021-05-11 15:04 -04:00: at Function.Module._load (module.js:498:3)
2021-05-11 15:04 -04:00: at Module.require (module.js:597:17) code: ‘MODULE_NOT_FOUND’ }

So I tried reinstalling UCP:
fwconsole ma downloadinstall ucp --force

No repos specified, using: [standard,commercial] from last GUI settings

Downloading module ‘ucp’
Processing ucp
Downloading…

Finished downloading
Extracting…Done
Download completed in 6 seconds
Updating tables ucp_sessions…Done
System : sangoma
Installing/Updating Required Libraries. This may take a while…The following messages are ONLY FOR DEBUGGING. Ignore anything that says ‘WARN’ or is just a warning
Found npm-cache v0.7.0
Running installation…
[npm-cache] [INFO] using /home/asterisk/.package_cache as cache directory
[npm-cache] [INFO] [composer] Dependency config file /var/www/html/admin/modules/ucp/node/composer.json does not exist. Skipping install
[npm-cache] [INFO] [npm] config file exists
[npm-cache] [INFO] [npm] cli exists
[npm-cache] [INFO] [npm] hash of /var/www/html/admin/modules/ucp/node/package.json: 76ab6df0c1940daaf47b99501250de86
[npm-cache] [INFO] [npm] running [npm install]…
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: this package is deprecated please use https://www.npmjs.com/package/@xmpp/client
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: this package is deprecated please use https://github.com/xmppjs/xmpp.js

[email protected] install /var/www/html/admin/modules/ucp/node/node_modules/mariasql
node-gyp rebuild

make: Entering directory `/var/www/html/admin/modules/ucp/node/node_modules/mariasql/build’
CXX(target) Release/obj.target/taocrypt/deps/libmariadbclient/extra/yassl/taocrypt/src/aes.o
In file included from /usr/include/stdlib.h:24:0,
from …/deps/libmariadbclient/extra/yassl/taocrypt/include/misc.hpp:26,
from …/deps/libmariadbclient/extra/yassl/taocrypt/include/aes.hpp:26,
from …/deps/libmariadbclient/extra/yassl/taocrypt/src/aes.cpp:27:
/usr/include/features.h:375:25: fatal error: sys/cdefs.h: No such file or directory

include <sys/cdefs.h>

                     ^

compilation terminated.
make: Leaving directory /var/www/html/admin/modules/ucp/node/node_modules/mariasql/build' make: *** [Release/obj.target/taocrypt/deps/libmariadbclient/extra/yassl/taocrypt/src/aes.o] Error 1 gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 5.4.73-1-pve
gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /var/www/html/admin/modules/ucp/node/node_modules/mariasql
gyp ERR! node -v v8.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of [email protected]^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/asterisk/.npm/_logs/2021-05-11T23_35_20_879Z-debug.log
[npm-cache] [ERROR] [npm] error running npm install
[npm-cache] [ERROR] error installing dependencies

Failed updating libraries!
Stopping old running processes…Done
Refreshing all UCP Assets, this could take a while…
Generating Module Scripts…Done
Generating Module CSS…Done
Generating Main Scripts…Done
Generating Main CSS…Done
Done!
Generating CSS…Done
Module ucp version 15.0.6.26 successfully installed
Updating Hooks…Done
Chowning directories…Done

I did some more experimenting.

So it appears the file sys/cdefs.h can not be found (in /usr/include)
As an experiment I created an empty sys/cdefs.h
This got an error looking for sys/types.h
Created an empty file for this.
Reran fwconsole ma downloadinstall ucp --force

Now I get a bunch of build errors (expectedly) because the above basic include files are missing.

What should be reinstalled to repopulate the /usr/include/sys directory?

After more exploring, glibc-devel and glibc-headers packages said they were installed but usr/include/sys was empty where their files should have been. Reinstalled these and UCB rebuilt and installed.

Problem solved.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.