Guys this has me tearing my hair out and I’d love some input.
I’m trying to create a server that has Nextcloud, OnlyOffice and Elasticsearch running together in separate docker containers, speaking to each other. The docker-compose.yml looks like this:
I’ve given that a go, but any version later than Elasticsearch v6.6x creates another rather separate problem while compiling the docker image with the ingest attachment:
-> Downloading ingest-attachment from elastic
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
* java.security.SecurityPermission insertProvider
* java.security.SecurityPermission putProviderProperty.BC
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.
Exception in thread "main" java.lang.IllegalStateException: unable to read from standard input; is standard input open and a tty attached?
at org.elasticsearch.cli.Terminal$SystemTerminal.readText(Terminal.java:173)
at org.elasticsearch.plugins.PluginSecurity.prompt(PluginSecurity.java:74)
at org.elasticsearch.plugins.PluginSecurity.confirmPolicyExceptions(PluginSecurity.java:67)
at org.elasticsearch.plugins.InstallPluginCommand.installPlugin(InstallPluginCommand.java:802)
at org.elasticsearch.plugins.InstallPluginCommand.install(InstallPluginCommand.java:776)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:231)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:216)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:77)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47)
The command '/bin/sh -c bin/elasticsearch-plugin install ingest-attachment' returned a non-zero code: 1
The error code causes the docker build to fail, so I can’t bring up a docker image that’s later than v6.6x and has the ingest attachment.
Just a quick update because this comes up in top searches on the topic. I was able to get this working using the below. Note, my example uses an external nginx proxy in a separate docker-compose.
Nextcloud:latest or 17 at the time of this writing
elasticsearch:6.8.8
Had to run this inside the elasticsearch container (install ingest-attachment)…
Indexes could then successfully occur using docker exec --user www-data nextcloud_app_1 php occ fulltextsearch:index --no-readline.
Make sure you have also filled in and installed the needed search plugins in your nextcloud admin panel. Hint internal docker IP cant be found using docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nextcloud_esearch
Important thing to note as have been mentioned here. Support for 6.6 or lower might not work (I used 6.8.8), support for 7+ of elasticsearch wouldn’t work for me.
Extend Elasticsearch container…
FROM elasticsearch:6.8.8
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment && \
yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/ && \
rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key && \
yum update -y && \
yum install tesseract {% for language in tessreact_language_packs %}tesseract-langpack-{{language }} {% endfor %} -y && \
yum clean all
I will play around with this. I assumed that the plugin will get wiped if I did a full rebuild and had not tackled that problem. I was assuming I would have to map a volume/dir to preserve the data, but this may be more ideal (build your own image).
My install does not account for PDF’s and tesseract. I was just concerned with plain text so good info, thanks!
It looks like the “approved” way is to extend the image by building a new one like /u/Reiner_Nippes pointed out. I didn’t find a method to preserve plugins using volumes or persistent mount points.
Hi, I’m having issues with installing Elastic Search in Nextcloud 18.4. It seems to be a path issue with fulltextsearch looking for /nextcloud. My nextcloud docker doesnt use a subfolder.
I’ve installed the ingest module in Elasticsearch as recommended above. Elastic search fails with an error on test.
root@Nexus:/mnt/user/appdata/nextcloud/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service# docker exec --user abc nextcloud php7 /config/www/nextcloud/occ fulltextsearch:check
Full text search 1.4.1
.Testing your current setup:
Creating mocked content provider. ok
Testing mocked provider: get indexable documents. (2 items) ok
Loading search platform. (Elasticsearch) ok
Testing search platform. ok
Locking process ok
Removing test. ok
Pausing 3 seconds 1 2 3 ok
Initializing index mapping. fail
Error detected, unlocking process ok
In Connection.php line 632:
{“error”:{“root_cause”:[{“type”:“illegal_argument_exception”,“reason”:“requ
est [/nextcloud] contains unrecognized parameter: [include_type_name]”}],“t
ype”:“illegal_argument_exception”,“reason”:“request [/nextcloud] contains u
nrecognized parameter: [include_type_name]”},“status”:400}