Open tylerhutcherson opened 2 years ago
@cjus Our app in question is already using the following package.json:
{
"name": "shopify-webhooks-v1-svcs",
"version": "0.1.3",
"description": "Shopify Webhooks",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"redis": "2.8.0",
"hydra-express": "1.8.3",
"hydra-express-plugin-jwt-simple-auth": "0.1.0",
"hydra-plugin-hls": "0.2.6",
"node-fetch": "2.6.1"
},
"devDependencies": {
"eslint": "7.15.0",
"eslint-config-google": "0.14.0"
}
}
Looks like our app has the dependency, but the hydra-plugin-hls
is not getting loaded/configured for us with hydraExpress
. Our app has the following imports:
const hydraExpress = require('hydra-express');
const express = hydraExpress.getExpress();
const hydra = hydraExpress.getHydra();
const ServerResponse = hydra.getServerResponseHelper();
const serverResponse = new ServerResponse;
const api = new express.Router();
Am I correct that the proper import for hls plugin would be:
const hydraExpress = require('hydra-express');
const HydraLogPlugin = require('hydra-plugin-hls/hydra-express');
hydraExpress.use(new HydraLogPlugin);
const express = hydraExpress.getExpress();
const hydra = hydraExpress.getHydra();
const ServerResponse = hydra.getServerResponseHelper();
const serverResponse = new ServerResponse;
const api = new express.Router();
I tested this update on our app, yet I still get the same error thrown by the hydra-express
lib above.
@tylerhutcherson is there any chance that your exception is occurring before the logging plugin is bound? Happy to help debug this via zoom. You have my contact info.
@tylerhutcherson is there any chance that your exception is occurring before the logging plugin is bound? Happy to help debug this via zoom. You have my contact info.
It appears the true exception under the hood was an express PayloadTooLargeError
described here. This was being covered up by the error posted above. When I removed the hydra logging plugin entirely, the exception passed through, enabling us to debug the real issue.
However - the error above seems to happen when there is a fatal
log-level error inside the middleware.
This is currently non-blocking for us at the moment, however, I can leave this open if you want, or we can take the discussion offline and report back.
An error in my Node JS application is throwing a hydra-express related exception (and covering up the real issue on my end):
Based on the trace, I believe the culprit is here: https://github.com/pnxtech/hydra-express/blob/b4871209d81aa19c1b402c84e0cc6a4593d8a3b4/index.js#L487 and should use
this.log('fatal', {msg})
instead.We are running with the following dependencies: