{"record":{"id":"9853039f46742124","repo":"flowable/flowable-engine","slug":"provided-ip-address-is-null","errorCode":null,"errorMessage":"Provided ip address is null","messagePattern":"Provided ip address is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java","lineNumber":119,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided tokenDateBefore is null\");\n        }\n        this.tokenDateBefore = tokenDateBefore;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDateAfter(Date tokenDateAfter) {\n        if (tokenDateAfter == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tokenDateAfter is null\");\n        }\n        this.tokenDateAfter = tokenDateAfter;\n        return this;\n    }\n\n    @Override\n    public TokenQuery ipAddress(String ipAddress) {\n        if (ipAddress == null) {\n            throw new FlowableIllegalArgumentException(\"Provided ip address is null\");\n        }\n        this.ipAddress = ipAddress;\n        return this;\n    }\n\n    @Override\n    public TokenQuery ipAddressLike(String ipAddressLike) {\n        if (ipAddressLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided ipAddressLike is null\");\n        }\n        this.ipAddressLike = ipAddressLike;\n        return this;\n    }\n\n    @Override\n    public TokenQuery userAgent(String userAgent) {\n        if (userAgent == null) {\n            throw new FlowableIllegalArgumentException(\"Provided user agent is null\");","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L101-L137","documentation":"Flowable's TokenQueryImpl.ipAddress(String ipAddress) throws FlowableIllegalArgumentException when the ipAddress argument is null. The IP criterion must be a concrete string to be bound as a query parameter; it is validated eagerly in the fluent method.","triggerScenarios":"Calling ipAddress(null) on a TokenQuery, usually when the client IP was not captured (e.g. request.getRemoteAddr() on a proxy-mangled request) or forwarded-header parsing returned null.","commonSituations":"Audit lookups of tokens by originating IP behind reverse proxies where X-Forwarded-For parsing fails; request-scoped values lost outside the web thread; optional filters applied blindly.","solutions":["Capture the IP reliably (resolve X-Forwarded-For with a fallback to remote address) before querying","Apply the filter only when a non-null IP is available","Skip the criterion to query without IP filtering, or reject the request when the IP is required"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().ipAddress(clientIp);\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (clientIp != null) {\n    query.ipAddress(clientIp);\n}","handlingStrategy":"validation","validationCode":"if (clientIp == null) { throw new IllegalArgumentException(\"clientIp must not be null before ipAddress()\"); }","typeGuard":"boolean hasIp(String ip) { return ip != null && !ip.isEmpty(); }","tryCatchPattern":"try { query.ipAddress(ip); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Resolve client IP with fallbacks (X-Forwarded-For, then remote address)","Only apply IP filters when the IP was actually captured","Handle proxy setups explicitly so IP extraction never silently returns null"],"tags":["flowable","idm","query","token","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}