Registering API in kibana failed so I tried to do same api calls with curl and it happened to break down API.
Hi team,
I have an issue with wazuh api, hope you might help me to fix it.
Registering API in kibana failed so I tried to do same api calls with curl and it happened to break down API.
example:
{"error":3,"message":"Internal error"}
logs:
WazuhAPI 2019-10-15 14:33:21 foo: Internal Error
WazuhAPI 2019-10-15 14:33:21 foo: TypeError: Cannot read property 'on' of undefined
at Object.exports.exec (/var/ossec/api/helpers/execute.js:70:18)
at /var/ossec/api/controllers/agents.js:490:13
at Layer.handle [as handle_request] (/var/ossec/api/node_modules/express/lib/router/layer.js:95:5)
at next (/var/ossec/api/node_modules/express/lib/router/route.js:137:13)
at buildCacheObj (/var/ossec/api/node_modules/apicache/lib/apicache.js:241:9)
at cache (/var/ossec/api/node_modules/apicache/lib/apicache.js:188:9)
at Layer.handle [as handle_request] (/var/ossec/api/node_modules/express/lib/router/layer.js:95:5)
at next (/var/ossec/api/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/var/ossec/api/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/var/ossec/api/node_modules/express/lib/router/layer.js:95:5)
WazuhAPI 2019-10-15 14:33:21 foo: Exiting...
WazuhAPI 2019-10-15 14:33:21 foo: [127.0.0.1] GET /agents/000 - 500 - error: '3'.
WazuhAPI 2019-10-15 14:33:21 foo: Internal Error: uncaughtException
WazuhAPI 2019-10-15 14:33:21 foo: Error: spawn /var/ossec/framework/python/bin/python3 EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
WazuhAPI 2019-10-15 14:33:21 foo: Exiting...
WazuhAPI 2019-10-15 14:33:21 foo: Internal Error: uncaughtException
WazuhAPI 2019-10-15 14:33:21 foo: TypeError: Cannot read property 'setEncoding' of undefined
at Timeout._onTimeout (/var/ossec/api/helpers/execute.js:65:25)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
WazuhAPI 2019-10-15 14:33:21 foo: Exiting...
The only change I did to default installation is to tamper with client.keys file - I've added several agents from previous installation.
1. Is there a quick way to fix this error, or reinstall is the best way to deal with it?
2. How can I properly import client.keys from another server?