{"record":{"id":"766e964e40b8db22","repo":"flowable/flowable-engine","slug":"provided-tenant-id-is-null-766e96","errorCode":null,"errorMessage":"Provided tenant id is null","messagePattern":"Provided tenant id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java","lineNumber":469,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery exceptionMessage(String exceptionMessage) {\n        if (exceptionMessage == null) {\n            throw new FlowableIllegalArgumentException(\"Provided exception message is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.exceptionMessage = exceptionMessage;\n        } else {\n            this.exceptionMessage = exceptionMessage;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery jobTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tenant id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.tenantId = tenantId;\n        } else {\n            this.tenantId = tenantId;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery jobTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tenant id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.tenantIdLike = tenantIdLike;\n        } else {\n            this.tenantIdLike = tenantIdLike;","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L451-L487","documentation":"ExternalWorkerJobQueryImpl.jobTenantId(String) rejects a null tenant id because a null would build an invalid equality predicate on TENANT_ID_. Flowable validates required query arguments eagerly with FlowableIllegalArgumentException. Use jobTenantIdLike() or omit the filter for cross-tenant queries.","triggerScenarios":"Calling jobTenantId(null), e.g. when the tenant context was not resolved (no authenticated tenant) or a TenantInfo lookup returned null.","commonSituations":"Multi-tenant deployments where tenant resolution fails silently; async executors losing tenant context; misconfigured tenant providers.","solutions":["Resolve the tenant id before building the query and fail earlier with a clear error if absent","Skip the jobTenantId() call when the query should span all tenants","Default to a known tenant id constant when context is missing and that is safe","Check the tenant context provider/interceptor configuration so tenant ids are always populated"],"exampleFix":"// before\nquery.jobTenantId(tenantContext.getCurrentTenantId()); // null outside tenant scope\n// after\nString tenantId = tenantContext.getCurrentTenantId();\nif (tenantId != null) {\n    query.jobTenantId(tenantId);\n}","handlingStrategy":"validation","validationCode":"String tenantId = tenantContext.getCurrentTenantId();\nif (tenantId == null) {\n    throw new IllegalStateException(\"Tenant context not resolved\");\n}\nexternalWorkerJobQuery.jobTenantId(tenantId);","typeGuard":"boolean hasTenant(String t) { return t != null && !t.trim().isEmpty(); }","tryCatchPattern":null,"preventionTips":["Resolve tenant context before building queries","Audit tenant provider/interceptor configuration in async paths","Skip tenant filters explicitly when querying across tenants is intended"],"tags":["flowable","null-argument","multi-tenancy"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}