versx / DeviceConfigManager

Central config repository for device config management using macless RealDeviceMap solutions.
19 stars 17 forks source link

[BUG] Strange log entries #90

Open nappa85 opened 3 years ago

nappa85 commented 3 years ago

My running DCM log is full of

BadRequestError: request aborted
    at IncomingMessage.onAborted (/app/node_modules/raw-body/index.js:231:10)
    at IncomingMessage.emit (events.js:314:20)
    at abortIncoming (_http_server.js:535:9)
    at socketOnClose (_http_server.js:528:3)
    at Socket.emit (events.js:326:22)
    at TCP.<anonymous> (net.js:673:12)

Somethimes also

(node:19) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'match' of undefined
    at /app/src/routes/api.js:413:143
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is it something I should worry about? Can this exception be handled? More, it seems that it can't recover from a lost MySQL connection, I'm having some minor problems with MySQL reachability and DCM is the only software I have to force-restart.

versx commented 3 years ago

OS distro and version? Node version? Npm version? Mysql version? DCM version? Using cloudflare?

Request aborted should only occur occasionally tbh, if it's frequent then you have a big-ish issue. Do you use proxies and do they have access to local resources?

I honestly don't ever have to restart DCM other than doing it occasionally (every few months to update it) so I think it can recover from failed mysql connections just fine.

The second error is pointing here: https://github.com/versx/DeviceConfigManager/blob/master/src/routes/api.js#L413 which leads me to believe a CF or proxy issue although you said that it only happens sometimes. 🤔

nappa85 commented 3 years ago

Sorry for the late reply

OS distro and version? docker (alpine) Node version? 12.16.2 Npm version? 6.14.4 Mysql version? 5.7.33 DCM version? latest master branch Using cloudflare? Yes, but clients are using public IP, so I think cloudflare is skipped

versx commented 3 years ago

Sorry for the late reply

OS distro and version? docker (alpine) Node version? 12.16.2 Npm version? 6.14.4 Mysql version? 5.7.33 DCM version? latest master branch Using cloudflare? Yes, but clients are using public IP, so I think cloudflare is skipped

Is this still an issue? CF is still used/routed if client is using public IP address to connect.