apache / apache/hertzbeat

[BUG] HertzBeat AI 400 Bad Request from POST

Open
#3,971 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.4k
Forks
1.3k
Avg merge
1d 20h
Merged PRs (30d)
32

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

[BUG] HertzBeat AI 400 Bad Request from POST
When the HertzBeat AI chatbot is fully and correctly configured, and after multiple confirmations that the AI provider settings are correct—including the AI provider, API key, base URL: https://api.deepseek.com/v1, and model deepseek-reasoner—the frontend reports an error for any conversation:
AI Assistant
An error occurred: 400 Bad Request from POST https://api.deepseek.com/v1/chat/completions
The backend service log stack is as follows:

` 2026-01-15 10:59:54 [reactor-http-epoll-6] ERROR org.springframework.ai.chat.model.MessageAggregator - Aggregation Error

2026-01-15T10:59:54.454975323+08:00 org.springframework.web.reactive.function.client.WebClientResponseException$BadRequest: 400 Bad Request from POST https://api.deepseek.com/v1/chat/completions

2026-01-15T10:59:54.454980895+08:00 at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:321)

2026-01-15T10:59:54.454984579+08:00 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

2026-01-15T10:59:54.454988119+08:00 Error has been observed at the following site(s):

2026-01-15T10:59:54.454993791+08:00 *__checkpoint ⇢ 400 BAD_REQUEST from POST https://api.deepseek.com/v1/chat/completions [DefaultWebClient]

2026-01-15T10:59:54.454997134+08:00 Original Stack Trace:

2026-01-15T10:59:54.455000107+08:00 at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:321)

2026-01-15T10:59:54.455004059+08:00 at org.springframework.web.reactive.function.client.DefaultClientResponse.lambda$createException$1(DefaultClientResponse.java:214)

2026-01-15T10:59:54.455009769+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106)

2026-01-15T10:59:54.455013059+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455017461+08:00 at reactor.core.publisher.FluxOnErrorReturn$ReturnSubscriber.onNext(FluxOnErrorReturn.java:162)

2026-01-15T10:59:54.455021209+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455024290+08:00 at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:122)

2026-01-15T10:59:54.455027221+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455030505+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455033460+08:00 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)

2026-01-15T10:59:54.455036399+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455039333+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455047352+08:00 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)

2026-01-15T10:59:54.455050492+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455094141+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455097479+08:00 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)

2026-01-15T10:59:54.455100441+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455103420+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455106315+08:00 at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)

2026-01-15T10:59:54.455109264+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455112217+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455115304+08:00 at reactor.core.publisher.Operators$BaseFluxToMonoOperator.completePossiblyEmpty(Operators.java:2097)

2026-01-15T10:59:54.455118507+08:00 at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:145)

2026-01-15T10:59:54.455121434+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455124791+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)

2026-01-15T10:59:54.455127657+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455130597+08:00 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)

2026-01-15T10:59:54.455133667+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455136638+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)

2026-01-15T10:59:54.455139612+08:00 at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:413)

2026-01-15T10:59:54.455142561+08:00 at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:455)

2026-01-15T10:59:54.455145454+08:00 at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:509)

2026-01-15T10:59:54.455148455+08:00 at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:819) 2026-01-15 10:59:54 [reactor-http-epoll-6] ERROR org.springframework.ai.chat.model.MessageAggregator - Aggregation Error

2026-01-15T10:59:54.454975323+08:00 org.springframework.web.reactive.function.client.WebClientResponseException$BadRequest: 400 Bad Request from POST https://api.deepseek.com/v1/chat/completions

2026-01-15T10:59:54.454980895+08:00 at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:321)

2026-01-15T10:59:54.454984579+08:00 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

2026-01-15T10:59:54.454988119+08:00 Error has been observed at the following site(s):

2026-01-15T10:59:54.454993791+08:00 *__checkpoint ⇢ 400 BAD_REQUEST from POST https://api.deepseek.com/v1/chat/completions [DefaultWebClient]

2026-01-15T10:59:54.454997134+08:00 Original Stack Trace:

2026-01-15T10:59:54.455000107+08:00 at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:321)

2026-01-15T10:59:54.455004059+08:00 at org.springframework.web.reactive.function.client.DefaultClientResponse.lambda$createException$1(DefaultClientResponse.java:214)

2026-01-15T10:59:54.455009769+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106)

2026-01-15T10:59:54.455013059+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455017461+08:00 at reactor.core.publisher.FluxOnErrorReturn$ReturnSubscriber.onNext(FluxOnErrorReturn.java:162)

2026-01-15T10:59:54.455021209+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455024290+08:00 at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:122)

2026-01-15T10:59:54.455027221+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455030505+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455033460+08:00 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)

2026-01-15T10:59:54.455036399+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455039333+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455047352+08:00 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)

2026-01-15T10:59:54.455050492+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455094141+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455097479+08:00 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)

2026-01-15T10:59:54.455100441+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455103420+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455106315+08:00 at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)

2026-01-15T10:59:54.455109264+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onNext(TracingSubscriber.java:68)

2026-01-15T10:59:54.455112217+08:00 at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)

2026-01-15T10:59:54.455115304+08:00 at reactor.core.publisher.Operators$BaseFluxToMonoOperator.completePossiblyEmpty(Operators.java:2097)

2026-01-15T10:59:54.455118507+08:00 at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:145)

2026-01-15T10:59:54.455121434+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455124791+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)

2026-01-15T10:59:54.455127657+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455130597+08:00 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)

2026-01-15T10:59:54.455133667+08:00 at io.opentelemetry.instrumentation.reactor.v3_1.TracingSubscriber.onComplete(TracingSubscriber.java:92)

2026-01-15T10:59:54.455136638+08:00 at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)

2026-01-15T10:59:54.455139612+08:00 at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:413)

2026-01-15T10:59:54.455142561+08:00 at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:455)

2026-01-15T10:59:54.455145454+08:00 at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:509)

2026-01-15T10:59:54.455148455+08:00 at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:819)`

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Environment

```markdown
HertzBeat version(s):v1.8.0
```

### Debug logs

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the HertzBeat AI chatbot request path and the backend call to https://api.deepseek.com/v1/chat/completions; reproduce the failure using the stated provider, base URL, and model settings. Compare the request and provider response, then verify that a chatbot conversation completes without the reported 400 Bad Request.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
ai, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.