Skip to content
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

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

Closed
bcbrockway opened this issue Mar 5, 2020 · 2 comments · Fixed by #53328
Labels

Comments

@bcbrockway
Copy link

bcbrockway commented Mar 5, 2020

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.
@cbuescher cbuescher added the :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs label Mar 9, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@ywelsch ywelsch added :Data Management/ILM+SLM Index and Snapshot lifecycle management and removed :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Mar 9, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/ILM+SLM)

probakowski added a commit to probakowski/elasticsearch that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to elastic#44465

Closes elastic#53171
probakowski added a commit that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to #44465

Closes #53171

Co-authored-by: Elastic Machine <[email protected]>
probakowski added a commit to probakowski/elasticsearch that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to elastic#44465

Closes elastic#53171

Co-authored-by: Elastic Machine <[email protected]>
probakowski added a commit to probakowski/elasticsearch that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to elastic#44465

Closes elastic#53171

Co-authored-by: Elastic Machine <[email protected]>
probakowski added a commit that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to #44465

Closes #53171

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
probakowski added a commit that referenced this issue Mar 10, 2020
This avoids NPE when executing SLM policy when no config was provided.

Related to #44465

Closes #53171

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants