-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Azure snapshot request returns 500 error: "null_pointer_exception" #28299
Comments
@tdoman Thanks for reporting. Could you share what you have in |
Looking at the code, I see where this NPE is coming from but it seems to indicate that the Azure client can not be found. |
@dadoonet Ok, that'd be a good message in lieu of the NPE but I am able to successfully use the keys, etc. in other tools to access the blob storage. Also, I had been successfully doing this w/ ES 6.0 so I'm not sure what changed. Here's my repository creation request:
Here's the
Oh, and yes it's a fresh installation. I've simply been doing reindex from remote from my ES 1.7.5 cluster but it's not an upgrade of any kind. |
I believe that you are seeing some deprecation notice may be? Anyway, to use the plugin in 6.1, you have to follow the guide here: https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-azure-usage.html Define the key and secret: bin/elasticsearch-keystore add azure.client.default.account
bin/elasticsearch-keystore add azure.client.default.key Remove credentials from Then you need to restart the node and you should be good. Otherwise, you could may be do something like:
That "might work" but I'm unsure though. |
@dadoonet Ah, ok I see, the configuration methodology changed between 6.0 and 6.1. Ok, I'll try 6.1 approach out today and report back. I did try your "might work" suggestion and it didn't. :) Thank you very much for the prompt response, I really appreciate it. |
Yeah it changed but it is supposed to be backward compatible. That's why I marked this as a bug and also because a NPE is always bad. 😉 |
@dadoonet Yep, purely configurational, thanks again for the support David. |
Sorry, I re-opened it so the NPE can be addressed. |
Thanks for confirming. I'm planning to address the issues indeed (backward comp and NPE). Let's keep that open. |
When someone migrates from 5.6 to 6.x with deprecated settings like: ``` cloud: azure: storage: foo: account: <my_account> key: <my_key> ``` It produces a NPE anytime someone wants to use a repository which name is not `default`. This has been introduced by elastic#23518 when I backported it to 6.x branch. In this case, when we generate an OperationContext, we only try to get azure settings from "normal" `storageSettings` with: ```java this.storageSettings.get(clientName) ``` But in the context of deprecated settings, this returns `null` which causes the NPE just after. This commit adds a check and if no settings are found in the "normal" `storageSettings`, we look at settings from `deprecatedStorageSettings`. The reason I missed it in the 7.0 version (master branch) is because actually `deprecatedStorageSettings` has been removed there already. Also I modified the `testGetSelectedClientDefault` method which was only doing exactly the same thing as `testGetDefaultClientWithPrimaryAndSecondaries`. Closes elastic#28299.
* Fix NPE when using deprecated Azure settings When someone migrates from 5.6 to 6.x with deprecated settings like: ``` cloud: azure: storage: foo: account: <my_account> key: <my_key> ``` It produces a NPE anytime someone wants to use a repository which name is not `default`. This has been introduced by #23518 when I backported it to 6.x branch. In this case, when we generate an OperationContext, we only try to get azure settings from "normal" `storageSettings` with: ```java this.storageSettings.get(clientName) ``` But in the context of deprecated settings, this returns `null` which causes the NPE just after. This commit adds a check and if no settings are found in the "normal" `storageSettings`, we look at settings from `deprecatedStorageSettings`. The reason I missed it in the 7.0 version (master branch) is because actually `deprecatedStorageSettings` has been removed there already. Also I renamed the `testGetSelectedClientDefault` method to `testGenerateOperationContext` as it was only doing exactly the same thing as `testGetDefaultClientWithPrimaryAndSecondaries`. Closes #28299.
* Fix NPE when using deprecated Azure settings When someone migrates from 5.6 to 6.x with deprecated settings like: ``` cloud: azure: storage: foo: account: <my_account> key: <my_key> ``` It produces a NPE anytime someone wants to use a repository which name is not `default`. This has been introduced by #23518 when I backported it to 6.x branch. In this case, when we generate an OperationContext, we only try to get azure settings from "normal" `storageSettings` with: ```java this.storageSettings.get(clientName) ``` But in the context of deprecated settings, this returns `null` which causes the NPE just after. This commit adds a check and if no settings are found in the "normal" `storageSettings`, we look at settings from `deprecatedStorageSettings`. The reason I missed it in the 7.0 version (master branch) is because actually `deprecatedStorageSettings` has been removed there already. Also I renamed the `testGetSelectedClientDefault` method to `testGenerateOperationContext` as it was only doing exactly the same thing as `testGetDefaultClientWithPrimaryAndSecondaries`. Closes #28299. Backport of #28769 in 6.2 branch.
Closed by #28769 |
NEST 6.0.0-beta1
ES 6.1.1
repository-azure-6.1.1
I am able to successfully create the azure repository but when I attempt to take the snapshot like so:
I get the following response:
Here's the log:
The text was updated successfully, but these errors were encountered: