ai-code-review: NPE "AIChatResponseContent" is null

20 views
Skip to first unread message

Maria Helena Braga

unread,
Sep 16, 2025, 9:27:53 AM (2 days ago) Sep 16
to Repo and Gerrit Discussion
Hi, 

I'm testing the ai-code-review plugin in a Gerrit 3.12 instance, but when I submit a patchset for review, I get a NullPointerException:

ERROR com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask : Error while processing change: eit%2Fproject%2Ftest~master~Idb932783d2cc2c89bd2e5c9a3442d063ed2d6e0c
java.lang.NullPointerException: Cannot invoke "com.googlesource.gerrit.plugins.aicodereview.mode.common.model.api.openai.AIChatResponseContent.getChangeId()" because "AIChatResponseContent" is null
at com.googlesource.gerrit.plugins.aicodereview.mode.common.client.api.openai.AIChatClient.validateResponse(AIChatClient.java:63)
at com.googlesource.gerrit.plugins.aicodereview.mode.stateless.client.api.chatai.AIChatClientStateless.ask(AIChatClientStateless.java:78)
at com.googlesource.gerrit.plugins.aicodereview.PatchSetReviewer.getReviewReply(PatchSetReviewer.java:172)
at com.googlesource.gerrit.plugins.aicodereview.PatchSetReviewer.review(PatchSetReviewer.java:92)
at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTypePatchSetReview.processEvent(EventHandlerTypePatchSetReview.java:64)
at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.execute(EventHandlerTask.java:106)
at com.googlesource.gerrit.plugins.aicodereview.listener.EventHandlerTask.run(EventHandlerTask.java:95)
at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:113)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:912)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)


Am I configuring it wrong?

I'm using the latest version of the plugin, compiled from master branch in: https://gerrit.googlesource.com/plugins/ai-code-review/+/refs/heads/master

I'm running a local ollama docker container:

docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker exec -it ollama ollama run qwen2.5-coder

And my gerrit.config is:
[plugin "ai-code-review"]
    # Required parameters
    aiType = OLLAMA
    aiModel = qwen2.5-coder
    aiDomain = http://ollama:11434/
    gerritUserName = gertst1
    globalEnable = true
    enableMessageDebugging = true
    aiStreamOutput = true
    enabledVoting = true

I added the DEBUG logs from this patchset  execution in the attachments.
Thanks in advance for the help!

Maria H.
ai_code_review_error (1).txt
Reply all
Reply to author
Forward
0 new messages