[DEFECT] CA: Sending an event without attributes is silently failing
Open
Nobody has claimed this yet.
dotCMS : Analytics
Priority : 4 Low
stale
Team : Falcon
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
When you send a CA Event with a custom event using the REST Endpoint, the response is returned as an HTTP Status 200, but the dotcms.log file is reporting an error.
Steps to Reproduce
- Set up both the Experiments and Content Analytics Apps.
- Using Postman, send the following data via POST:
- URL: {{serverURL}}/api/v1/analytics/content/event
- Body:
{
"context": {
"site_key": "{YOU-CONTENT-ANALYTICS-SITE-KEY}",
"session_id": "16AB7DB3809BD1F78F1585DD03038581",
"user_id": "anonymous"
},
"events": [
{
"event_type": "new-event-type",
"local_time": "2025-09-10T11:45:00-06:00"
}
]
}
- The Endpoint's response is successful:
{
"errors": [],
"failed": 0,
"status": "SUCCESS",
"success": 1
}
- However, there' an error in the log:
dotcms-1 | Exception in thread "dot-event-log-posting-8" java.lang.NullPointerException: Cannot invoke "java.util.Map.get(Object)" because "dataAttributes" is null
dotcms-1 | at com.dotcms.jitsu.ValidAnalyticsEventPayloadTransformer.putEventAttributes(ValidAnalyticsEventPayloadTransformer.java:286)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
dotcms-1 | at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
dotcms-1 | at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
dotcms-1 | at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
dotcms-1 | at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
dotcms-1 | at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
dotcms-1 | at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
dotcms-1 | at com.dotcms.jitsu.ValidAnalyticsEventPayloadTransformer.transform(ValidAnalyticsEventPayloadTransformer.java:112)
dotcms-1 | at com.dotcms.jitsu.ValidAnalyticsEventPayload.payloads(ValidAnalyticsEventPayload.java:109)
dotcms-1 | at com.dotcms.jitsu.EventLogRunnable.run(EventLogRunnable.java:97)
dotcms-1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
dotcms-1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
dotcms-1 | at java.base/java.lang.Thread.run(Thread.java:1583)
Acceptance Criteria
- Creating a custom event like that should not fail.
- Add the required tests to make sure the behavior is verified.
dotCMS Version
Latest main.
Severity
Low - Minor issue or cosmetic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ValidAnalyticsEventPayloadTransformer.java at putEventAttributes, identified in the stack trace, and trace how the REST event payload reaches the transformer. Add the required tests for an event without attributes and verify that the custom event is processed without the logged exception while retaining the successful response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100