适用版本: 6.8-8.11
1. 错误异常的基本描述 #
这个错误说明 Jira account 的 URL 协议不符合当前安全策略。最常见情况是账户 URL 使用了 http,但当前配置没有显式允许 HTTP,于是 Elasticsearch 直接拒绝该账户。
典型报错:
invalid jira [ops_jira] account settings. unsecure scheme [http]
2. 为什么会发生这个错误 #
源码片段显示,URL 解析出协议后会先执行安全检查:
Scheme protocol = Scheme.parse(uri.getScheme());
if ((protocol == Scheme.HTTP) && (Booleans.isTrue(settings.get(ALLOW_HTTP_SETTING)) == false)) {
throw new SettingsException("invalid jira [" + name + "] account settings. unsecure scheme [" + protocol + "]");
}
常见原因:
- Jira URL 写成了
http://。 - 测试环境沿用了旧的非 HTTPS 配置。
- 配置迁移后遗漏了安全策略变更。
3. 排查方法 #
- 找出对应 Jira account 的 URL。
- 确认 URL 的 scheme 是
http还是https。 - 检查当前集群是否明确允许 HTTP。
- 若是内网测试环境,也要确认是否真的需要继续保留 HTTP。
4. 如何解决这个错误 #
优先改为 HTTPS:
xpack.notification.jira.account.ops_jira:
secure_url: https://jira.example.com
只有在确实受控且版本允许的情况下,才考虑显式开启 HTTP 支持;默认仍建议使用 HTTPS。
5. 预防建议 #
- 新增 Jira account 时统一要求 HTTPS。
- 将 HTTP 视为例外配置,避免在默认模板中继续传播。
- 把安全协议校验放进配置评审流程。
相关错误 #
- invalid-jira-name-account-settings-invalid-url-setting-setting-how-to-solve-this-elasticsearch-exception
- invalid-jira-account-account-settings-missing-required-setting-setting-how-to-solve-this-elasticsearch-exception
- failed-to-parse-jira-project-expected-an-object-but-found-instead-how-to-solve-this-elasticsearch-exception
附:日志上下文 #
下面保留当前页面中的源码或日志片段,便于继续结合异常调用栈定位问题:
if (uri.getScheme() == null) {
throw new URISyntaxException("null"; "No scheme defined in url");
}
Scheme protocol = Scheme.parse(uri.getScheme());
if ((protocol == Scheme.HTTP) && (Booleans.isTrue(settings.get(ALLOW_HTTP_SETTING)) == false)) {
throw new SettingsException("invalid jira [" + name + "] account settings. unsecure scheme [" + protocol + "]");
}
this.url = uri;
} catch (URISyntaxException | IllegalArgumentException e) {
throw new SettingsException(
"invalid jira [" + name + "] account settings. invalid [" + SECURE_URL_SETTING.getKey() + "] setting";





