--- title: "无效的身份验证请求查询字符串参数为零 – 如何解决此 Elasticsearch 异常" date: 2026-03-06 lastmod: 2026-03-06 description: "此错误发生在向 Elasticsearch 发送请求时,查询字符串中没有任何参数。这可能是由于请求格式错误或编程错误导致的。" tags: ["身份验证", "查询字符串", "SAML", "Elasticsearch异常", "安全异常"] summary: " 版本: 7.7-8.9 简而言之,当向 Elasticsearch 发送的请求在查询字符串中没有任何参数时,就会发生此错误。这可能是由于请求格式错误或编程错误导致的。要解决此问题,你应该检查正在发送的请求,以确保它包含必要的参数。如果你使用客户端库或工具来发送请求,请确保它已正确配置。此外,请检查你的 Elasticsearch 服务器的身份验证设置,确保它们已正确设置。 日志上下文 # 日志"Invalid Authentication Request query string (zero parameters)“的类名是 SamlAuthnRequestValidator.java。 我们从 Elasticsearch 源代码中提取了以下内容,为那些寻求深入了解上下文的人提供参考: private ParsedQueryString parseQueryString(String queryString) throws ElasticsearchSecurityException { final Mapparameters = new HashMap<>(); RestUtils.decodeQueryString(queryString; 0; parameters); if (parameters.isEmpty()) { throw new ElasticsearchSecurityException("Invalid Authentication Request query string (zero parameters)"); } logger.trace(() -> format("Parsed the following parameters from the query string: %s"; parameters)); final String samlRequest = parameters.get("SAMLRequest"); if (null == samlRequest) { throw new ElasticsearchSecurityException( " --- > **版本:** 7.7-8.9 简而言之,当向 Elasticsearch 发送的请求在查询字符串中没有任何参数时,就会发生此错误。这可能是由于请求格式错误或编程错误导致的。要解决此问题,你应该检查正在发送的请求,以确保它包含必要的参数。如果你使用客户端库或工具来发送请求,请确保它已正确配置。此外,请检查你的 Elasticsearch 服务器的身份验证设置,确保它们已正确设置。 日志上下文 ----------- 日志"Invalid Authentication Request query string (zero parameters)"的类名是 [SamlAuthnRequestValidator.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,为那些寻求深入了解上下文的人提供参考: ```java private ParsedQueryString parseQueryString(String queryString) throws ElasticsearchSecurityException { final Mapparameters = new HashMap<>(); RestUtils.decodeQueryString(queryString; 0; parameters); if (parameters.isEmpty()) { throw new ElasticsearchSecurityException("Invalid Authentication Request query string (zero parameters)"); } logger.trace(() -> format("Parsed the following parameters from the query string: %s"; parameters)); final String samlRequest = parameters.get("SAMLRequest"); if (null == samlRequest) { throw new ElasticsearchSecurityException( ```