erikvl87 / docker-languagetool Goto Github PK
View Code? Open in Web Editor NEWDockerfile for LanguageTool server - configurable
Home Page: https://hub.docker.com/r/erikvl87/languagetool
License: GNU Lesser General Public License v2.1
Dockerfile for LanguageTool server - configurable
Home Page: https://hub.docker.com/r/erikvl87/languagetool
License: GNU Lesser General Public License v2.1
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2
Hi, Using the container linux/amd64 (5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux) latest output a checksum error related to ngrams (whichever the language is requested). Reverting to 5.6-dockerupdate-3 work just fine.
On 5.7 :
At first I tought my french ngrams were corrupted, but the result is the same in english, and I redownloaded all ngrams just in case.
The following configuration is passed to LanguageTool:
languageModel=/ngrams
+ java -Xms512m -Xmx1g -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config config.properties
2022-03-31 23:00:54.436 +0000 INFO org.languagetool.server.DatabaseAccessOpenSource Not setting up database access, dbDriver is not configured
2022-03-31 23:00:54 +0000 WARNING: running in HTTP mode, consider running LanguageTool behind a reverse proxy that takes care of encryption (HTTPS)
2022-03-31 23:00:54 +0000 WARNING: running in public mode, LanguageTool API can be accessed without restrictions!
2022-03-31 23:00:54 +0000 Setting up thread pool with 10 threads
2022-03-31 23:00:55 +0000 Starting LanguageTool 5.7 (build date: 2022-03-30 13:58:36 +0000, 35d0d40) server on http://localhost:8010...
2022-03-31 23:00:55 +0000 Server started
2022-03-31 23:00:57.496 +0000 INFO org.languagetool.server.LanguageToolHttpHandler Handling POST /v2/check
2022-03-31 23:01:02.143 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=97ec8ffc actual=901b5b3c (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/ngrams/fr/1grams/_16.fdx"))), detected: fr', sending HTTP code 500. Access from 172.18.0.1, HTTP user agent: curl/7.74.0, User agent param: null, Referrer: null, language: fr, h: 1, r: 1, time: 4656text length: 8, m: ALL, l: DEFAULT, Stacktrace follows:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=97ec8ffc actual=901b5b3c (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/ngrams/fr/1grams/_16.fdx"))), detected: fr
at org.languagetool.server.TextChecker.checkText(TextChecker.java:496)
at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:173)
at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:84)
at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:185)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:730)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:699)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=97ec8ffc actual=901b5b3c (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/ngrams/fr/1grams/_16.fdx")))
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.languagetool.server.TextChecker.checkText(TextChecker.java:477)
... 12 more
Caused by: java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=97ec8ffc actual=901b5b3c (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/ngrams/fr/1grams/_16.fdx")))
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.getCachedLuceneSearcher(LuceneSingleIndexLanguageModel.java:186)
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.addIndex(LuceneSingleIndexLanguageModel.java:118)
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.<init>(LuceneSingleIndexLanguageModel.java:93)
at org.languagetool.languagemodel.LuceneLanguageModel.<init>(LuceneLanguageModel.java:65)
at org.languagetool.Language.initLanguageModel(Language.java:180)
at org.languagetool.language.French.getLanguageModel(French.java:149)
at org.languagetool.JLanguageTool.activateLanguageModelRules(JLanguageTool.java:594)
at org.languagetool.server.Pipeline.activateLanguageModelRules(Pipeline.java:103)
at org.languagetool.server.PipelinePool.createPipeline(PipelinePool.java:121)
at org.languagetool.server.PipelinePool.getPipeline(PipelinePool.java:78)
at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:789)
at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:743)
at org.languagetool.server.TextChecker.lambda$checkText$4(TextChecker.java:460)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 3 more
Caused by: org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=97ec8ffc actual=901b5b3c (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/ngrams/fr/1grams/_16.fdx")))
at org.apache.lucene.codecs.CodecUtil.checkFooter(CodecUtil.java:334)
at org.apache.lucene.codecs.CodecUtil.checkFooter(CodecUtil.java:364)
at org.apache.lucene.codecs.compressing.CompressingStoredFieldsReader.<init>(CompressingStoredFieldsReader.java:140)
at org.apache.lucene.codecs.compressing.CompressingStoredFieldsFormat.fieldsReader(CompressingStoredFieldsFormat.java:121)
at org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat.fieldsReader(Lucene50StoredFieldsFormat.java:173)
at org.apache.lucene.index.SegmentCoreReaders.<init>(SegmentCoreReaders.java:117)
at org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:65)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:58)
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:50)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:731)
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:50)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel$LuceneSearcher.<init>(LuceneSingleIndexLanguageModel.java:241)
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel$LuceneSearcher.<init>(LuceneSingleIndexLanguageModel.java:229)
at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.getCachedLuceneSearcher(LuceneSingleIndexLanguageModel.java:182)
... 16 more
2022-03-31 23:01:02.171 +0000 INFO org.languagetool.server.LanguageToolHttpHandler Handled request in 4685ms; sending code 500
If I run the docker image, it does an automatic POST request every 30s.
I want to run the image on my Synology NAS and these POST request prevents the hard disks to go in hibernation state. I tried the image on my Windows machine with the same outcome.
If I run the LanguageTool server without the docker image on my Windows machine with java, there are no requests sent.
Debian Testing X64, Docker Run
docker run -d --name=languagetool \
--restart unless-stopped \
-e langtool_languageModel=/ngrams \
-e Java_Xmx=1400m \
--memory 1024m --memory-swap 1300m \
-e EXTRAOPTIONS="-Xmx582M" \
-v /media//languagetool/ngram:/ngrams \
-p 8010:8010 \
erikvl87/languagetool
2021-07-23 08:05:15.639 +0000 WARN org.languagetool.language.LanguageIdentifier Cannot consider noopLanguages because not in fastText mode: [en, es]
2021-07-23 08:06:30.277 +0000 INFO org.languagetool.server.TextChecker Check done: 278 chars, en-US[auto], requestId: null, #279, null, 2 matches, 2339632ms, agent:webextension-chrome-ng, v:4.0.7, sent, q:112, h:10, dH:1, m:!tlo
2021-07-23 08:06:30.280 +0000 WARN org.languagetool.language.LanguageIdentifier Cannot consider noopLanguages because not in fastText mode: [en, es]
2021-07-23 08:06:30.367 +0000 INFO org.languagetool.server.TextChecker Check done: 365 chars, en-US[auto], requestId: null, #280, null, 0 matches, 89ms, agent:webextension-chrome-ng, v:4.0.7, sent, q:111, h:10, dH:1, m:tlo
2021-07-23 08:06:30.369 +0000 WARN org.languagetool.language.LanguageIdentifier Cannot consider noopLanguages because not in fastText mode: [en, es]
2021-07-23 08:11:07.448 +0000 INFO org.languagetool.server.TextChecker Check done: 278 chars, en-US[auto], requestId: null, #276, null, 2 matches, 2439416ms, agent:webextension-chrome-ng, v:4.0.7, sent, q:112, h:10, dH:1, m:!tlo
2021-07-23 08:11:07.450 +0000 WARN org.languagetool.language.LanguageIdentifier Cannot consider noopLanguages because not in fastText mode: [en, es]
2021-07-23 08:16:02.186 +0000 INFO org.languagetool.server.TextChecker Check done: 366 chars, en-US[auto], requestId: null, #277, null, 0 matches, 294737ms, agent:webextension-chrome-ng, v:4.0.7, notSent: Broken pipe, q:112, h:10, dH:1,
m:tlo
2021-07-23 08:16:35.247 +0000 WARN org.languagetool.language.LanguageIdentifier Cannot consider noopLanguages because not in fastText mode: [en, es]
start.sh: line 18: 8 Killed java -Xms$Xms -Xmx$Xmx -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config config.properties
The following output is given by our Release
Github Action:
Run echo "::set-env name=DOCKER_TAG::$(echo refs/tags/v5.2 | grep -oP '(?<=refs/tags/v).*')"
Error: Unable to process command '::set-env name=DOCKER_TAG::5.2' successfully.
Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
This blocks the release of the v5.2 docker container.
Trying to use a language other than en-US
(such as de-DE
with the word autohaus
) will result in the following server error:
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries277612737966416782/libhunspell.so : Error loading shared library libstdc++.so.6: No such file or directory (needed by /tmp/BridJExtractedLibraries277612737966416782/libhunspell.so)
2021-03-05 12:31:00 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sent
at org.languagetool.server.TextChecker.checkText(TextChecker.java:397)
at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:148)
at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:73)
at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:180)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>autohaus</sentcontent>
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.languagetool.server.TextChecker.checkText(TextChecker.java:378)
... 12 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>autohaus</sentcontent>
at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1186)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:930)
at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:645)
at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:594)
at org.languagetool.server.TextChecker.access$000(TextChecker.java:56)
at org.languagetool.server.TextChecker$1.call(TextChecker.java:371)
at org.languagetool.server.TextChecker$1.call(TextChecker.java:364)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 3 more
Caused by: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>autohaus</sentcontent>
at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1830)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1724)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1696)
at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1182)
... 10 more
Caused by: java.lang.RuntimeException: Could not create hunspell instance. Please note that LanguageTool supports only 64-bit platforms (Linux, Windows, Mac) and that it requires a 64-bit JVM (Java).
at org.languagetool.rules.spelling.hunspell.Hunspell.<init>(Hunspell.java:51)
at org.languagetool.rules.spelling.hunspell.Hunspell.getInstance(Hunspell.java:62)
at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:368)
at org.languagetool.rules.de.GermanSpellerRule.init(GermanSpellerRule.java:1065)
at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:342)
at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:122)
at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1255)
at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1803)
... 13 more
Caused by: java.lang.UnsatisfiedLinkError: 'long dumonts.hunspell.bindings.HunspellLibrary.Hunspell_create(long, long)'
at dumonts.hunspell.bindings.HunspellLibrary.Hunspell_create(Native Method)
at dumonts.hunspell.bindings.HunspellLibrary.Hunspell_create(HunspellLibrary.java:25)
at org.languagetool.rules.spelling.hunspell.Hunspell.<init>(Hunspell.java:45)
... 20 more
It seems that the library libstdc++.so.6
is missing from the distribution.
P.S.: Thanks for the project!
Some LanguageTool guides recommend adding fasttext
to system and set fasttextModel
/fasttextBinary
settings.
Does it really useful?
Should we add a guide? Or maybe add at least fasttext
binary to Docker image?
We are sending a large number of requests per second to this server and receiving a lot of 502 errors. The server itself doesn't log any errors. We are running this with 128 threads, pipeline cache is enabled. I have tried increasing all the timeouts to no avail.
Ideally we want to send around 1000 rps, but regardless of server resource, the server doesn't seem to be able to handle any more than 300/s.
It looks like the connection is prematurely closing. Any help would be appreciated.
LanguageTool could create a (patch) release that potentially doesn't affect the standalone version. In that case they won't always update the version of the release inside the languagetool-standalone
directory.
See languagetool-org/languagetool#3659
This breaks the current build of the Dockerfile since it assumes the same version in the languagtool-standalone
directory. This blocked the Docker release of 5.1.1
and 5.1.2
.
To prevent checking the changelog on every release if it affects the standalone version, the Dockerfile needs to be updated to be able to fall back on whatever version is being shipped inside that folder.
Please include support for run this image as specific docker user. As running as root is not identical. Thanks.
would you accept a PR to set -XX:+UseConcMarkSweepGC
(optionally) in start.sh?
this increases CPU slightly but reduces GC related CPU spikes
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms.html
Hi,
is it somehow possible to create a user account so that only I can access the API? I was looking at the possible config options. The only thing that sounds like it might work is set maxTextLength
to 0 and set a secretTokenKey
, but I can't find out how to generate that key and how I would configure my clients.
Any ideas? Thanks a lot!
Hi,
I am not sure if it is the Docker setup or LT uses way too much IO. Here I ran "Iotop -a" for like 10 mins and you can see it already read like many GBs. This happens during the day all day, this is just a snapshot.
The thing is that this whole this time while consuming IO like this, the browser client thinks the server is dead or unaccessible. I am the only user with couple browser clients, I do not know why it needs to read hundreds of GBs a day so that it can complete couple words.
This is how I run it on Debian Testing x64
docker run -d --name=languagetool \
--restart unless-stopped \
-e langtool_languageModel=/ngrams \
-e Java_Xms=1000m \
-e Java_Xmx=2000m \
-v /media/docker/languagetool/ngram:/ngrams \
-p 8010:8010 \
erikvl87/languagetool
due to no resume capabilties facing issues in downloading ngram data please upload it on server that provides resume capabilty.
This project doesn't have any licence file attached to it. This makes the source code fall under your exclusive copyright, which means that others aren't really allowed to freely use, modify, or share this (source).
Was this your intention? If not, please add an open-source licence file to this repo. I suggest GNU LGPLv3 to somewhat mirror the licence of LanguageTool itself (which is the compatible LGPLv2.1), but you're free to choose since you, as far as I unserstand, aren't reusing any code from them.
I am trying to use the languagetool to check the spelling in a webform (language is de-de). Spelling mistake deise -> diese. The result is the following server error:
languagetool | at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1298)
languagetool | at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:991)
languagetool | at org.languagetool.JLanguageTool.check2(JLanguageTool.java:918)
languagetool | at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:802)
languagetool | at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:751)
languagetool | at org.languagetool.server.TextChecker.lambda$checkText$5(TextChecker.java:472)
languagetool | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
languagetool | ... 3 more
languagetool | Caused by: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>deise</sentcontent>
languagetool | at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1993)
languagetool | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1866)
languagetool | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1833)
languagetool | at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1294)
languagetool | ... 9 more
languagetool | Caused by: java.lang.RuntimeException: Could not create hunspell instance. Please note that LanguageTool supports only 64-bit platforms (Linux, Windows, Mac) and that it requires a 64-bit JVM (Java).
languagetool | at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:35)
languagetool | at org.languagetool.rules.spelling.hunspell.Hunspell.getDictionary(Hunspell.java:46)
languagetool | at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:584)
languagetool | at org.languagetool.rules.de.GermanSpellerRule.init(GermanSpellerRule.java:1557)
languagetool | at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:558)
languagetool | at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:220)
languagetool | at org.languagetool.rules.de.GermanSpellerRule.match(GermanSpellerRule.java:1475)
languagetool | at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1370)
languagetool | at org.languagetool.JLanguageTool.access$1500(JLanguageTool.java:74)
languagetool | at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1950)
languagetool | ... 12 more
languagetool | Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'hunspell':
languagetool | Error loading shared library libhunspell.so: No such file or directory
languagetool | Error loading shared library libhunspell.so: No such file or directory
languagetool | Native library (linux-aarch64/libhunspell.so) not found in resource path (languagetool-server.jar)
languagetool | at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:307)
languagetool | at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467)
languagetool | at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:409)
languagetool | at dumonts.hunspell.bindings.HunspellLibrary.<clinit>(HunspellLibrary.java:16)
languagetool | at dumonts.hunspell.Hunspell.<init>(Hunspell.java:21)
languagetool | at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:33)
languagetool | ... 21 more
languagetool | Suppressed: java.lang.UnsatisfiedLinkError: Error loading shared library libhunspell.so: No such file or directory
languagetool | at com.sun.jna.Native.open(Native Method)
languagetool | at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:197)
languagetool | ... 26 more
languagetool | Suppressed: java.lang.UnsatisfiedLinkError: Error loading shared library libhunspell.so: No such file or directory
languag
System: Raspberry PI4 arm64; Linux 6.0.0-5-arm64 #1 SMP Debian 6.0.10-2 (2022-12-01) aarch64 GNU/Linux
Docker Image: image: erikvl87/languagetool:latest
What's wrong here? Why is libhunspell.so not loaded? It is present in /LanguageTool/libs/hunspell.jar
When use /v2/world API to access server,I got some unexpected errors.When I set the apikey parameter or the username parameter to null, I get a 500 status code. This means that the server side parsed the values of these two parameters, but parsed them incorrectly. This creates a possible security issue, such as an injection. So I think the server should be more strict with the formatting of the parameters and not parse the special values, but return 4xx, indicating that the user has a request construction error.
/v2/words
GET
Here is the relvant line from the logs:
languagetool | Caused by: java.lang.UnsatisfiedLinkError: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /home/languagetool/.cache/JNA/temp/jna8961190279417234313.tmp)
Any more info I can supply?
II've been happily using your image for a couple of months and have set it to auto-update via watchtower so I know it stopped working after the last update.
Seeing as there are a few things that should only be run on ARM builds, I've taken the liberty of looking at the Dockerfile to see if I could optimise it with buildkit for my fork.
I thought I'd put it here as well in case it's useful:
Note: This is largely untested currently.
Any thoughts on it would be greatly appreciated. Cheers!
# syntax = docker/dockerfile:latest
FROM debian:bookworm as base
ARG LANGUAGETOOL_VERSION=6.2
ARG TARGETARCH
LABEL maintainer='modem7'
FROM base AS base-amd64
FROM base AS base-arm64
FROM base-${TARGETARCH}${TARGETVARIANT} as build
ENV DEBIAN_FRONTEND=noninteractive
RUN <<EOF
set -x
if [ "$TARGETARCH" = "arm64" ]
then
echo "Installing additional packages for ARM"
apt-get update -y
apt-get install -y \
build-essential \
cmake \
git \
mercurial \
texlive \
wget \
zip
else
echo "Not installing ARM packages"
fi
EOF
RUN <<EOF
set -x
apt-get update -y
apt-get install -y \
bash \
libgomp1 \
locales \
maven \
openjdk-17-jdk-headless \
unzip \
xmlstarlet
EOF
RUN <<EOF
set -x
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG=en_US.UTF-8
EOF
ENV LANG en_US.UTF-8
ARG LANGUAGETOOL_VERSION
ADD --link --keep-git-dir=true https://github.com/languagetool-org/languagetool.git#v${LANGUAGETOOL_VERSION} /languagetool
WORKDIR /languagetool
RUN <<EOF
set -x
mvn --projects languagetool-standalone --also-make package -DskipTests -Daether.dependencyCollector.impl=bf --quiet
LANGUAGETOOL_DIST_VERSION=$(xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "//x:project/x:properties/x:revision" pom.xml)
unzip /languagetool/languagetool-standalone/target/LanguageTool-${LANGUAGETOOL_DIST_VERSION}.zip -d /dist
LANGUAGETOOL_DIST_FOLDER=$(find /dist/ -name 'LanguageTool-*')
mv $LANGUAGETOOL_DIST_FOLDER /dist/LanguageTool
EOF
# Execute workarounds for ARM64 architectures.
# https://github.com/languagetool-org/languagetool/issues/4543
WORKDIR /
COPY --link --chmod=755 arm64-workaround/bridj.sh arm64-workaround/bridj.sh
COPY --link --chmod=755 arm64-workaround/hunspell.sh arm64-workaround/hunspell.sh
RUN <<EOF
set -x
if [ "$TARGETARCH" = "arm64" ]
then
echo "Implementing ARM workarounds"
# chmod +x arm64-workaround/bridj.sh
bash -c "arm64-workaround/bridj.sh"
# chmod +x arm64-workaround/hunspell.sh
bash -c "arm64-workaround/hunspell.sh"
else
echo "Not implementing ARM workarounds"
fi
EOF
WORKDIR /languagetool
# Note: When changing the base image, verify that the hunspell.sh workaround is
# downloading the matching version of `libhunspell`. The URL may need to change.
FROM alpine:3.18.4
RUN <<EOF
set -x
apk add --no-cache \
bash \
curl \
libc6-compat \
libstdc++ \
openjdk17-jre-headless
EOF
# https://github.com/Erikvl87/docker-languagetool/issues/60
RUN <<EOF
set -x
ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
addgroup -S languagetool && adduser -S languagetool -G languagetool
EOF
COPY --chown=languagetool --from=build /dist .
WORKDIR /LanguageTool
RUN <<EOF
set -x
mkdir /nonexistent
touch /nonexistent/.languagetool.cfg
EOF
COPY --chown=languagetool start.sh config.properties .
USER languagetool
EXPOSE 8010
HEALTHCHECK --timeout=10s --start-period=5s CMD curl --fail --data "language=en-US&text=a simple test" http://localhost:8010/v2/check || exit 1
CMD [ "bash", "start.sh" ]
Happy to put in a PR if it's deemed useful.
When running this Docker image on a remote Ubuntu instance server I see the following error:
Error: org.languagetool.server.AuthException: This is the endpoint for the basic version of LanguageTool. When using 'username' and 'apiKey' to access the premium version, use api.languagetoolplus.com instead
Does this Docker image support premium accounts?
First of all, thank you for providing this Dockerfile. The app in the container is working well, however, it is not receiving signals (in particular, Ctrl-C is ignored), so it is not possible to shutdown the container. As a workaround, it is necessary to run docker stop <name>
, which is not so convenient.
I was wondering if it is possible to change the way in which languagetool is launched so that the server can be shutdown gracefully after pressing Ctrl-C. I tried well-known approaches (e.g. adding --init
to the docker run
command or building the image using Tini), however, docker build .
throws warnings for Illegal reflective access.
Just in case it is relevant, I'm following the most straightforward instructions on Ubuntu 22.04.1:
docker pull erikvl87/languagetool
docker run --rm -p 8010:8010 erikvl87/languagetool
Thanks
I'm not sure if this is addressed elsewhere but I'm getting the following build error:
Processing triggers for libc-bin (2.28-10+deb10u2) ...
Cloning into '/BridJ'...
error: patch failed: BuildNative:29
error: BuildNative: patch does not apply
error: patch failed: pom.xml:87
error: pom.xml: patch does not apply
The command '/bin/sh -c bash -c "./bridj.sh"' returned a non-zero code: 1
Any advice on what is going on here would be great. Thanks!
Full install log:
Sending build context to Docker daemon 223.7kB
Step 1/30 : ARG LANGUAGETOOL_VERSION=5.9
Step 2/30 : FROM debian:buster as build
---> be82c627fbdb
Step 3/30 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> a076375641d1
Step 4/30 : RUN apt-get update -y && apt-get install -y locales bash libgomp1 openjdk-11-jdk-headless git maven unzip xmlstarlet && apt-get clean
---> Using cache
---> 0fec56666baa
Step 5/30 : RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8
---> Using cache
---> 04efffe05191
Step 6/30 : ENV LANG en_US.UTF-8
---> Using cache
---> 3d711906bdce
Step 7/30 : ARG LANGUAGETOOL_VERSION
---> Using cache
---> 2f74eaceb2e3
Step 8/30 : RUN git clone https://github.com/languagetool-org/languagetool.git --depth 1 -b v${LANGUAGETOOL_VERSION}
---> Using cache
---> bb40481f1999
Step 9/30 : WORKDIR /languagetool
---> Using cache
---> c812b319be61
Step 10/30 : RUN ["mvn", "--projects", "languagetool-standalone", "--also-make", "package", "-DskipTests", "--quiet"]
---> Using cache
---> f79993b17272
Step 11/30 : RUN LANGUAGETOOL_DIST_VERSION=$(xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "//x:project/x:properties/x:revision" pom.xml) && unzip /languagetool/languagetool-standalone/target/LanguageTool-${LANGUAGETOOL_DIST_VERSION}.zip -d /dist
---> Using cache
---> 958a0efd54ee
Step 12/30 : RUN LANGUAGETOOL_DIST_FOLDER=$(find /dist/ -name 'LanguageTool-*') && mv $LANGUAGETOOL_DIST_FOLDER /dist/LanguageTool
---> Using cache
---> 5e07b835c7fd
Step 13/30 : WORKDIR /
---> Using cache
---> 17fae86fab91
Step 14/30 : COPY arm64-workaround/. .
---> Using cache
---> 1b3140c03eff
Step 15/30 : RUN chmod +x ./bridj.sh ./hunspell.sh
---> Using cache
---> dbf1c4cea8af
Step 16/30 : RUN bash -c "./bridj.sh"
---> Running in c248f5d4b0c4
Applying arm64 workaround.
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
binutils binutils-aarch64-linux-gnu binutils-common bzip2 cpp cpp-8 dirmngr
dpkg-dev fakeroot file g++ g++-8 gcc gcc-8 gnupg gnupg-l10n gnupg-utils gpg
gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libassuan0
libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl
libfakeroot libfile-fcntllock-perl libgcc-8-dev libisl19 libitm1 libksba8
liblocale-gettext-perl liblsan0 libmagic-mgc libmagic1 libmpc3 libmpfr6
libnpth0 libpython-stdlib libpython2-stdlib libpython2.7-minimal
libpython2.7-stdlib libreadline7 libstdc++-8-dev libtsan0 libubsan1
linux-libc-dev lsb-base make manpages manpages-dev mercurial-common
mime-support pinentry-curses python python-minimal python2 python2-minimal
python2.7 python2.7-minimal readline-common xz-utils
Suggested packages:
binutils-doc bzip2-doc cpp-doc gcc-8-locales dbus-user-session
libpam-systemd pinentry-gnome3 tor debian-keyring gcc-8-doc libstdc++6-8-dbg
gcc-multilib autoconf automake libtool flex bison gdb gcc-doc libgcc1-dbg
libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg
libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg parcimonie
xloadimage scdaemon glibc-doc bzr libstdc++-8-doc make-doc man-browser
kdiff3 | kdiff3-qt | kompare | meld | tkcvs | mgdiff qct python-mysqldb
python-openssl python-pygments wish pinentry-doc python-doc python-tk
python2-doc python2.7-doc binfmt-support readline-doc
The following NEW packages will be installed:
binutils binutils-aarch64-linux-gnu binutils-common build-essential bzip2
cpp cpp-8 dirmngr dpkg-dev fakeroot file g++ g++-8 gcc gcc-8 gnupg
gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf
gpgsm libalgorithm-diff-perl libalgorithm-diff-xs-perl
libalgorithm-merge-perl libasan5 libassuan0 libatomic1 libbinutils
libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libfakeroot
libfile-fcntllock-perl libgcc-8-dev libisl19 libitm1 libksba8
liblocale-gettext-perl liblsan0 libmagic-mgc libmagic1 libmpc3 libmpfr6
libnpth0 libpython-stdlib libpython2-stdlib libpython2.7-minimal
libpython2.7-stdlib libreadline7 libstdc++-8-dev libtsan0 libubsan1
linux-libc-dev lsb-base make manpages manpages-dev mercurial
mercurial-common mime-support pinentry-curses python python-minimal python2
python2-minimal python2.7 python2.7-minimal readline-common wget xz-utils
zip
0 upgraded, 75 newly installed, 0 to remove and 0 not upgraded.
Need to get 60.0 MB of archives.
After this operation, 218 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main arm64 libpython2.7-minimal arm64 2.7.16-2+deb10u1 [395 kB]
Get:2 http://deb.debian.org/debian buster/main arm64 python2.7-minimal arm64 2.7.16-2+deb10u1 [1,292 kB]
Get:3 http://deb.debian.org/debian buster/main arm64 python2-minimal arm64 2.7.16-1 [41.4 kB]
Get:4 http://deb.debian.org/debian buster/main arm64 python-minimal arm64 2.7.16-1 [21.0 kB]
Get:5 http://deb.debian.org/debian buster/main arm64 mime-support all 3.62 [37.2 kB]
Get:6 http://deb.debian.org/debian buster/main arm64 readline-common all 7.0-5 [70.6 kB]
Get:7 http://deb.debian.org/debian buster/main arm64 libreadline7 arm64 7.0-5 [134 kB]
Get:8 http://deb.debian.org/debian buster/main arm64 libpython2.7-stdlib arm64 2.7.16-2+deb10u1 [1,890 kB]
Get:9 http://deb.debian.org/debian buster/main arm64 python2.7 arm64 2.7.16-2+deb10u1 [305 kB]
Get:10 http://deb.debian.org/debian buster/main arm64 libpython2-stdlib arm64 2.7.16-1 [20.8 kB]
Get:11 http://deb.debian.org/debian buster/main arm64 libpython-stdlib arm64 2.7.16-1 [20.8 kB]
Get:12 http://deb.debian.org/debian buster/main arm64 python2 arm64 2.7.16-1 [41.6 kB]
Get:13 http://deb.debian.org/debian buster/main arm64 python arm64 2.7.16-1 [22.8 kB]
Get:14 http://deb.debian.org/debian buster/main arm64 liblocale-gettext-perl arm64 1.07-3+b4 [18.8 kB]
Get:15 http://deb.debian.org/debian-security buster/updates/main arm64 bzip2 arm64 1.0.6-9.2~deb10u2 [47.8 kB]
Get:16 http://deb.debian.org/debian buster/main arm64 libmagic-mgc arm64 1:5.35-4+deb10u2 [242 kB]
Get:17 http://deb.debian.org/debian buster/main arm64 libmagic1 arm64 1:5.35-4+deb10u2 [115 kB]
Get:18 http://deb.debian.org/debian buster/main arm64 file arm64 1:5.35-4+deb10u2 [66.5 kB]
Get:19 http://deb.debian.org/debian buster/main arm64 manpages all 4.16-2 [1,295 kB]
Get:20 http://deb.debian.org/debian buster/main arm64 wget arm64 1.20.1-1.1 [888 kB]
Get:21 http://deb.debian.org/debian buster/main arm64 xz-utils arm64 5.2.4-1+deb10u1 [182 kB]
Get:22 http://deb.debian.org/debian buster/main arm64 binutils-common arm64 2.31.1-16 [2,073 kB]
Get:23 http://deb.debian.org/debian buster/main arm64 libbinutils arm64 2.31.1-16 [455 kB]
Get:24 http://deb.debian.org/debian buster/main arm64 binutils-aarch64-linux-gnu arm64 2.31.1-16 [2,129 kB]
Get:25 http://deb.debian.org/debian buster/main arm64 binutils arm64 2.31.1-16 [56.7 kB]
Get:26 http://deb.debian.org/debian-security buster/updates/main arm64 libc-dev-bin arm64 2.28-10+deb10u2 [271 kB]
Get:27 http://deb.debian.org/debian-security buster/updates/main arm64 linux-libc-dev arm64 4.19.260-1 [1,522 kB]
Get:28 http://deb.debian.org/debian-security buster/updates/main arm64 libc6-dev arm64 2.28-10+deb10u2 [2,325 kB]
Get:29 http://deb.debian.org/debian buster/main arm64 libisl19 arm64 0.20-2 [535 kB]
Get:30 http://deb.debian.org/debian buster/main arm64 libmpfr6 arm64 4.0.2-1 [746 kB]
Get:31 http://deb.debian.org/debian buster/main arm64 libmpc3 arm64 1.1.0-1 [38.0 kB]
Get:32 http://deb.debian.org/debian buster/main arm64 cpp-8 arm64 8.3.0-6 [7,400 kB]
Get:33 http://deb.debian.org/debian buster/main arm64 cpp arm64 4:8.3.0-1 [19.4 kB]
Get:34 http://deb.debian.org/debian buster/main arm64 libcc1-0 arm64 8.3.0-6 [45.0 kB]
Get:35 http://deb.debian.org/debian buster/main arm64 libitm1 arm64 8.3.0-6 [24.0 kB]
Get:36 http://deb.debian.org/debian buster/main arm64 libatomic1 arm64 8.3.0-6 [8,820 B]
Get:37 http://deb.debian.org/debian buster/main arm64 libasan5 arm64 8.3.0-6 [327 kB]
Get:38 http://deb.debian.org/debian buster/main arm64 liblsan0 arm64 8.3.0-6 [118 kB]
Get:39 http://deb.debian.org/debian buster/main arm64 libtsan0 arm64 8.3.0-6 [262 kB]
Get:40 http://deb.debian.org/debian buster/main arm64 libubsan1 arm64 8.3.0-6 [111 kB]
Get:41 http://deb.debian.org/debian buster/main arm64 libgcc-8-dev arm64 8.3.0-6 [835 kB]
Get:42 http://deb.debian.org/debian buster/main arm64 gcc-8 arm64 8.3.0-6 [7,879 kB]
Get:43 http://deb.debian.org/debian buster/main arm64 gcc arm64 4:8.3.0-1 [5,212 B]
Get:44 http://deb.debian.org/debian buster/main arm64 libstdc++-8-dev arm64 8.3.0-6 [1,502 kB]
Get:45 http://deb.debian.org/debian buster/main arm64 g++-8 arm64 8.3.0-6 [8,176 kB]
Get:46 http://deb.debian.org/debian buster/main arm64 g++ arm64 4:8.3.0-1 [1,624 B]
Get:47 http://deb.debian.org/debian buster/main arm64 make arm64 4.2.1-1.2 [333 kB]
Get:48 http://deb.debian.org/debian buster/main arm64 libdpkg-perl all 1.19.8 [1,415 kB]
Get:49 http://deb.debian.org/debian buster/main arm64 dpkg-dev all 1.19.8 [1,776 kB]
Get:50 http://deb.debian.org/debian buster/main arm64 build-essential arm64 12.6 [7,576 B]
Get:51 http://deb.debian.org/debian buster/main arm64 libassuan0 arm64 2.5.2-1 [47.1 kB]
Get:52 http://deb.debian.org/debian buster/main arm64 gpgconf arm64 2.2.12-1+deb10u2 [504 kB]
Get:53 http://deb.debian.org/debian buster/main arm64 lsb-base all 10.2019051400 [28.4 kB]
Get:54 http://deb.debian.org/debian-security buster/updates/main arm64 libksba8 arm64 1.3.5-2+deb10u1 [96.5 kB]
Get:55 http://deb.debian.org/debian buster/main arm64 libnpth0 arm64 1.6-1 [17.6 kB]
Get:56 http://deb.debian.org/debian buster/main arm64 dirmngr arm64 2.2.12-1+deb10u2 [694 kB]
Get:57 http://deb.debian.org/debian buster/main arm64 libfakeroot arm64 1.23-1 [42.1 kB]
Get:58 http://deb.debian.org/debian buster/main arm64 fakeroot arm64 1.23-1 [83.3 kB]
Get:59 http://deb.debian.org/debian buster/main arm64 gnupg-l10n all 2.2.12-1+deb10u2 [1,009 kB]
Get:60 http://deb.debian.org/debian buster/main arm64 gnupg-utils arm64 2.2.12-1+deb10u2 [824 kB]
Get:61 http://deb.debian.org/debian buster/main arm64 gpg arm64 2.2.12-1+deb10u2 [827 kB]
Get:62 http://deb.debian.org/debian buster/main arm64 pinentry-curses arm64 1.1.0-2 [62.7 kB]
Get:63 http://deb.debian.org/debian buster/main arm64 gpg-agent arm64 2.2.12-1+deb10u2 [601 kB]
Get:64 http://deb.debian.org/debian buster/main arm64 gpg-wks-client arm64 2.2.12-1+deb10u2 [478 kB]
Get:65 http://deb.debian.org/debian buster/main arm64 gpg-wks-server arm64 2.2.12-1+deb10u2 [472 kB]
Get:66 http://deb.debian.org/debian buster/main arm64 gpgsm arm64 2.2.12-1+deb10u2 [586 kB]
Get:67 http://deb.debian.org/debian buster/main arm64 gnupg all 2.2.12-1+deb10u2 [715 kB]
Get:68 http://deb.debian.org/debian buster/main arm64 libalgorithm-diff-perl all 1.19.03-2 [47.9 kB]
Get:69 http://deb.debian.org/debian buster/main arm64 libalgorithm-diff-xs-perl arm64 0.04-5+b1 [11.6 kB]
Get:70 http://deb.debian.org/debian buster/main arm64 libalgorithm-merge-perl all 0.08-3 [12.7 kB]
Get:71 http://deb.debian.org/debian buster/main arm64 libfile-fcntllock-perl arm64 0.22-3+b5 [35.5 kB]
Get:72 http://deb.debian.org/debian buster/main arm64 manpages-dev all 4.16-2 [2,232 kB]
Get:73 http://deb.debian.org/debian buster/main arm64 mercurial-common all 4.8.2-1+deb10u1 [2,523 kB]
Get:74 http://deb.debian.org/debian buster/main arm64 mercurial arm64 4.8.2-1+deb10u1 [283 kB]
Get:75 http://deb.debian.org/debian buster/main arm64 zip arm64 3.0-11+b1 [225 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 60.0 MB in 6s (9,525 kB/s)
Selecting previously unselected package libpython2.7-minimal:arm64.
(Reading database ... 13919 files and directories currently installed.)
Preparing to unpack .../00-libpython2.7-minimal_2.7.16-2+deb10u1_arm64.deb ...
Unpacking libpython2.7-minimal:arm64 (2.7.16-2+deb10u1) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../01-python2.7-minimal_2.7.16-2+deb10u1_arm64.deb ...
Unpacking python2.7-minimal (2.7.16-2+deb10u1) ...
Selecting previously unselected package python2-minimal.
Preparing to unpack .../02-python2-minimal_2.7.16-1_arm64.deb ...
Unpacking python2-minimal (2.7.16-1) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../03-python-minimal_2.7.16-1_arm64.deb ...
Unpacking python-minimal (2.7.16-1) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../04-mime-support_3.62_all.deb ...
Unpacking mime-support (3.62) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../05-readline-common_7.0-5_all.deb ...
Unpacking readline-common (7.0-5) ...
Selecting previously unselected package libreadline7:arm64.
Preparing to unpack .../06-libreadline7_7.0-5_arm64.deb ...
Unpacking libreadline7:arm64 (7.0-5) ...
Selecting previously unselected package libpython2.7-stdlib:arm64.
Preparing to unpack .../07-libpython2.7-stdlib_2.7.16-2+deb10u1_arm64.deb ...
Unpacking libpython2.7-stdlib:arm64 (2.7.16-2+deb10u1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../08-python2.7_2.7.16-2+deb10u1_arm64.deb ...
Unpacking python2.7 (2.7.16-2+deb10u1) ...
Selecting previously unselected package libpython2-stdlib:arm64.
Preparing to unpack .../09-libpython2-stdlib_2.7.16-1_arm64.deb ...
Unpacking libpython2-stdlib:arm64 (2.7.16-1) ...
Selecting previously unselected package libpython-stdlib:arm64.
Preparing to unpack .../10-libpython-stdlib_2.7.16-1_arm64.deb ...
Unpacking libpython-stdlib:arm64 (2.7.16-1) ...
Setting up libpython2.7-minimal:arm64 (2.7.16-2+deb10u1) ...
Setting up python2.7-minimal (2.7.16-2+deb10u1) ...
Setting up python2-minimal (2.7.16-1) ...
Selecting previously unselected package python2.
(Reading database ... 14727 files and directories currently installed.)
Preparing to unpack .../python2_2.7.16-1_arm64.deb ...
Unpacking python2 (2.7.16-1) ...
Setting up python-minimal (2.7.16-1) ...
Selecting previously unselected package python.
(Reading database ... 14760 files and directories currently installed.)
Preparing to unpack .../00-python_2.7.16-1_arm64.deb ...
Unpacking python (2.7.16-1) ...
Selecting previously unselected package liblocale-gettext-perl.
Preparing to unpack .../01-liblocale-gettext-perl_1.07-3+b4_arm64.deb ...
Unpacking liblocale-gettext-perl (1.07-3+b4) ...
Selecting previously unselected package bzip2.
Preparing to unpack .../02-bzip2_1.0.6-9.2~deb10u2_arm64.deb ...
Unpacking bzip2 (1.0.6-9.2~deb10u2) ...
Selecting previously unselected package libmagic-mgc.
Preparing to unpack .../03-libmagic-mgc_1%3a5.35-4+deb10u2_arm64.deb ...
Unpacking libmagic-mgc (1:5.35-4+deb10u2) ...
Selecting previously unselected package libmagic1:arm64.
Preparing to unpack .../04-libmagic1_1%3a5.35-4+deb10u2_arm64.deb ...
Unpacking libmagic1:arm64 (1:5.35-4+deb10u2) ...
Selecting previously unselected package file.
Preparing to unpack .../05-file_1%3a5.35-4+deb10u2_arm64.deb ...
Unpacking file (1:5.35-4+deb10u2) ...
Selecting previously unselected package manpages.
Preparing to unpack .../06-manpages_4.16-2_all.deb ...
Unpacking manpages (4.16-2) ...
Selecting previously unselected package wget.
Preparing to unpack .../07-wget_1.20.1-1.1_arm64.deb ...
Unpacking wget (1.20.1-1.1) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../08-xz-utils_5.2.4-1+deb10u1_arm64.deb ...
Unpacking xz-utils (5.2.4-1+deb10u1) ...
Selecting previously unselected package binutils-common:arm64.
Preparing to unpack .../09-binutils-common_2.31.1-16_arm64.deb ...
Unpacking binutils-common:arm64 (2.31.1-16) ...
Selecting previously unselected package libbinutils:arm64.
Preparing to unpack .../10-libbinutils_2.31.1-16_arm64.deb ...
Unpacking libbinutils:arm64 (2.31.1-16) ...
Selecting previously unselected package binutils-aarch64-linux-gnu.
Preparing to unpack .../11-binutils-aarch64-linux-gnu_2.31.1-16_arm64.deb ...
Unpacking binutils-aarch64-linux-gnu (2.31.1-16) ...
Selecting previously unselected package binutils.
Preparing to unpack .../12-binutils_2.31.1-16_arm64.deb ...
Unpacking binutils (2.31.1-16) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../13-libc-dev-bin_2.28-10+deb10u2_arm64.deb ...
Unpacking libc-dev-bin (2.28-10+deb10u2) ...
Selecting previously unselected package linux-libc-dev:arm64.
Preparing to unpack .../14-linux-libc-dev_4.19.260-1_arm64.deb ...
Unpacking linux-libc-dev:arm64 (4.19.260-1) ...
Selecting previously unselected package libc6-dev:arm64.
Preparing to unpack .../15-libc6-dev_2.28-10+deb10u2_arm64.deb ...
Unpacking libc6-dev:arm64 (2.28-10+deb10u2) ...
Selecting previously unselected package libisl19:arm64.
Preparing to unpack .../16-libisl19_0.20-2_arm64.deb ...
Unpacking libisl19:arm64 (0.20-2) ...
Selecting previously unselected package libmpfr6:arm64.
Preparing to unpack .../17-libmpfr6_4.0.2-1_arm64.deb ...
Unpacking libmpfr6:arm64 (4.0.2-1) ...
Selecting previously unselected package libmpc3:arm64.
Preparing to unpack .../18-libmpc3_1.1.0-1_arm64.deb ...
Unpacking libmpc3:arm64 (1.1.0-1) ...
Selecting previously unselected package cpp-8.
Preparing to unpack .../19-cpp-8_8.3.0-6_arm64.deb ...
Unpacking cpp-8 (8.3.0-6) ...
Selecting previously unselected package cpp.
Preparing to unpack .../20-cpp_4%3a8.3.0-1_arm64.deb ...
Unpacking cpp (4:8.3.0-1) ...
Selecting previously unselected package libcc1-0:arm64.
Preparing to unpack .../21-libcc1-0_8.3.0-6_arm64.deb ...
Unpacking libcc1-0:arm64 (8.3.0-6) ...
Selecting previously unselected package libitm1:arm64.
Preparing to unpack .../22-libitm1_8.3.0-6_arm64.deb ...
Unpacking libitm1:arm64 (8.3.0-6) ...
Selecting previously unselected package libatomic1:arm64.
Preparing to unpack .../23-libatomic1_8.3.0-6_arm64.deb ...
Unpacking libatomic1:arm64 (8.3.0-6) ...
Selecting previously unselected package libasan5:arm64.
Preparing to unpack .../24-libasan5_8.3.0-6_arm64.deb ...
Unpacking libasan5:arm64 (8.3.0-6) ...
Selecting previously unselected package liblsan0:arm64.
Preparing to unpack .../25-liblsan0_8.3.0-6_arm64.deb ...
Unpacking liblsan0:arm64 (8.3.0-6) ...
Selecting previously unselected package libtsan0:arm64.
Preparing to unpack .../26-libtsan0_8.3.0-6_arm64.deb ...
Unpacking libtsan0:arm64 (8.3.0-6) ...
Selecting previously unselected package libubsan1:arm64.
Preparing to unpack .../27-libubsan1_8.3.0-6_arm64.deb ...
Unpacking libubsan1:arm64 (8.3.0-6) ...
Selecting previously unselected package libgcc-8-dev:arm64.
Preparing to unpack .../28-libgcc-8-dev_8.3.0-6_arm64.deb ...
Unpacking libgcc-8-dev:arm64 (8.3.0-6) ...
Selecting previously unselected package gcc-8.
Preparing to unpack .../29-gcc-8_8.3.0-6_arm64.deb ...
Unpacking gcc-8 (8.3.0-6) ...
Selecting previously unselected package gcc.
Preparing to unpack .../30-gcc_4%3a8.3.0-1_arm64.deb ...
Unpacking gcc (4:8.3.0-1) ...
Selecting previously unselected package libstdc++-8-dev:arm64.
Preparing to unpack .../31-libstdc++-8-dev_8.3.0-6_arm64.deb ...
Unpacking libstdc++-8-dev:arm64 (8.3.0-6) ...
Selecting previously unselected package g++-8.
Preparing to unpack .../32-g++-8_8.3.0-6_arm64.deb ...
Unpacking g++-8 (8.3.0-6) ...
Selecting previously unselected package g++.
Preparing to unpack .../33-g++_4%3a8.3.0-1_arm64.deb ...
Unpacking g++ (4:8.3.0-1) ...
Selecting previously unselected package make.
Preparing to unpack .../34-make_4.2.1-1.2_arm64.deb ...
Unpacking make (4.2.1-1.2) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../35-libdpkg-perl_1.19.8_all.deb ...
Unpacking libdpkg-perl (1.19.8) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../36-dpkg-dev_1.19.8_all.deb ...
Unpacking dpkg-dev (1.19.8) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../37-build-essential_12.6_arm64.deb ...
Unpacking build-essential (12.6) ...
Selecting previously unselected package libassuan0:arm64.
Preparing to unpack .../38-libassuan0_2.5.2-1_arm64.deb ...
Unpacking libassuan0:arm64 (2.5.2-1) ...
Selecting previously unselected package gpgconf.
Preparing to unpack .../39-gpgconf_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpgconf (2.2.12-1+deb10u2) ...
Selecting previously unselected package lsb-base.
Preparing to unpack .../40-lsb-base_10.2019051400_all.deb ...
Unpacking lsb-base (10.2019051400) ...
Selecting previously unselected package libksba8:arm64.
Preparing to unpack .../41-libksba8_1.3.5-2+deb10u1_arm64.deb ...
Unpacking libksba8:arm64 (1.3.5-2+deb10u1) ...
Selecting previously unselected package libnpth0:arm64.
Preparing to unpack .../42-libnpth0_1.6-1_arm64.deb ...
Unpacking libnpth0:arm64 (1.6-1) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../43-dirmngr_2.2.12-1+deb10u2_arm64.deb ...
Unpacking dirmngr (2.2.12-1+deb10u2) ...
Selecting previously unselected package libfakeroot:arm64.
Preparing to unpack .../44-libfakeroot_1.23-1_arm64.deb ...
Unpacking libfakeroot:arm64 (1.23-1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../45-fakeroot_1.23-1_arm64.deb ...
Unpacking fakeroot (1.23-1) ...
Selecting previously unselected package gnupg-l10n.
Preparing to unpack .../46-gnupg-l10n_2.2.12-1+deb10u2_all.deb ...
Unpacking gnupg-l10n (2.2.12-1+deb10u2) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../47-gnupg-utils_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gnupg-utils (2.2.12-1+deb10u2) ...
Selecting previously unselected package gpg.
Preparing to unpack .../48-gpg_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpg (2.2.12-1+deb10u2) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../49-pinentry-curses_1.1.0-2_arm64.deb ...
Unpacking pinentry-curses (1.1.0-2) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../50-gpg-agent_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpg-agent (2.2.12-1+deb10u2) ...
Selecting previously unselected package gpg-wks-client.
Preparing to unpack .../51-gpg-wks-client_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpg-wks-client (2.2.12-1+deb10u2) ...
Selecting previously unselected package gpg-wks-server.
Preparing to unpack .../52-gpg-wks-server_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpg-wks-server (2.2.12-1+deb10u2) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../53-gpgsm_2.2.12-1+deb10u2_arm64.deb ...
Unpacking gpgsm (2.2.12-1+deb10u2) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../54-gnupg_2.2.12-1+deb10u2_all.deb ...
Unpacking gnupg (2.2.12-1+deb10u2) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../55-libalgorithm-diff-perl_1.19.03-2_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-2) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../56-libalgorithm-diff-xs-perl_0.04-5+b1_arm64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-5+b1) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../57-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../58-libfile-fcntllock-perl_0.22-3+b5_arm64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3+b5) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../59-manpages-dev_4.16-2_all.deb ...
Unpacking manpages-dev (4.16-2) ...
Selecting previously unselected package mercurial-common.
Preparing to unpack .../60-mercurial-common_4.8.2-1+deb10u1_all.deb ...
Unpacking mercurial-common (4.8.2-1+deb10u1) ...
Selecting previously unselected package mercurial.
Preparing to unpack .../61-mercurial_4.8.2-1+deb10u1_arm64.deb ...
Unpacking mercurial (4.8.2-1+deb10u1) ...
Selecting previously unselected package zip.
Preparing to unpack .../62-zip_3.0-11+b1_arm64.deb ...
Unpacking zip (3.0-11+b1) ...
Setting up libksba8:arm64 (1.3.5-2+deb10u1) ...
Setting up lsb-base (10.2019051400) ...
Setting up mime-support (3.62) ...
Setting up wget (1.20.1-1.1) ...
Setting up libmagic-mgc (1:5.35-4+deb10u2) ...
Setting up libfile-fcntllock-perl (0.22-3+b5) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Setting up manpages (4.16-2) ...
Setting up binutils-common:arm64 (2.31.1-16) ...
Setting up libmagic1:arm64 (1:5.35-4+deb10u2) ...
Setting up linux-libc-dev:arm64 (4.19.260-1) ...
Setting up libnpth0:arm64 (1.6-1) ...
Setting up file (1:5.35-4+deb10u2) ...
Setting up libassuan0:arm64 (2.5.2-1) ...
Setting up bzip2 (1.0.6-9.2~deb10u2) ...
Setting up libfakeroot:arm64 (1.23-1) ...
Setting up fakeroot (1.23-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libasan5:arm64 (8.3.0-6) ...
Setting up zip (3.0-11+b1) ...
Setting up make (4.2.1-1.2) ...
Setting up libmpfr6:arm64 (4.0.2-1) ...
Setting up gnupg-l10n (2.2.12-1+deb10u2) ...
Setting up xz-utils (5.2.4-1+deb10u1) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
Setting up libmpc3:arm64 (1.1.0-1) ...
Setting up libatomic1:arm64 (8.3.0-6) ...
Setting up libdpkg-perl (1.19.8) ...
Setting up libubsan1:arm64 (8.3.0-6) ...
Setting up libisl19:arm64 (0.20-2) ...
Setting up libbinutils:arm64 (2.31.1-16) ...
Setting up cpp-8 (8.3.0-6) ...
Setting up libc-dev-bin (2.28-10+deb10u2) ...
Setting up libalgorithm-diff-xs-perl (0.04-5+b1) ...
Setting up readline-common (7.0-5) ...
Setting up libcc1-0:arm64 (8.3.0-6) ...
Setting up liblocale-gettext-perl (1.07-3+b4) ...
Setting up liblsan0:arm64 (8.3.0-6) ...
Setting up libitm1:arm64 (8.3.0-6) ...
Setting up libreadline7:arm64 (7.0-5) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up gnupg-utils (2.2.12-1+deb10u2) ...
Setting up libtsan0:arm64 (8.3.0-6) ...
Setting up pinentry-curses (1.1.0-2) ...
Setting up manpages-dev (4.16-2) ...
Setting up binutils-aarch64-linux-gnu (2.31.1-16) ...
Setting up binutils (2.31.1-16) ...
Setting up dpkg-dev (1.19.8) ...
Setting up libpython2.7-stdlib:arm64 (2.7.16-2+deb10u1) ...
Setting up libgcc-8-dev:arm64 (8.3.0-6) ...
Setting up cpp (4:8.3.0-1) ...
Setting up gpgconf (2.2.12-1+deb10u2) ...
Setting up libc6-dev:arm64 (2.28-10+deb10u2) ...
Setting up gpg (2.2.12-1+deb10u2) ...
Setting up libstdc++-8-dev:arm64 (8.3.0-6) ...
Setting up gcc-8 (8.3.0-6) ...
Setting up gpg-agent (2.2.12-1+deb10u2) ...
Setting up python2.7 (2.7.16-2+deb10u1) ...
Setting up libpython2-stdlib:arm64 (2.7.16-1) ...
Setting up gpgsm (2.2.12-1+deb10u2) ...
Setting up python2 (2.7.16-1) ...
Setting up gcc (4:8.3.0-1) ...
Setting up dirmngr (2.2.12-1+deb10u2) ...
Setting up libpython-stdlib:arm64 (2.7.16-1) ...
Setting up gpg-wks-server (2.2.12-1+deb10u2) ...
Setting up g++-8 (8.3.0-6) ...
Setting up python (2.7.16-1) ...
Setting up gpg-wks-client (2.2.12-1+deb10u2) ...
Setting up mercurial-common (4.8.2-1+deb10u1) ...
Setting up g++ (4:8.3.0-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up gnupg (2.2.12-1+deb10u2) ...
Setting up build-essential (12.6) ...
Setting up mercurial (4.8.2-1+deb10u1) ...
Creating config file /etc/mercurial/hgrc.d/hgext.rc with new version
Processing triggers for libc-bin (2.28-10+deb10u2) ...
Cloning into '/BridJ'...
error: patch failed: BuildNative:29
error: BuildNative: patch does not apply
error: patch failed: pom.xml:87
error: pom.xml: patch does not apply
The command '/bin/sh -c bash -c "./bridj.sh"' returned a non-zero code: 1
Hello,
currently the log level is set to INFO
. How can I set it to another level?
Thanks!
I already created an issue in the main LanguageTool repo, so apologies for duplicating, but I figured I'd open an issue here as well, in case anyone else is having hte same problem (or has before).
When trying to use my self-hosted LT server with the Firefox LT add-on, I get the following error from the LT pop-up: Cannot connect to https://grammar.my.domain/v2/check - please check your internet connection or try again in a minute (#1, code=0)
. However, when I try using the LT extension in Chromium with the same self-hosted LT server I don't have any problems. I am trying this using a fresh install of Firefox with no additional extensions installed and only the standard browser security setting.
I am running the LT server using this docker image reverse proxied using NGINX. I've tried building the image locally using the flag --allow-origin "*"
instead of --allow-origin '*'
since one of the LT devs mentioned that was an issue for them, but it hasn't made any difference. I start my container using a docker-compose yml with the following settings:
services:
languagetool:
image: erikvl87/languagetool
container_name: languagetool
ports:
- 8010:8010
environment:
- langtool_languageModel=/ngrams
- Java_Xms=512m
- Java_Xmx=2818m
- langtool_pipelinePrewarming=true
- langtool_pipelineCaching=true
volumes:
- /home/xthursdayx/languagetool/ngrams:/ngrams
I can't figure out why this is working in Chromium but not Firefox after having spent most of the afternoon loading and reloading websites, reading the browser console log, and adding and removing NGINX headers. It seems like this issue might be related to one (or both) of these two questions on StackOverflow: https://stackoverflow.com/questions/40185123/error-content-security-policy-the-page-s-settings-blocked-the-loading-of-a-res and https://stackoverflow.com/questions/56386307/loading-of-a-resource-blocked-by-content-security-policy but I'm not sure.
Any ideas how to troubleshoot this? Thanks!
I have set up and running LanguageTool in Docker, it works great.
One thing I am not sure about, I found out that some rules are disabled by default, example. It is somehow possible to enable these rules, or they require premium subscription?
I have the following issue when trying to make /v2/check
API call with language set to auto
:
2023-02-27 08:40:38.181 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary, detected: pt-PT', sending HTTP code 500. Access from 172.17.0.1, HTTP user agent: python-requests/2.28.2, User agent param: null, Referrer: null, language: auto, h: 1, r: 14018, time: 154text length: 3, m: ALL, l: DEFAULT, Stacktrace follows:java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary, detected: pt-PT
at org.languagetool.server.TextChecker.checkText(TextChecker.java:507)
at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:172)
at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:83)
at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:185)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:848)
at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:817)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.languagetool.server.TextChecker.checkText(TextChecker.java:489)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary
at dumonts.hunspell.Hunspell.<init>(Hunspell.java:21)
at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:33)
at org.languagetool.rules.spelling.hunspell.Hunspell.getDictionary(Hunspell.java:46)
at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:584)
at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:558)
at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:220)
at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1370)
at org.languagetool.JLanguageTool.access$1500(JLanguageTool.java:74)
at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1950)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1862)
at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1833)
at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1294)
at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:991)
at org.languagetool.JLanguageTool.check2(JLanguageTool.java:918)
at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:802)
at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:751)
at org.languagetool.server.TextChecker.lambda$checkText$5(TextChecker.java:472)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 3 more
2023-02-27 08:40:38.182 +0000 INFO org.languagetool.server.LanguageToolHttpHandler Handled request in 155ms; sending code 500
Any suggestion on how that could be fixed?
I need to run it on 0.0.0.0 to allow external connections to the docker, i tried this
docker run --rm -p 8010:8010 --env langtool_setServerURL="0.0.0.0" erikvl87/languagetool
but it still started the server on localhost, which is 127.0.0.1 and that is only for internal machine ip.
Could you help
The following configuration is passed to LanguageTool:
2021-01-16 05:48:36 +0000 WARNING: running in public mode, LanguageTool API can be accessed without restrictions!
2021-01-16 05:48:37 +0000 Setting up thread pool with 10 threads
2021-01-16 05:48:37 +0000 Starting LanguageTool 5.2 (build date: 2020-12-30 14:55, eb572bf) server on http://localhost:8010...
2021-01-16 05:48:37 +0000 Server started
2021-01-15 21:48:44 -0800 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'This is the LanguageTool API. You have not specified any parameters. Please see https://languagetool.org/http-api/swagger-ui/#/default', sending HTTP code 400. Access from 192.168.1.10, HTTP user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75, User agent param: null, Referrer: null, language: en-us, h: 1, r: 1, time: 2m: ALL, l: DEFAULT, Stacktrace follows:java.lang.IllegalArgumentException: This is the LanguageTool API. You have not specified any parameters. Please see https://languagetool.org/http-api/swagger-ui/#/default
at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:190)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
After a 30 minute run where all tests seem to succeed, the test host process seems to crash with the following output:
2020-12-30 08:59:45 +0000 Stopping server...
2020-12-30 08:59:50 +0000 Server stopped
Error: Failed to execute goal on project languagetool-office-extension: Could not resolve dependencies for project org.languagetool:languagetool-office-extension:jar:5.2: Failed to collect dependencies at org.openoffice:ridl:jar:4.1.2: Failed to read artifact descriptor for org.openoffice:ridl:jar:4.1.2: Could not transfer artifact org.openoffice:ridl:pom:4.1.2 from/to central (https://repo.maven.apache.org/maven2): Connection timed out (Read failed) -> [Help 1]
Error:
Error: To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: Re-run Maven using the -X switch to enable full debug logging.
Error:
Error: For more information about the errors and possible solutions, please read the following articles:
Error: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Error:
Error: After correcting the problems, you can resume the build with the command
Error: mvn <goals> -rf :languagetool-office-extension
Error: Process completed with exit code 1.
In previous successful runs, the output would be:
2020-10-15 18:37:55 +0000 Stopping server...
2020-10-15 18:38:00 +0000 Server stopped
Oct 15, 2020 6:53:39 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo.maven.apache.org:443: Connection timed out (Read failed)
Oct 15, 2020 6:53:39 PM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo.maven.apache.org:443
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Unexpected line format: expected three tab-separated columns: 'just a text', skipping
Running query: +fieldLowercase:move +fieldLowercase:/forth|back/
Check done in 121/8/109ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:back +fieldLowercase:and +fieldLowercase:fourth
Check done in 2/1/72ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:eye +fieldLowercase:/_lemma_(brow|lash|sight|sore|lid)/
Check done in 2/0/5ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:all +fieldLowercase:over +fieldLowercase:the +fieldLowercase:word
Check done in 2/0/0ms (LT creation/Lucene/matching) for 0 docs
Running query: +fieldLowercase:how
Check done in 116/4/61ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:move +fieldLowercase:back
Check done in 126/1/72ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:bleed +fieldLowercase:' +fieldLowercase:s
Check done in 119/8/56ms (LT creation/Lucene/matching) for 1 docs
Running query: +fieldLowercase:bleed +fieldLowercase:' +fieldLowercase:x
Check done in 113/1/0ms (LT creation/Lucene/matching) for 0 docs
Running query: +fieldLowercase:move +fieldLowercase:/forth|back/
Check done in 124/1/58ms (LT creation/Lucene/matching) for 1 docs
Oct 15, 2020 6:54:34 PM com.carrotsearch.randomizedtesting.ThreadLeakControl checkThreadLeaks
WARNING: Will linger awaiting termination of 9 leaked thread(s).
Comparing result 1 (1 matches) to result 2 (1 matches), step 1
Comparing result 1 (1 matches) to result 2 (1 matches), step 2
Comparing result 1 (1 matches) to result 2 (1 matches), step 1
Comparing result 1 (1 matches) to result 2 (1 matches), step 2
Comparing result 1 (1 matches) to result 2 (0 matches), step 1
Comparing result 1 (1 matches) to result 2 (0 matches), step 2
Comparing result 1 (1 matches) to result 2 (1 matches), step 1
Comparing result 1 (1 matches) to result 2 (1 matches), step 2
Comparing result 1 (0 matches) to result 2 (1 matches), step 1
Comparing result 1 (0 matches) to result 2 (1 matches), step 2
Comparing result 1 (1 matches) to result 2 (1 matches), step 1
Comparing result 1 (1 matches) to result 2 (1 matches), step 2
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionMinLengthEval$DetectionException.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionMinLengthEval.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionTrainer.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/CLD2Identifier.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/RealWordCorpusEvaluatorTest.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/AfterTheDeadlineEvaluatorTest.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionEval.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionEval$DetectionException.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/LanguageDetectionEval2.class, does not match *.txt
Ignoring /languagetool/languagetool-dev/target/test-classes/org/languagetool/dev/eval/lang, does not match *.txt
Position mismatch: 0-7 != 5-7
When trying to set up on an ARM device like Raspberry Pi, I get the notification:
ERROR: no matching manifest for linux/arm/v7 in the manifest list entries
Could you make it available for those widely used devices as well, please?
Appreciate your work nevertheless!
Hey,
could you please add the arm64 build to the docker hub?
The GitHub Action Docker Hub Description fails to update the description.
Response from the action:
Acquiring token
Sending PATCH request
Received response code: 401
##[error]Docker run failed with exit code 1
Related issue: peter-evans/dockerhub-description#7
The tests suddenly fail when testing the LanguageTool embedded HTTP server
. This seems to be related to the ubuntu-latest image which is one of the hosted test runners provided by GitHub.
The tests succeed when running on ubuntu-18.04
but fail when running ubuntu-latest
or ubuntu-20.04
.
Investigate what is different between those versions that make the tests fail.
The appropriate release notes:
The title already says it. Wouldn't it be possible to set it in the Dockerfile
to a default value (/ngrams
). This would reduce the options for the user a bit as the internal path doesn't matter to most users.
Setting LanguageTool configuration using the langtool_
prefix in environment variables writes the settings into a configuration file which is given to LanguageTool.
While writing these settings to the file, an error occurs:
start.sh: line 6: config.properties: Permission denied
The following configuration is passed to LanguageTool:
This is probably caused/introduced by this commit: f02abaf
On 4.8
this can be reproduced with:
docker run --rm -it -p 8010:8010 --env langtool_pipelinePrewarming=true languagetool
Is it possible to specify custom port ?
Heya,
Unsure if this is possible, or just on the cloud version?
Cheers!
On languagetool.org a maximum of 5 suggestions is returned via the api, but we sometimes get 80 or more from this container and our frontend is unable decide which ones are the best. Is there a way to limit the amount on server side?
With langtool_maxSpellingSuggestions no suggestions are returned at all when the limit is breached.
Thank you for your time.
Running the latest docker on Debian. Language set to English. 95% of the time the spell checker works as expected, but occasionally it indicates correctly spelled words for correction, and offers Italian choices.
Generally this reverts to English after a page refresh. Frequency is multiple times a week.
Here's my docker compose:
version: "3"
services:
languagetool:
image: erikvl87/languagetool:latest
container_name: languagetool
environment:
- langtool_languageModel=/ngrams
- Java_Xms=512m
- Java_Xmx=1g
networks:
- languagetool_default
ports:
- 8010:8010
restart: unless-stopped
user: languagetool
volumes:
- /home/user1/docker/languagetool/ngrams:/ngrams
networks:
languagetool_default:
name: languagetool
Any suggestions?
Originally posted by @anetschka in #15 (comment)
Hi there, I have tried building the image with the supplied dockerfile and and arm64-workaround, using docker-compose. The only difference is that I added ngram data to a folder within my image. The image builds and the container starts up normally, but when I actually post (German) text to LanguageTool, it seems that Hunspell is still not properly initialised:
languagetoolservice_1 | java.io.IOException: Read-only file system languagetoolservice_1 | at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method) languagetoolservice_1 | at java.base/java.io.File.createTempFile(File.java:2129) languagetoolservice_1 | at java.base/java.io.File.createTempFile(File.java:2175) languagetoolservice_1 | at org.bridj.Platform.createTempDir(Platform.java:710) languagetoolservice_1 | at org.bridj.Platform.<clinit>(Platform.java:227) languagetoolservice_1 | at org.bridj.Pointer.<clinit>(Pointer.java:208) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:37) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.Hunspell.getDictionary(Hunspell.java:50) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:488) languagetoolservice_1 | at org.languagetool.rules.de.GermanSpellerRule.init(GermanSpellerRule.java:1244) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:462) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:155) languagetoolservice_1 | at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1295) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1846) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1765) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1736) languagetoolservice_1 | at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1226) languagetoolservice_1 | at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:970) languagetoolservice_1 | at org.languagetool.JLanguageTool.check2(JLanguageTool.java:908) languagetoolservice_1 | at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:762) languagetoolservice_1 | at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:711) languagetoolservice_1 | at org.languagetool.server.TextChecker.access$000(TextChecker.java:56) languagetoolservice_1 | at org.languagetool.server.TextChecker$1.call(TextChecker.java:427) languagetoolservice_1 | at org.languagetool.server.TextChecker$1.call(TextChecker.java:420) languagetoolservice_1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) languagetoolservice_1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) languagetoolservice_1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) languagetoolservice_1 | at java.base/java.lang.Thread.run(Thread.java:829) languagetoolservice_1 | 2021-11-19 17:11:26.422 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>Die Deutsche Bank kündigte den Abbau von 18.000 Stellen an.</sentcontent>, detected: de-DE', sending HTTP code 500. Access from 192.168.208.3, HTTP user agent: Python-urllib/3.8, User agent param: null, Referrer: null, language: de-DE, h: 1, r: 1, time: 5494text length: 59, m: ALL, l: DEFAULT, Stacktrace follows:java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>Die Deutsche Bank kündigte den Abbau von 18.000 Stellen an.</sentcontent>, detected: de-DE languagetoolservice_1 | at org.languagetool.server.TextChecker.checkText(TextChecker.java:457) languagetoolservice_1 | at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:162) languagetoolservice_1 | at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:76) languagetoolservice_1 | at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:182) languagetoolservice_1 | at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) languagetoolservice_1 | at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82) languagetoolservice_1 | at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80) languagetoolservice_1 | at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692) languagetoolservice_1 | at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) languagetoolservice_1 | at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664) languagetoolservice_1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) languagetoolservice_1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) languagetoolservice_1 | at java.base/java.lang.Thread.run(Thread.java:829) languagetoolservice_1 | Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>Die Deutsche Bank kündigte den Abbau von 18.000 Stellen an.</sentcontent> languagetoolservice_1 | at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) languagetoolservice_1 | at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) languagetoolservice_1 | at org.languagetool.server.TextChecker.checkText(TextChecker.java:438) languagetoolservice_1 | ... 12 more languagetoolservice_1 | Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>Die Deutsche Bank kündigte den Abbau von 18.000 Stellen an.</sentcontent> languagetoolservice_1 | at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1230) languagetoolservice_1 | at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:970) languagetoolservice_1 | at org.languagetool.JLanguageTool.check2(JLanguageTool.java:908) languagetoolservice_1 | at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:762) languagetoolservice_1 | at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:711) languagetoolservice_1 | at org.languagetool.server.TextChecker.access$000(TextChecker.java:56) languagetoolservice_1 | at org.languagetool.server.TextChecker$1.call(TextChecker.java:427) languagetoolservice_1 | at org.languagetool.server.TextChecker$1.call(TextChecker.java:420) languagetoolservice_1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) languagetoolservice_1 | ... 3 more languagetoolservice_1 | Caused by: java.lang.RuntimeException: Could not check sentence (language: German (Germany)): <sentcontent>Die Deutsche Bank kündigte den Abbau von 18.000 Stellen an.</sentcontent> languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1883) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1765) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1736) languagetoolservice_1 | at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1226) languagetoolservice_1 | ... 11 more languagetoolservice_1 | Caused by: java.lang.RuntimeException: Could not create hunspell instance. Please note that LanguageTool supports only 64-bit platforms (Linux, Windows, Mac) and that it requires a 64-bit JVM (Java). languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:45) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.Hunspell.getDictionary(Hunspell.java:50) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:488) languagetoolservice_1 | at org.languagetool.rules.de.GermanSpellerRule.init(GermanSpellerRule.java:1244) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:462) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:155) languagetoolservice_1 | at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1295) languagetoolservice_1 | at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1846) languagetoolservice_1 | ... 14 more languagetoolservice_1 | Caused by: java.lang.UnsatisfiedLinkError: 'int org.bridj.Platform.sizeOf_ptrdiff_t()' languagetoolservice_1 | at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method) languagetoolservice_1 | at org.bridj.Platform.<clinit>(Platform.java:232) languagetoolservice_1 | at org.bridj.Pointer.<clinit>(Pointer.java:208) languagetoolservice_1 | at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:37) languagetoolservice_1 | ... 21 more languagetoolservice_1 |
Hey there,
First of all - thanks for the great work :)
I am trying to make the language tool work with the ngram data set.
I created the ngram directories as described and the container starts normally.
But when i try to use the web extension/browser client the connection can't be established since the container on my Host machine crashes.
Command used:
docker run --network=proxy --rm -it -d --restart always -p 8010:8010 -e langtool_languageModel=/ngrams -v home/user/ngrams:/ngrams erikvl87/languagetool
Without the ngrams -leaving everything else as is- everything works perfectly fine.
I already tried to play around with different Java Heap Sizes - but that didn't help so far.
( Java_Xms=512m AND Java_Xmx=2g; Java-Xms=256m -Java_Xmx=2816m; etc...)
Maybe i just didn't find the appropiate values.
Recommendations for appropriate Java Heap Sizes when using ngrams would be helpful here. Or a completey different workaround if other people experience instabilities when using ngram as well.
Best regards,
Max
I'm running the provided docker-compose.yml file on my local system, with downloaded n-grams dataset.
---
version: "3"
services:
languagetool:
image: erikvl87/languagetool
container_name: languagetool
ports:
- 8710:8010 # Using default port from the image
environment:
- langtool_languageModel=/ngrams # OPTIONAL: Using ngrams data
- Java_Xms=2g # OPTIONAL: Setting a minimal Java heap size of 512 mib
- Java_Xmx=4g # OPTIONAL: Setting a maximum Java heap size of 1 Gib
volumes:
- ./ngrams:/ngrams # OPTIONAL: The location of ngrams data on the local machine
When trying out an API call to the check
endpoint, i'm seeing the below given error.
API call:
curl --location --request POST 'http://localhost:8710/v2/check' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'text=<my text data>' \
--data-urlencode 'language=en-GB'
Error->
Error: Internal Error: java.lang.RuntimeException: org.apache.lucene.index.CorruptIndexException: codec footer mismatch (file truncated?): actual footer=0 vs expected footer=-1071082520 (resource=MMapIndexInput(path="/ngrams/en/3grams/_1e4_Lucene50_0.tim")), detected: en-US
Could use some guidance regarding diagnosing and resolving this issue.
Thanks.
Update:
When i comment out - langtool_languageModel=/ngrams
, the API call goes through successfully.
Is there any way to automatically apply suggestions in the docker in the same as when the server is run natively (using --apply https://dev.languagetool.org/tips-and-tricks.html), based on how the config is set up, it doesn't seem like this could be set by an environmental variable.
Hi
Are we mounting the zip file, or unzip folder or "en" (for english) inside the zip folder, or the sub [1,2,3]grams folder inside that?
thanks
Hey,
how can I run this with https enabled, either via nginx or a custom domain? I found no information regarding this in the readme.
Do I need to change the Dockerfile to use the nginx alpine image? And what would I do next?
Is this feature supported by the docker image? If so, how do I activate it. All browsers using the same http link.
Related... the specific sites permitted for LT access differ between browsers.
Thanks for your help!
erikvl87/languagetool:5.2 works fine:
The following configuration is passed to LanguageTool:
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
+ java -Xms512m -Xmx2g -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config config.properties
2021-10-15 21:53:06 +0000 INFO org.languagetool.server.DatabaseAccess Not setting up database access, dbDriver is not configured
2021-10-15 21:53:06 +0000 WARNING: running in HTTP mode, consider running LanguageTool behind a reverse proxy that takes care of encryption (HTTPS)
2021-10-15 21:53:06 +0000 WARNING: running in public mode, LanguageTool API can be accessed without restrictions!
2021-10-15 21:53:07 +0000 INFO org.languagetool.language.LanguageIdentifier Started fasttext process for language identification: Binary /fasttext/fasttext with model @ /fasttext/lid.176.bin
2021-10-15 21:53:07 +0000 Setting up thread pool with 10 threads
2021-10-15 21:53:07 +0000 Starting LanguageTool 5.2 (build date: 2020-12-30 14:55, eb572bf) server on http://localhost:8010...
2021-10-15 21:53:07 +0000 Server started
But newer versions already crash :(
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
fasttextBinary=/fasttext/fasttext
fasttextModel=/fasttext/lid.176.bin
languageModel=/ngrams
+ java -Xms512m -Xmx2g -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config config.properties
2021-10-15 22:01:37.371 +0000 INFO org.languagetool.server.DatabaseAccess Not setting up database access, dbDriver is not configured
2021-10-15 22:01:37 +0000 WARNING: running in HTTP mode, consider running LanguageTool behind a reverse proxy that takes care of encryption (HTTPS)
2021-10-15 22:01:37 +0000 WARNING: running in public mode, LanguageTool API can be accessed without restrictions!
Exception in thread "main" java.lang.RuntimeException: Could not start LanguageTool HTTP server on localhost, port 8010
at org.languagetool.server.HTTPServer.main(HTTPServer.java:153)
Caused by: org.languagetool.server.PortBindingException: LanguageTool HTTP server could not be started on host "null", port 8010.
Maybe something else is running on that port already?
at org.languagetool.server.HTTPServer.<init>(HTTPServer.java:119)
at org.languagetool.server.HTTPServer.main(HTTPServer.java:147)
Caused by: java.lang.RuntimeException: Could not start fasttext process for language identification @ /fasttext/fasttext with model @ /fasttext/lid.176.bin
at org.languagetool.language.LanguageIdentifier.enableFasttext(LanguageIdentifier.java:118)
at org.languagetool.server.TextChecker.<init>(TextChecker.java:109)
at org.languagetool.server.V2TextChecker.<init>(V2TextChecker.java:45)
at org.languagetool.server.LanguageToolHttpHandler.<init>(LanguageToolHttpHandler.java:74)
at org.languagetool.server.HTTPServer.<init>(HTTPServer.java:105)
... 1 more
Caused by: java.io.IOException: Cannot run program "/fasttext/fasttext": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at org.languagetool.language.FastText.<init>(FastText.java:43)
at org.languagetool.language.LanguageIdentifier.enableFasttext(LanguageIdentifier.java:115)
... 5 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
at java.base/java.lang.ProcessBuilder.start(Process
I built fasttext from here and downloaded, probably, lid.176.bin from here.
My docker runner:
docker run -d --name="Languagetool" \
-p 8081:8010/tcp \
-e Java_Xms=512m \
-e Java_Xmx=2g \
-e langtool_languageModel=/ngrams \
-e langtool_fasttextModel=/fasttext/lid.176.bin \
-e langtool_fasttextBinary=/fasttext/fasttext \
-v "/mnt/hdd1/languagetool/ngrams":"/ngrams" \
-v "/mnt/hdd1/languagetool/fasttext":"/fasttext" \
--restart=unless-stopped \
erikvl87/languagetool:5.2
docker version:
Client:
Version: 20.10.7
API version: 1.41
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu1~20.04.2
Built: Fri Oct 1 14:07:06 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu1~20.04.2
Built: Fri Oct 1 03:27:17 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.2-0ubuntu1~20.04.3
GitCommit:
runc:
Version: 1.0.0~rc95-0ubuntu1~20.04.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
So, what am I doing wrong?
Even though I set the "language" body parameter to en-US, when I pass the same request body into the public LangTool api it correctly detects the language as English. However, passing the same request body to this docker instance, it returns the detected language as Tagalog and therefore misses lots of errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.