-
Notifications
You must be signed in to change notification settings - Fork 260
Get MissingRequiredPropertyException on GetTokenRequest #332
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
Comments
Thanks for the very detailed report. Indeed the refresh token field isn't always present. This is an issue in the API specification used to produce the Java code. Once the API specification is fixed, we'll update the Java client code to resolve this issue. Regarding the |
Thanks for looking into the issue! Regarding the “Too many open files”, I was indeed creating a new Elasticsearch client on every request. As such, connections were created faster than they could be cleaned up, resulting in too many file descriptors being open. I have since added a manager to manage client connections to Elasticsearch, such that one client connection is created per user. If the session is inactive for a period of time or the user logs out, that connection is closed. This fixed the problem.
Thanks again!
From: Sylvain Wallez ***@***.***>
Sent: Tuesday, August 23, 2022 12:41 PM
To: elastic/elasticsearch-java ***@***.***>
Cc: Margarita Hiett ***@***.***>; Author ***@***.***>
Subject: Re: [elastic/elasticsearch-java] Get MissingRequiredPropertyException on GetTokenRequest (Issue #332)
Thanks for the very detailed report. Indeed the refresh token field isn't always present. This is an issue in the API specification<https://github.com/elastic/elasticsearch-specification> used to produce the Java code. Once the API specification is fixed, we'll update the Java client code to resolve this issue.
Regarding the Too many open files, this is is most certainly unrelated to disabling required properties check. A more likely cause can be that a new Elasticsearch client is created for every request and incorrectly closed (you have to call client._transport().close()). What is the content of esClientFactory.destroy()?
—
Reply to this email directly, view it on GitHub<#332 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARJGA3MMPRV2T5Y3IWR2TWDV2T5JPANCNFSM5ZUQBHUQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Java API client version
7.17.4
Java version
jdk1.8.0_333
Elasticsearch Version
7.17.4
Problem description
I am running Elasticsearch on a Red Hat Linux with Platinum license. A custom application is connecting to Elasticsearch using native realm for authentication. The username and password are passed for authentication. Upon successful authentication an access token is passed back to the client. The client uses that token with every request to make sure the request came from authenticated user. This process works using Elasticsearch Java API 7.11.2,
RestHighLevelClient
. Upon upgrading to 7.17.4ElasticsearchClient
, a MissingRequiredPropertyException is thrown: Missing required property GetTokenResponse.refreshToken , when generating a token request. If I surround theGetTokenRequest/GetTokenResponse
block of code withApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true);
, the token is generated, but thenToo many open files
exception is thrown.Below are the snippets of the code to reproduce the error:
Authentication
Creating ES Client
Building the Client
The text was updated successfully, but these errors were encountered: