Back to LanguageTool Homepage - Privacy - Imprint

Can't connect LibO extension to local server

Running a local LT server (as root for the time being), I want to make the LibreOffice LT extension use that server. So I click

Tools => LanguageTool => Options… => General

[X] Use remote server to check text
[X] Use server: http://localhost:8081/v2

After pressing the OK button, a windows opens with a message

Connection refused:
Switch to internal LanguageTool application

The server log has the following error message:

java[19736]: 2020-03-10 15:52:28 +0000 Server started
java[19736]: 2020-03-10 16:54:52 +0100 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'Unsupported action: 'v2/configinfo'. Please see https://languagetool.org/http-api/swagger-ui/#/default', sending HTTP code 404. Access from 127.0.0.1, HTTP user agent: Java/11.0.6, User agent param: null, Referrer: null, language: de-DE, h: 1, r: 1, time: 35m: ALL, Stacktrace follows:org.languagetool.server.PathNotFoundException: Unsupported action: 'v2/configinfo'. Please see https://languagetool.org/http-api/swagger-ui/#/default
java[19736]:         at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:85)
java[19736]:         at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:170)
java[19736]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
java[19736]:         at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
java[19736]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
java[19736]:         at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
java[19736]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
java[19736]:         at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
java[19736]:         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java[19736]:         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java[19736]:         at java.base/java.lang.Thread.run(Thread.java:834)

Any advice on how to connect LibO LT extension to a local server is much appreciated.

System:

$ lsb_release -d
Description:	Ubuntu 19.10
$ LANG=C apt-cache policy libreoffice | grep -i installed
  Installed: 1:6.3.5-0ubuntu0.19.10.1
$ ls LanguageTool-*.oxt
LanguageTool-4.8.oxt
# Server start-up command:
$ grep java /etc/systemd/system/languagetool.service
ExecStart=/usr/bin/java -cp /opt/LanguageTool/languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin "*" --languageModel /opt/ngrams/

Could you try with a more recent snapshot of the LT server, like https://internal1.languagetool.org/snapshots/LanguageTool-20200309-snapshot.zip?

Same behaviour. Though, I only run the server v4.9 snapshot that you linked to. LibO extension was still v4.8.

Here’s the log again:

systemd[1]: Started LanguageTool server.
java[23155]: 2020-03-10 18:01:04 +0100 INFO  org.languagetool.server.DatabaseAccess Not setting up database access, dbDriver is not configured
java[23155]: 2020-03-10 17:01:04 +0000 ****************************************************************************************************
java[23155]: 2020-03-10 17:01:04 +0000 *** WARNING: this process is running as root - please do not run it as root for security reasons ***
java[23155]: 2020-03-10 17:01:04 +0000 ****************************************************************************************************
java[23155]: 2020-03-10 17:01:04 +0000 WARNING: running in HTTP mode, consider running LanguageTool behind a reverse proxy that takes care of encryption (HTTPS)
java[23155]: 2020-03-10 17:01:06 +0000 Setting up thread pool with 10 threads
java[23155]: 2020-03-10 17:01:06 +0000 Starting LanguageTool 4.9-SNAPSHOT (build date: 2020-03-09 19:46, 0b44f07) server on http://localhost:8081...
java[23155]: 2020-03-10 17:01:06 +0000 Server started
java[23155]: 2020-03-10 18:01:32 +0100 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'Unsupported action: 'v2/configinfo'. Please see https://languagetool.org/http-api/swagger-ui/#/default', sending HTTP code 404. Access from 127.0.0.1, HTTP user agent: Java/11.0.6, User agent param: null, Referrer: null, language: de-DE, h: 1, r: 1, time: 35m: ALL, Stacktrace follows:org.languagetool.server.PathNotFoundException: Unsupported action: 'v2/configinfo'. Please see https://languagetool.org/http-api/swagger-ui/#/default
java[23155]:         at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:87)
java[23155]:         at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:179)
java[23155]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
java[23155]:         at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
java[23155]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
java[23155]:         at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
java[23155]:         at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
java[23155]:         at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
java[23155]:         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java[23155]:         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java[23155]:         at java.base/java.lang.Thread.run(Thread.java:834)

And same behaviour after installing v4.9 snapshot extension.

Please try http://localhost:8081/ as the server URL.

That seems to work. Will that be the new URL or will the extension be fixed?

I guess that was the URL all the time. @Fred.Kruse Maybe we can warn if someone uses /v2 in the URL? Unfortunately, we use it in the browser add-on, which confuses people.

And it’s documented with trailing /v2 at http://wiki.languagetool.org/http-server#toc1

Just I added a hint in the option panel and a test of the URL (generates a message) if you click at the OK Button.

@Fred.Kruse Thanks!