bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.85k stars 9.14k forks source link

[bitnami/opensearch] Can't install plugins #29498

Open hnc-lcy9104 opened 4 days ago

hnc-lcy9104 commented 4 days ago

Name and Version

bitnami/opensearch 1.2.10

What architecture are you using?

None

What steps will reproduce the bug?

  1. In this environment: aws eks v1.30.
  2. With this config: plugins: repository-s3

Are you using any custom parameters or values?

values = [
  <<-EOT
    ......
    plugins: repository-s3
    ......
  EOT
]

What is the expected behavior?

Install plugins.

What do you see instead?

I added plugins: repository-s3 to the values.yaml that was working fine, but a new pod is not being created. After removing plugins: repository-s3 from values.yaml and running opensearch-plugin install repository-s3 by executing into the pod with exec bash, I got the following result: opensearch-plugin install repository-s3

-> Installing repository-s3
-> Downloading repository-s3 from opensearch
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.io.FilePermission config#plus read
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.RuntimePermission setContextClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.net.NetPermission setDefaultAuthenticator
* java.net.SocketPermission * connect,resolve
* java.util.PropertyPermission aws.configFile read,write
* java.util.PropertyPermission aws.sharedCredentialsFile read,write
* java.util.PropertyPermission opensearch.allow_insecure_settings read,write
* java.util.PropertyPermission opensearch.path.conf read,write
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Failed installing repository-s3
-> Rolling back repository-s3
-> Rolled back repository-s3
Exception in thread "main" java.nio.file.FileSystemException: /opt/bitnami/opensearch/config/repository-s3: Operation not permitted
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:277)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:299)
    at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2167)
    at org.opensearch.plugins.InstallPluginCommand.setFileAttributes(InstallPluginCommand.java:1022)
    at org.opensearch.plugins.InstallPluginCommand.installConfig(InstallPluginCommand.java:977)
    at org.opensearch.plugins.InstallPluginSupportFiles(InstallPluginCommand.java:913)
    at org.opensearch.plugins.InstallPluginCommand.installPlugin(InstallPluginCommand.java:889)
    at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:276)
    at org.opensearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:250)
    at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104)
    at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
    at org.opensearch.cli.MultiCommand.execute(MultiCommand.java:104)
    at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
    at org.opensearch.cli.Command.main(Command.java:101)
    at org.opensearch.plugins.PluginCli.main(PluginCli.java:60)

Also, according to this link, it says, "The Bitnami OpenSearch Docker image comes with the S3 Repository plugin installed by default," so shouldn’t the repository-s3 plugin already be installed?

However, when I run the opensearch-plugin list command, it is not listed.

Additional information

No response

juan131 commented 3 hours ago

Hi @hnc-lcy9104

I was able to reproduce the issue with that particular plugin, but I was able to install other plugins (e.g. analysis-icu). It looks like the issue you're facing is related to filesystem permissions, under investigation.

Also, according to this link, it says, "The Bitnami OpenSearch Docker image comes with the S3 Repository plugin installed by default," so shouldn’t the repository-s3 plugin already be installed?

This looks like a copy-paste error given OpenSearch's README was based on ElasticSearch one. As you can see in the logs below, if you try to install that plugin using ElasticSearch you find a warning saying it's already packaged:

elasticsearch 11:15:18.74 DEBUG ==> Installing plugin: repository-s3
-> Installing repository-s3
[repository-s3] is no longer a plugin but instead a module packaged with this distribution of Elasticsearch
-> Please restart Elasticsearch to activate any plugins installed

I'll send a PR to amend it.