Skip to content

RemoteTransportException caused by NullPointerException when trying to create snapshot through Kibana UI #53171

@bcbrockway

Description

@bcbrockway

Elasticsearch version: 7.5.2

Plugins installed:

  • repository-gcs
  • repository-s3

JVM version: openjdk 13.0.1 2019-10-15

OS version: Linux portal-elastic-es-main-0 4.14.138+ #1 SMP Tue Sep 3 02:58:08 PDT 2019 x86_64 x86_64 x86_64 GNU/Linux (official docker container - docker.elastic.co/elasticsearch/elasticsearch:7.5.2)

Description of the problem including expected versus actual behavior:

If you create a Snapshot Lifecycle Policy through the API without specifying a config block and then try to click the "Run now" button in the Kibana UI, the operation will fail and the following exceptions will be shown in the elasticsearch/kibana logs:

portal-elastic-es-main-0 elasticsearch {"type": "server", "timestamp": "2020-03-05T12:23:14,224Z", "level": "WARN", "component": "r.suppressed", "cluster.name": "portal-elastic", "node.name": "portal-elastic-es-main-0", "message": "path: /_slm/policy/daily/_execute, params: {name=daily}", "cluster.uuid": "AY3K33D1TZ6NeQ_tsYLfmA", "node.id": "DKHkJG7HQBS8KisfmfxAdg" , 
portal-elastic-es-main-0 elasticsearch "stacktrace": ["org.elasticsearch.transport.RemoteTransportException: [portal-elastic-es-main-2][10.52.4.33:9300][cluster:admin/slm/execute]",
portal-elastic-es-main-0 elasticsearch "Caused by: java.lang.NullPointerException",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy.toRequest(SnapshotLifecyclePolicy.java:258) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.xpack.slm.SnapshotLifecycleTask.lambda$maybeTakeSnapshot$1(SnapshotLifecycleTask.java:86) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at java.util.Optional.map(Optional.java:258) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.xpack.slm.SnapshotLifecycleTask.maybeTakeSnapshot(SnapshotLifecycleTask.java:85) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.xpack.slm.action.TransportExecuteSnapshotLifecycleAction.masterOperation(TransportExecuteSnapshotLifecycleAction.java:80) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.xpack.slm.action.TransportExecuteSnapshotLifecycleAction.masterOperation(TransportExecuteSnapshotLifecycleAction.java:35) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:98) ~[elasticsearch-7.5.2.jar:7.5.2]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.lambda$doStart$3(TransportMasterNodeAction.java:169) ~[elasticsearch-7.5.2.jar:7.5.2]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73) ~[elasticsearch-7.5.2.jar:7.5.2]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:773) ~[elasticsearch-7.5.2.jar:7.5.2]",
portal-elastic-es-main-0 elasticsearch "at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-7.5.2.jar:7.5.2]",
portal-elastic-es-main-0 elasticsearch "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]",
portal-elastic-es-main-0 elasticsearch "at java.lang.Thread.run(Thread.java:830) [?:?]"] }

portal-elastic-kb-75cb599c99-72f5h kibana {"type":"error","@timestamp":"2020-03-05T12:23:14Z","tags":[],"pid":6,"level":"error","error":{"message":"[remote_transport_exception] [portal-elastic-es-main-2][10.52.4.33:9300][cluster:admin/slm/execute]","name":"Error","stack":"Error: [remote_transport_exception] [portal-elastic-es-main-2][10.52.4.33:9300][cluster:admin/slm/execute]\n    at respond (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)\n    at checkRespForFailure (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)\n    at HttpConnector.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)\n    at IncomingMessage.wrapper (/usr/share/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)\n    at IncomingMessage.emit (events.js:194:15)\n    at endReadableNT (_stream_readable.js:1103:12)\n    at process._tickCallback (internal/process/next_tick.js:63:19)"},"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":{},"pathname":"/api/snapshot_restore/policy/daily/run","path":"/api/snapshot_restore/policy/daily/run","href":"/api/snapshot_restore/policy/daily/run"},"message":"[remote_transport_exception] [portal-elastic-es-main-2][10.52.4.33:9300][cluster:admin/slm/execute]"}

The PUT operation should either fail or, preferably, add an empty "config": { } block to the created policy.

Steps to reproduce:

  1. Set up basic Kibana / Elasticsearch nodes with path.repo in the latter's settings.
  2. Set up your backup location:
curl -X PUT "localhost:9200/_snapshot/my_backup?pretty" -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "location": "my_backup_location"
  }
}
'
  1. Set up your ILM policy without a config block:
curl -X PUT "localhost:9200/_slm/policy/nightly-snapshots?pretty" -H 'Content-Type: application/json' -d'
{
  "schedule": "0 30 1 * * ?",
  "name": "<nightly-snap-{now/d}>",
  "repository": "my_backup",    
  "retention": {
    "expire_after": "30d",
    "min_count": 5,
    "max_count": 50
  }
}
'
  1. Open the Kibana UI, go to Management > Elasticsearch > Snapshot and Restore > Policies and click the "Run now" button. The operation will fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions