{"record":{"id":"cd05a3123f7ab13e","repo":"apache/shenyu","slug":"114-please-check-cryptor-request-plugin-s-fieldnames","errorCode":"-114","errorMessage":"Please check Cryptor request plugin's [fieldNames]","messagePattern":"Please check Cryptor request plugin's \\[fieldNames\\]","errorType":"error_code","errorClass":"ResponsiveException","httpStatus":null,"severity":"error","filePath":"shenyu-plugin/shenyu-plugin-security/shenyu-plugin-cryptor/src/main/java/org/apache/shenyu/plugin/cryptor/plugin/CryptorRequestPlugin.java","lineNumber":72,"sourceCode":"        return ServerWebExchangeUtils.rewriteRequestBody(exchange, messageReaders, originalBody ->\n                        Mono.just(convert(originalBody, ruleHandle, exchange))\n                ).flatMap(chain::execute)\n                .onErrorResume(error -> {\n                    if (error instanceof ResponsiveException) {\n                        return WebFluxResultUtils.failedResult((ResponsiveException) error);\n                    }\n                    return Mono.error(error);\n                });\n    }\n\n    @Override\n    protected ShenyuResultEnum checkErrorEnum() {\n        return ShenyuResultEnum.CRYPTOR_REQUEST_ERROR_CONFIGURATION;\n    }\n\n    @Override\n    protected String fieldErrorParse(final String originalBody, final ServerWebExchange exchange) {\n        throw new ResponsiveException(ShenyuResultEnum.CRYPTOR_REQUEST_ERROR_CONFIGURATION.getCode(), ShenyuResultEnum.CRYPTOR_REQUEST_ERROR_CONFIGURATION.getMsg() + \"[fieldNames]\", exchange);\n    }\n\n    @Override\n    public int getOrder() {\n        return PluginEnum.CRYPTOR_REQUEST.getCode();\n    }\n\n    @Override\n    public String named() {\n        return PluginEnum.CRYPTOR_REQUEST.getName();\n    }\n\n}\n","sourceCodeStart":54,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-plugin/shenyu-plugin-security/shenyu-plugin-cryptor/src/main/java/org/apache/shenyu/plugin/cryptor/plugin/CryptorRequestPlugin.java#L54-L86","documentation":"The cryptor-request plugin found a matched rule/selector but the configuration has no 'fieldNames' entry, so it does not know which JSON fields to encrypt or decrypt. The abstract cryptor handler treats this as an unrecoverable configuration error and throws a ResponsiveException with code -114 (CRYPTOR_REQUEST_ERROR_CONFIGURATION) appended with '[fieldNames]'. It indicates a bad plugin rule configuration on the ShenYu admin side, not a problem with the incoming request.","triggerScenarios":"A request matches a cryptor-request selector/rule whose RuleData was created without the 'fieldNames' field being set in the admin dashboard (or the fieldNames JSON key was removed/renamed when editing the rule config).","commonSituations":"Operators hand-editing rule JSON in the admin console and omitting fieldNames; data-sync producing a rule with an empty fieldNames; version upgrades where the cryptor rule schema keys changed but old DB rows were not migrated.","solutions":["Open the ShenYu admin dashboard, find the cryptor-request plugin rule that matched this request, and set the 'fieldNames' property (comma-separated list of JSON fields to encrypt/decrypt).","If you cannot identify the rule, temporarily enable debug logging on the cryptor plugin to see which selector/rule matched, then fix that rule's config.","Check the rule data stored in the database (plugin_rule table) for the cryptor plugin and add the missing fieldNames key, then trigger a config sync to the gateway.","If the rule should not apply to this path, adjust the selector/rule match conditions so the request no longer hits the misconfigured rule."],"exampleFix":"// rule config before (admin rule JSON)\n{\"strategy\":\"encrypt\",\"digestAlgorithm\":\"MD5\"}\n// after\n{\"strategy\":\"encrypt\",\"digestAlgorithm\":\"MD5\",\"fieldNames\":\"password,phone\"}","handlingStrategy":"validation","validationCode":"// Before creating/updating a cryptor-request rule (admin side)\nObject fieldNames = ruleConfig.get(\"fieldNames\");\nif (fieldNames == null || fieldNames.toString().isBlank()) {\n    throw new IllegalArgumentException(\"cryptor-request rule requires non-empty fieldNames\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return chain.execute(exchange);\n} catch (ResponsiveException e) {\n    if (e.getCode() == -114) { /* fix rule config: missing fieldNames */ }\n    throw e;\n}","preventionTips":["Always fill fieldNames when configuring cryptor-request rules in the dashboard.","Add a save-time validation in admin for cryptor rule configs.","After DB edits, verify the synced rule JSON contains fieldNames before routing traffic."],"tags":["gateway-plugin","configuration","cryptor","request-transform"],"backgroundTag":"missing-required-config-field","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}