camunda-bpm-platform
camunda-bpm-platform copied to clipboard
`NullPointerException` thrown when metrics are disabled
Environment (Required on creation)
Any (example below with 7.20 Wildfly 29)
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)
When metricsEnabled
is set to false, a NPE is thrown in case in the following cases:
- History cleanup is started => can't run the History cleanup
- The invoice example application is deployed => no processes can be started
- Cockpit dashboard is loaded (the exception is reported as a warning)
Root cause:
"org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.getDbMetricsReporter()" is null
Server output:
Steps to reproduce (Required on creation)
- Download a pre-packaged distribution
- Set
metricsEnabled
to false - Start the server
Observed Behavior (Required on creation)
In three different cases a NullPoitnerException
is thrown and History cleanup and the invoice example can't be started
Expected behavior (Required on creation)
No errors are thrown, History cleanup can be started, the process engine can operate with disabled metrics.
Root Cause (Required on prioritization)
When the metrics are disabled, the dbMetricsReporter
is null and there's no null check in:
- History cleanup where the reporter is used to report its metrics (HistoryCleanupSchedulerCmd.reportMetrics)
- Invoice example (InvoiceApplicationHelper)
- In Dashboard Cockpit, to display the metrics charts
Solution Ideas
Hints
- Workarounds
- Disable metrics for History cleanup via
historyCleanupMetricsEnabled
- Don't deploy the invoice example application
- For Cockpit the NPE still will be reported as a warning
- Disable metrics for History cleanup via
Links
- https://jira.camunda.com/browse/SUPPORT-18916
- duplicate: https://github.com/camunda/camunda-bpm-platform/issues/2704
- related to: https://github.com/camunda/camunda-bpm-platform/issues/2739
Breakdown
### Pull Requests
Dev2QA handover
- [ ] Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
Hi @yanavasileva,
Can we close this duplicate since https://github.com/camunda/camunda-bpm-platform/issues/2704 is resolved? Maybe we could also communicate this to the customer? The process was broken since the support case wasn't linked to the other issue.
Best, Tassilo
@tasso94 https://github.com/camunda/camunda-bpm-platform/issues/2704 resolved use case 1. NPE in History cleanup. The NPE for use case 2. when the Invoice example application is deployed is not resolve. So I can adjust the description and leave the ticket open. (I am not sure if use case 3. warnings thrown when Cockpit is resolved either.) Let me know if you have objections.