{"record":{"id":"7db6f8f1e022e91b","repo":"flowable/flowable-engine","slug":"provided-tentant-id-is-null-7db6f8","errorCode":null,"errorMessage":"Provided tentant id is null","messagePattern":"Provided tentant id is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java","lineNumber":187,"sourceCode":"    @Override\n    public TimerJobQuery withException() {\n        this.withException = true;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery exceptionMessage(String exceptionMessage) {\n        if (exceptionMessage == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided exception message is null\");\n        }\n        this.exceptionMessage = exceptionMessage;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobTenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided tentant id is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new ActivitiIllegalArgumentException(\"Provided tentant id is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public TimerJobQuery jobWithoutTenantId() {\n        this.withoutTenantId = true;\n        return this;","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TimerJobQueryImpl.java#L169-L205","documentation":"TimerJobQuery.jobTenantId(String) throws ActivitiIllegalArgumentException when the tenant id is null. Tenant ids scope jobs in multi-tenant deployments; a null tenant filter is considered a programming mistake and rejected. Note the message contains a typo ('tentant').","triggerScenarios":"Calling timerJobQuery().jobTenantId(null) — typically when the authenticated user or request context has no tenant assigned, or tenant handling was added to an application that never sets tenant ids on its deployments.","commonSituations":"Multi-tenant setups where a user session lacks a tenant claim; code upgraded from a single-tenant version where all data had null tenants; tenant resolvers returning null instead of a default tenant id.","solutions":["Pass a valid non-null tenant id (use jobTenantIdLike(\"...\") if you need pattern matching)","Skip the tenant filter when no tenant is specified rather than passing null","Configure a default tenant id and set it on deployments/process instances so tenant context is always resolvable"],"exampleFix":"// before\nquery.jobTenantId(tenantContext.getTenantId()); // may be null\n// after\nString tenantId = tenantContext.getTenantId();\nif (tenantId != null) {\n    query.jobTenantId(tenantId);\n}","handlingStrategy":"validation","validationCode":"String tenantId = tenantContext.getTenantId();\nif (tenantId == null) {\n    throw new IllegalStateException(\"No tenant in context; configure a default tenant or skip the tenant filter\");\n}\nquery.jobTenantId(tenantId);","typeGuard":"boolean hasTenantId(String t) { return t != null && !t.isEmpty(); }","tryCatchPattern":"try {\n    query.jobTenantId(tenantId);\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Null tenant id; querying without tenant scope\");\n}","preventionTips":["Assign tenant ids on every deployment and process instance","Configure a default tenant for single-tenant apps to avoid null context","Resolve the tenant claim once in an interceptor and validate before use"],"tags":["flowable","activiti","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-14T16:17:12.679Z"}