Hi,
I am stuck on this. Details follow. Sorry this is so long. Thanks in advance.
IndexShardSnapshotFailedException[Unable to parse Json String.]; nested: AmazonClientException[Unable to parse Json String.]; nested: JsonMappingException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; nested: IllegalArgumentException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; ",
I am hoping someone can help get further with this. I have a plugin that starts with the cloud-aws plugin code and modifies to support KMS server side encryption. I have to do this work on the 2.4 branch.
I am at the point now where if the S3 bucket is empty, the snapshot put works. But once the bucket has contents it fails.
Here is the curl I am executing which works when the bucket is empty
curl
-XPUT "localhost:9200/_snapshot/${es_repo}"
-H 'Content-Type: application/json'
"type": "s3",
"settings": {
"bucket": "${es_repo}",
"compress": true,
"protocol": "https",
"kms_master_key_id":"alias/${es_repo}",
"server_side_encryption": true
}
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 252 100 252 0 0 40691 0 --:--:-- --:--:-- --:--:-- 42000
{
"snapshot" : {
"snapshot" : "20170612-170348",
"version_id" : 2040599,
"version" : "2.4.5",
"indices" : [ "kimchy", "twitter", "another_user" ],
"state" : "SUCCESS",
"start_time" : "2017-06-12T17:03:48.864Z",
"start_time_in_millis" : 1497287028864,
"end_time" : "2017-06-12T17:03:51.982Z",
"end_time_in_millis" : 1497287031982,
"duration_in_millis" : 3118,
"failures" : [ ],
"shards" : {
"total" : 3,
"failed" : 0,
"successful" : 3
}
}
}
but it does not work when the bucket has stuff in it
curl
-XPUT "localhost:9200/_snapshot/${es_repo}"
-H 'Content-Type: application/json'
"type": "s3",
"settings": {
"bucket": "${es_repo}",
"compress": true,
"protocol": "https",
"kms_master_key_id":"alias/${es_repo}",
"server_side_encryption": true
}
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 252 100 252 0 0 61643 0 --:--:-- --:--:-- --:--:-- 63000
{
"snapshot" : {
"snapshot" : "20170612-170443",
"version_id" : 2040599,
"version" : "2.4.5",
"indices" : [ "kimchy", "twitter", "another_user" ],
"state" : "PARTIAL",
"start_time" : "2017-06-12T17:04:43.281Z",
"start_time_in_millis" : 1497287083281,
"end_time" : "2017-06-12T17:04:44.805Z",
"end_time_in_millis" : 1497287084805,
"duration_in_millis" : 1524,
"failures" : [ {
"index" : "another_user",
"shard_id" : 0,
"reason" : "IndexShardSnapshotFailedException[Unable to parse Json String.]; nested: AmazonClientException[Unable to parse Json String.]; nested: JsonMappingException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; nested: IllegalArgumentException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; ",
"node_id" : "NN3iDI3NTcyu3zicB9CNEQ",
"status" : "INTERNAL_SERVER_ERROR"
}, {
"index" : "kimchy",
"shard_id" : 0,
"reason" : "IndexShardSnapshotFailedException[Unable to parse Json String.]; nested: AmazonClientException[Unable to parse Json String.]; nested: JsonMappingException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; nested: IllegalArgumentException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; ",
"node_id" : "NN3iDI3NTcyu3zicB9CNEQ",
"status" : "INTERNAL_SERVER_ERROR"
}, {
"index" : "twitter",
"shard_id" : 0,
"reason" : "IndexShardSnapshotFailedException[Unable to parse Json String.]; nested: AmazonClientException[Unable to parse Json String.]; nested: JsonMappingException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; nested: IllegalArgumentException[Can not access public java.util.LinkedHashMap() (from class java.util.LinkedHashMap; failed to set access: access denied (\"java.lang.reflect.ReflectPermission\" \"suppressAccessChecks\")]; ",
"node_id" : "NN3iDI3NTcyu3zicB9CNEQ",
"status" : "INTERNAL_SERVER_ERROR"
} ],
"shards" : {
"total" : 3,
"failed" : 3,
"successful" : 0
}
}
}
Really beguiling is that when it does fail with INTERNAL_SERVER_ERROR there is nothing logged to indicate failure or what the INTERNAL_SERVER_ERROR is.
Note, in my own code, I wrap AWS calls with
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
which has gotten me further along but I can't apply this technique to the ES code itself.
Thanks in advance.