{"record":{"id":"2cdf9bfad084b171","repo":"ruvnet/ruflo","slug":"invalid-metrics-port-value-config-metrics-port","errorCode":null,"errorMessage":"Invalid METRICS_PORT value: ${config.METRICS_PORT}","messagePattern":"Invalid METRICS_PORT value: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/metrics.ts","lineNumber":214,"sourceCode":"\t\t\t\t\tageBuckets: 5,\n\t\t\t\t}),\n\t\t\t\ttimeToChooseTools: new Summary<ModelLabel>({\n\t\t\t\t\tname: \"time_to_choose_tools_ms\",\n\t\t\t\t\thelp: \"Time spent selecting tools in milliseconds\",\n\t\t\t\t\tlabelNames,\n\t\t\t\t\tregisters: [registry],\n\t\t\t\t\tmaxAgeSeconds: 5 * 60,\n\t\t\t\t\tageBuckets: 5,\n\t\t\t\t}),\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate startStandaloneServer() {\n\t\tconst port = Number(config.METRICS_PORT || \"5565\");\n\n\t\tif (!Number.isInteger(port) || port < 0 || port > 65535) {\n\t\t\tlogger.warn(`Invalid METRICS_PORT value: ${config.METRICS_PORT}`);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.httpServer = createServer(async (req, res) => {\n\t\t\tif (req.method !== \"GET\") {\n\t\t\t\tres.statusCode = 405;\n\t\t\t\tres.end(\"Method Not Allowed\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst payload = await this.render();\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/plain; version=0.0.4\");\n\t\t\t\tres.end(payload);\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(error, \"Failed to render metrics\");\n\t\t\t\tres.statusCode = 500;\n\t\t\t\tres.end(\"Failed to render metrics\");","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/server/metrics.ts#L196-L232","documentation":"Log warning in startStandaloneServer: config.METRICS_PORT does not parse to a valid integer port (0-65535), so the standalone Prometheus metrics HTTP server is not started.","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/server/metrics.ts:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set METRICS_PORT to a valid port number (1-65535) or unset it to use the default."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}