Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [dinky-core] Click to trigger savepoint error #4107

Closed
2 of 3 tasks
chenlb opened this issue Jan 1, 2025 · 0 comments · Fixed by #4108
Closed
2 of 3 tasks

[Bug] [dinky-core] Click to trigger savepoint error #4107

chenlb opened this issue Jan 1, 2025 · 0 comments · Fixed by #4108
Labels
Bug Something isn't working Waiting for reply Waiting for reply

Comments

@chenlb
Copy link
Contributor

chenlb commented Jan 1, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

点击 “Savapoint 触发” 报错。

A6B0DB96-AC24-4C72-9890-888550649CEB

2025-01-01 10:45:53 Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
2025-01-01 10:45:53     at java.lang.StringLatin1.charAt(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.lang.String.charAt(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.net.HostPortrange.<init>(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.net.URLPermission$Authority.<init>(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.net.URLPermission.parseURI(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.net.URLPermission.init(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at java.net.URLPermission.<init>(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at sun.net.www.protocol.http.HttpURLConnection.URLtoSocketPermission(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source) ~[?:?]
2025-01-01 10:45:53     at cn.hutool.http.HttpConnection.getOutputStream(HttpConnection.java:461) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpRequest.sendFormUrlEncoded(HttpRequest.java:1367) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpRequest.send(HttpRequest.java:1342) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpRequest.doExecute(HttpRequest.java:1188) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpRequest.execute(HttpRequest.java:1051) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpRequest.execute(HttpRequest.java:1027) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at cn.hutool.http.HttpUtil.post(HttpUtil.java:230) ~[hutool-all-5.8.31.jar:5.8.31]
2025-01-01 10:45:53     at org.dinky.api.FlinkAPI.post(FlinkAPI.java:119) ~[dinky-core-1.2.0.jar:?]
2025-01-01 10:45:53     at org.dinky.api.FlinkAPI.triggerSavePoint(FlinkAPI.java:189) ~[dinky-core-1.2.0.jar:?]
2025-01-01 10:45:53     at org.dinky.api.FlinkAPI.savepoints(FlinkAPI.java:178) ~[dinky-core-1.2.0.jar:?]
2025-01-01 10:45:53     at org.dinky.job.JobManager.savepoint(JobManager.java:384) ~[dinky-core-1.2.0.jar:?]
2025-01-01 10:45:53     at org.dinky.service.impl.TaskServiceImpl.savepointTaskJob(TaskServiceImpl.java:480) ~[dinky-admin-1.2.0.jar:?]

我想“智能停止” 也会报这个错。

Bug in there(not jobmanger host in url):

diff --git a/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java b/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java
index 912f3f0dd..4e7fcf059 100644
--- a/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java
+++ b/dinky-core/src/main/java/org/dinky/api/FlinkAPI.java
@@ -112,7 +112,7 @@ public class FlinkAPI {
     }
 
     private JsonNode post(String route, String body) {
-        String url = NetConstant.SLASH + route;
+        String url = address + NetConstant.SLASH + route;
         if (!address.startsWith(NetConstant.HTTP) && !address.startsWith(NetConstant.HTTPS)) {
             url = NetConstant.HTTP + url;
         }

What you expected to happen

可以带 savepoint 停止任务。

How to reproduce

start job, and click "Savapoint 触发"

Anything else

Version

1.2.0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@chenlb chenlb added Bug Something isn't working Waiting for reply Waiting for reply labels Jan 1, 2025
@github-actions github-actions bot changed the title [Bug] [dinky-core] 点击触发 savepoint 报错 [Bug] [dinky-core] Click to trigger savepoint error Jan 1, 2025
@aiwenmo aiwenmo linked a pull request Jan 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Waiting for reply Waiting for reply
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant