Calling sdk's invokeMethod raise DaprException: UNKNOWN: HTTP status code: 400
- Ngôn ngữ chính
- Java
- Star
- 300
- Fork
- 230
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 5
Mô tả
HI
I recently upgrade dapr from 1.15.12 to 1.16.8, but encounter the issue when do service invocation in Java like:
```sh
Map headers = buildHeaders();
log.info("Invoking search service global search. Headers: {}", headers);
HttpExtension httpExtension = new HttpExtension(io.dapr.client.DaprHttp.HttpMethods.POST, null, headers);
log.info("Invoking search service global search. Request: {}", request);
log.info("Invoking search service global search. HttpExtension: {}", httpExtension);
log.info("Invoking search service global search. Method: {}", trimLeadingSlash(apiPrefix) + "/global");
JsonNode json = daprClient.invokeMethod(
searchServiceAppId,
trimLeadingSlash(apiPrefix) + "/global",
request,
httpExtension,
JsonNode.class
).block(Duration.ofMillis(invokeTimeoutMs));
```
the caller's log print out error:
```sh
2026-02-13 16:49:22.531
io.dapr.exceptions.DaprException: UNKNOWN: HTTP status code: 400
2026-02-13 16:49:22.531
2026-02-13 16:49:22.531
2026-02-13T08:49:22.500Z ERROR 1 --- [user-service] [nio-8080-exec-4] c.t.u.client.DaprDeviceServiceClient : Error creating device for operator jiaming-operator via Dapr: UNKNOWN: HTTP status code: 400
```
the callee has no log, I have no idea how and why the issue happen after the dapr upgrade(the code works before) and other sdk like python works as intended. **I test the code in local env successfully, but failed with the error in k8s**. Any idear for that, appreciated.
## Expected Behavior
Java sdk's service invocation works well as 1.15.12
## Actual Behavior
2026-02-13 16:49:22.531
io.dapr.exceptions.DaprException: UNKNOWN: HTTP status code: 400
2026-02-13 16:49:22.531
2026-02-13 16:49:22.531
2026-02-13T08:49:22.500Z ERROR 1 --- [user-service] [nio-8080-exec-4] c.t.u.client.DaprDeviceServiceClient : Error creating device for operator jiaming-operator via Dapr: UNKNOWN: HTTP status code: 400
## Steps to Reproduce the Problem
- upgrade dapr to 1.16.8
- re-deploy service
- call service API with java sdk (1.16.1) in application
## Release Note
Hướng dẫn đóng góp
Hướng nghiên cứu
Start from the Java application's daprClient.invokeMethod call and compare behavior between Dapr 1.15.12 and 1.16.8 with Java SDK 1.16.1. Reproduce the request in Kubernetes, capturing the full 400 response and sidecar logs, then compare it with the successful local and Python calls. Done means identifying the upgrade-related cause and restoring service invocation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, kubernetes
- Lĩnh vực
- api, backend, devops
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100