Page MenuHomePhabricator
Paste P7934

cxserver
ActivePublic

Authored by KartikMistry on Dec 20 2018, 6:55 AM.
Observed in Beta. See: https://cxserver-beta.wmflabs.org/v1
Stack trace:
{
"name": "cxserver",
"hostname": "deployment-sca01",
"pid": 14,
"level": 50,
"message": "500: internal_error",
"stack": "TypeError: Cannot read property key of undefined\n at /srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/src/app.js:126:56\n at Layer.handle [as handle_request] (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/layer.js:95:5)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:137:13)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:131:14)\n at Route.dispatch (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/route.js:112:3)\n at Layer.handle [as handle_request] (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/layer.js:95:5)\n at /srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/index.js:281:22\n at param (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/index.js:354:14)\n at param (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/index.js:365:14)\n at Function.process_params (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/index.js:410:3)\n at next (/srv/deployment/cxserver/deploy-cache/revs/a8e7abf16ba896656ba4f144b96691a5ba9a5a06/node_modules/express/lib/router/index.js:275:10)",
"status": 500,
"type": "internal_error",
"detail": "Cannot read property key of undefined",
"request_id": "d52fd902-0423-11e9-9897-3a6e8d205aec",
"request": {
"url": "/favicon.ico",
"headers": {
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
"x-request-id": "d52fd902-0423-11e9-9897-3a6e8d205aec"
},
"method": "GET",
"params": {
"0": "/favicon.ico"
},
"query": {},
"remoteAddress": "10.68.21.68",
"remotePort": 47674
},
"levelPath": "error/500",
"msg": "500: internal_error",
"time": "2018-12-20T06:52:35.857Z",
"v": 0
}

Event Timeline

Are we missing something in config here? ie key to be defined? I added it in scap/vars.yaml, but result is same.

Related code:

let clientIp = req.headers[ app.ratelimiter._options.key ] ||
    req.headers[ 'x-forwarded-for' ] ||
    req.connection.remoteAddress;
akosiaris edited the content of this paste. (Show Details)Dec 20 2018, 7:59 AM

Actually, you cannot define the key in the ratelimiter section of the config. You should either define it in the service section or hard-code the header you are using.

KartikMistry edited the content of this paste. (Show Details)Dec 20 2018, 8:07 AM

https://gerrit.wikimedia.org/r/#/c/mediawiki/services/cxserver/+/480939 Move the ratelimiter rate and key options to service configuration