ApiClient.applyEnvVariables() throws NullPointerException when CONDUCTOR_AUTH_KEY is not set
@nthmost-orkes 已经在做这个了。
开始于 2026年4月27日。
评估
这个 Issue 还没有评估数据。
描述
Bug
ApiClient.applyEnvVariables() crashes with NullPointerException when connecting to a plain OSS Conductor server (no auth needed). Any user who sets only CONDUCTOR_SERVER_URL will hit this.
Tracked as a zero-to-one onboarding blocker in conductor-oss/getting-started#51
Steps to Reproduce
export CONDUCTOR_SERVER_URL=http://localhost:8080/api
# Note: no auth keys set — correct for OSS Conductor
java -cp <classpath> com.netflix.conductor.sdk.examples.helloworld.Main
Error
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException: Cannot invoke "String.trim()" because
the return value of "java.lang.System.getenv(String)" is null
at io.orkes.conductor.client.ApiClient$ApiClientBuilder.applyEnvVariables(ApiClient.java:186)
at io.orkes.conductor.client.ApiClient$ApiClientBuilder.build(ApiClient.java:175)
at io.orkes.conductor.sdk.examples.util.ClientUtil.<clinit>(ClientUtil.java:27)
Root Cause
In orkes-client/src/main/java/io/orkes/conductor/client/ApiClient.java, lines 184–196:
String conductorAuthKey = System.getenv("CONDUCTOR_AUTH_KEY");
if (conductorAuthKey == null) {
conductorAuthKey = System.getenv("CONDUCTOR_SERVER_AUTH_KEY").trim(); // ← NPE if env var is also null
}
String conductorAuthSecret = System.getenv("CONDUCTOR_AUTH_SECRET");
if (conductorAuthSecret == null) {
conductorAuthSecret = System.getenv("CONDUCTOR_SERVER_AUTH_SECRET").trim(); // ← NPE if env var is also null
}
When neither CONDUCTOR_AUTH_KEY nor CONDUCTOR_SERVER_AUTH_KEY is set (the OSS case), .trim() is called on null.
Fix
Null-check before .trim():
String conductorAuthKey = System.getenv("CONDUCTOR_AUTH_KEY");
if (conductorAuthKey == null) {
String legacyKey = System.getenv("CONDUCTOR_SERVER_AUTH_KEY");
conductorAuthKey = legacyKey != null ? legacyKey.trim() : null;
}
String conductorAuthSecret = System.getenv("CONDUCTOR_AUTH_SECRET");
if (conductorAuthSecret == null) {
String legacySecret = System.getenv("CONDUCTOR_SERVER_AUTH_SECRET");
conductorAuthSecret = legacySecret != null ? legacySecret.trim() : null;
}
Impact
This crash affects every example in the examples module that uses ClientUtil, including the recommended helloworld/Main.java. OSS users have no way to run any of these examples without auth keys, which defeats the zero-to-one experience.
Zero-to-one tracking: conductor-oss/getting-started#51
- 主要语言
- Java
- 星标
- 12
- 派生
- 10
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 3
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
conductor-oss/java-sdk 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
conductor-oss/java-sdk#135 ·
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
conductor-oss/java-sdk#133 ·
-
bug
难度 1/5 1 小时以内 新手友好度 92/100
conductor-oss/java-sdk#132 ·
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
conductor-oss/java-sdk#131 ·
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
conductor-oss/java-sdk#130 ·
查看 conductor-oss/java-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Content
难度 2/5 1-3 小时 新手友好度 68/100
RunestoneInteractive/rs#1559 · 1 条评论 ·
维护者通常 2 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 86/100
inu-appcenter/memorIN-backend#298 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
opendataloader-project/opendataloader-pdf#757 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
redhat-developer/intellij-quarkus#1626 ·