Failed to load plugin class [org.elasticsearch.xpack.security.Security

Hi, I am completely new to elastic, trying to use it inside a magento store on kubernetes.
(It worked with 6.8.5).

I tried to upgrade to 7.9.0, and I am getting an error:

failed to load plugin class [org.elasticsearch.xpack.security.Security

This is the link for the elasicsearch in my cluster:
https://github.com/hershkoy/magento2-on-kubernetes/blob/feature/phpfpm74_magento242/deploy/bases/elasticsearch/elasticsearch.yaml

The relevant part I think is:

      xpack.security.authc:
        anonymous:
          username: anonymous
          roles: superuser
          authz_exception: false

What do I need to change in order to allow this to work?

I am trying to change the configuration. This is current configuration that I am testing:

spec:
  version: 7.9.0
  nodeSets:
  - name: elasticsearch
    count: 1
    config:
      node.master: true
      node.data: true
      node.ingest: true
      node.store.allow_mmap: false
      xpack.security.authc:
        anonymous:
          username: anonymous
          roles: superuser
          authz_exception: false
          realms:
            native1:
              type: native
              order: 0

I am getting a different error now.:

{"timestamp": "2021-06-12T19:20:43+0000", "message": "readiness probe failed", "curl_rc": "7"}
{"type": "server", "timestamp": "2021-06-12T19:20:43,888Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "version[7.9.0], pid[8], build[default/docker/a479a2a7fce0389512d6a9361301708b92dff667/2020-08-11T21:36:48.204330Z], OS[Linux/3.10.0-1160.15.2.el7.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/14.0.1/14.0.1+7]" }
{"type": "server", "timestamp": "2021-06-12T19:20:43,896Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "JVM home [/usr/share/elasticsearch/jdk]" }
{"type": "server", "timestamp": "2021-06-12T19:20:43,897Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -XX:+ShowCodeDetailsInExceptionMessages, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, -Xms1g, -Xmx1g, -XX:+UseG1GC, -XX:G1ReservePercent=25, -XX:InitiatingHeapOccupancyPercent=30, -Djava.io.tmpdir=/tmp/elasticsearch-8253529450232733301, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Des.cgroups.hierarchy.override=/, -Xms512m, -Xmx512m, -XX:MaxDirectMemorySize=268435456, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=docker, -Des.bundled_jdk=true]" }
{"timestamp": "2021-06-12T19:20:48+0000", "message": "readiness probe failed", "curl_rc": "7"}
{"type": "server", "timestamp": "2021-06-12T19:20:51,794Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "loaded module [aggs-matrix-stats]" }
{"type": "server", "timestamp": "2021-06-12T19:20:51,795Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "loaded module [analysis-common]" }
:
:
:
{"type": "server", "timestamp": "2021-06-12T19:20:51,816Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "loaded module [x-pack-stack]" }
{"type": "server", "timestamp": "2021-06-12T19:20:51,816Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "loaded module [x-pack-voting-only-node]" }
{"type": "server", "timestamp": "2021-06-12T19:20:51,816Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "loaded module [x-pack-watcher]" }
{"type": "server", "timestamp": "2021-06-12T19:20:51,816Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "no plugins loaded" }
{"type": "deprecation", "timestamp": "2021-06-12T19:20:51,893Z", "level": "WARN", "component": "o.e.d.c.s.Settings", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "[node.data] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "server", "timestamp": "2021-06-12T19:20:51,989Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/disk/by-id/scsi-0HC_Volume_11750478)]], net usable_space [9.7gb], net total_space [9.7gb], types [ext4]" }
{"type": "server", "timestamp": "2021-06-12T19:20:51,989Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "heap size [512mb], compressed ordinary object pointers [true]" }
{"type": "deprecation", "timestamp": "2021-06-12T19:20:51,995Z", "level": "WARN", "component": "o.e.d.c.s.Settings", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "[node.master] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "server", "timestamp": "2021-06-12T19:20:52,160Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "node name [elasticsearch-es-elasticsearch-0], node ID [8XWEoEWDSV6Zkr0Q-twgsw], cluster name [elasticsearch]" }
{"timestamp": "2021-06-12T19:20:53+0000", "message": "readiness probe failed", "curl_rc": "7"}
{"timestamp": "2021-06-12T19:20:58+0000", "message": "readiness probe failed", "curl_rc": "7"}
{"type": "deprecation", "timestamp": "2021-06-12T19:21:01,167Z", "level": "WARN", "component": "o.e.d.c.s.Settings", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "[node.ingest] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "server", "timestamp": "2021-06-12T19:21:01,180Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-es-elasticsearch-0", "message": "uncaught exception in thread [main]", 
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [xpack.security.authc.anonymous.realms.native1.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.9.0.jar:7.9.0]",
"at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.9.0.jar:7.9.0]",
"Caused by: java.lang.IllegalArgumentException: unknown setting [xpack.security.authc.anonymous.realms.native1.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
"at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:544) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:489) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:460) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:431) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:149) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.node.Node.<init>(Node.java:385) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.node.Node.<init>(Node.java:277) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.9.0.jar:7.9.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.9.0.jar:7.9.0]",
"... 6 more",

The realm settings have a breaking change in 7.0

Instead of xpack.security.authc.anonymous.realms.native1.type, you need specify the type in the setting name like xpack.security.authc.anonymous.realms.native.native1. That is, in your elasticsearch.yml file, you need something like the follows:

      xpack.security.authc.realms:
          native.native1:
              order: 0

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.