Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

java.lang.RuntimeException: Expected at least '1grams', '2grams', and '3grams' sub directories but only got [3grams] in /app/data/ngrams/en

Scheduled Pinned Locked Moved Solved LanguageTool
6 Posts 2 Posters 58 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • luckowL Offline
    luckowL Offline
    luckow translator
    wrote on last edited by
    #1

    The moment you try to perform a language check after activating the en n-gram data set:

    Jan 27 11:49:49 2023-01-27 10:49:49 +0000 Starting LanguageTool 6.0 (build date: 2022-12-29 12:13:11 +0000, e44dbb0) server on http://localhost:8010...
    Jan 27 11:49:49 2023-01-27 10:49:49 +0000 Server started
    Jan 27 11:49:50 172.18.0.1 - - [27/Jan/2023:10:49:50 +0000] "GET / HTTP/1.1" 200 810 "-" "Mozilla (CloudronHealth)"
    Jan 27 11:50:00 172.18.0.1 - - [27/Jan/2023:10:50:00 +0000] "GET / HTTP/1.1" 200 810 "-" "Mozilla (CloudronHealth)"
    Jan 27 11:50:10 172.18.0.1 - - [27/Jan/2023:10:50:10 +0000] "GET / HTTP/1.1" 200 810 "-" "Mozilla (CloudronHealth)"
    Jan 27 11:50:12 2023-01-27 10:50:12.527 +0000 INFO org.languagetool.server.LanguageToolHttpHandler Handling POST /v2/check
    Jan 27 11:50:12 2023-01-27 10:50:12.527 +0000 INFO org.languagetool.server.LanguageToolHttpHandler Handling POST /v2/check
    Jan 27 11:50:15 2023-01-27 10:50:15.099 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.RuntimeException: Expected at least '1grams', '2grams', and '3grams' sub directories but only got [3grams] in /app/data/ngrams/en, detected: en-US', sending HTTP code 500. Access from 0:0:0:0:0:0:0:1, HTTP user agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0, User agent param: webextension-firefox-ng, v: 6.0.1, Referrer: null, language: en-gb, h: 2, r: 2, time: 2589m: TEXTLEVEL_ONLY, l: PICKY, iID: 94148:1674816428889, Stacktrace follows:java.lang.RuntimeException: java.lang.RuntimeException: Expected at least '1grams', '2grams', and '3grams' sub directories but only got [3grams] in /app/data/ngrams/en, detected: en-US
    Jan 27 11:50:15 at org.languagetool.server.TextChecker.checkText(TextChecker.java:507)
    Jan 27 11:50:15 at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:172)
    Jan 27 11:50:15 at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:83)
    Jan 27 11:50:15 at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:185)
    Jan 27 11:50:15 at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
    Jan 27 11:50:15 at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
    Jan 27 11:50:15 at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
    Jan 27 11:50:15 at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:848)
    Jan 27 11:50:15 at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
    Jan 27 11:50:15 at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:817)
    Jan 27 11:50:15 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    Jan 27 11:50:15 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    Jan 27 11:50:15 at java.base/java.lang.Thread.run(Thread.java:829)
    Jan 27 11:50:15 Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Expected at least '1grams', '2grams', and '3grams' sub directories but only got [3grams] in /app/data/ngrams/en
    Jan 27 11:50:15 at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
    Jan 27 11:50:15 at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
    Jan 27 11:50:15 at org.languagetool.server.TextChecker.checkText(TextChecker.java:489)
    Jan 27 11:50:15 ... 12 more
    Jan 27 11:50:15 Caused by: java.lang.RuntimeException: Expected at least '1grams', '2grams', and '3grams' sub directories but only got [3grams] in /app/data/ngrams/en
    Jan 27 11:50:15 at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.validateDirectory(LuceneSingleIndexLanguageModel.java:72)
    Jan 27 11:50:15 at org.languagetool.languagemodel.LuceneSingleIndexLanguageModel.doValidateDirectory(LuceneSingleIndexLanguageModel.java:109)
    

    Pronouns: he/him | Primary language: German

    1 Reply Last reply
    0
  • luckowL Offline
    luckowL Offline
    luckow translator
    wrote on last edited by
    #0

    My mistake. I restarted the app too early.
    After the full download of almost 8 GB EN n-gram dataset, you need to give your Cloudron instance enough time to unpack and move the files to (by default) /app/data/ngram/en.

    In my case, it took more than 15 minutes to meet the requirements.
    The moment you restarted the app too early, the zip file was not unzipped completely. In this case the error occurs and you have to start again from the beginning.

    Search your logs for ===> en ngram dataset has been installed.

    Pronouns: he/him | Primary language: German

    1 Reply Last reply
    1
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #2

    did the n-gram download finish and is this also happening after an app restart?

    luckowL 1 Reply Last reply
    0
  • luckowL Offline
    luckowL Offline
    luckow translator
    replied to nebulon on last edited by luckow
    #3

    @nebulon yesterday I followed the documentation from here https://docs.cloudron.io/apps/languagetool/.
    By the way: Is there a hint if it is important to comment out NGRAM_DATASET_PATH? In my case I only commented out NGRAM_DATASET=("en").

    And yes: it is a permanent error. Every time I restarted the box, the same error occurred. Fun fact: the moment I comment NGRAM_DATASET=("en") again and restart the app, the error still occurs.

    Q: is there an option to "redownload"?

    Pronouns: he/him | Primary language: German

    nebulonN 1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    replied to luckow on last edited by
    #4

    @luckow NGRAM_DATASET_PATH has a default set to /app/data/ngram so that does not need to be set, it is only there if someone want to move that to a volume due to the required disk size.

    Currently you have to delete the folder for that specific language to trigger a redownload after app restart.

    1 Reply Last reply
    1
  • nebulonN nebulon marked this topic as a question on
  • luckowL Offline
    luckowL Offline
    luckow translator
    wrote on last edited by
    #5

    My mistake. I restarted the app too early.
    After the full download of almost 8 GB EN n-gram dataset, you need to give your Cloudron instance enough time to unpack and move the files to (by default) /app/data/ngram/en.

    In my case, it took more than 15 minutes to meet the requirements.
    The moment you restarted the app too early, the zip file was not unzipped completely. In this case the error occurs and you have to start again from the beginning.

    Search your logs for ===> en ngram dataset has been installed.

    Pronouns: he/him | Primary language: German

    1 Reply Last reply
    1
  • luckowL luckow has marked this topic as solved on
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #6

    The latest package version does not require the manual restart anymore, but will restart the internal component automatically after the download has finished.

    1 Reply Last reply
    2

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.