emacs-languagetool / flycheck-languagetool

Flycheck support for LanguageTool
GNU General Public License v3.0
55 stars 9 forks source link

Error from syntax checker languagetool: peculiar error: "deleted #12

Open swarnendubiswas opened 3 years ago

swarnendubiswas commented 3 years ago

Hi,

Suppose I have a text buffer or a file with the following content.

This text has bug but LanguageTool do not finds it.

The flycheck checkers are set as follows.

First checker to run:

  languagetool
    - may enable:              yes
    - LanguageTool server JAR: Found at /home/swarnendu/.emacs.d/etc/languagetool-server.jar
    - LanguageTool API URL:    Not configured
    - next checkers:           proselint

I do not use proselint and have disabled it, so the rest of the Flycheck checkers buffer should not be relevant.

Flycheck-languagetool throws the following error when I invoke flycheck-buffer.

Error from syntax checker languagetool: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: flycheck-languagetool--read-results: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: flycheck-languagetool--read-results: peculiar error: "failed with code 111
", :host, "localhost", :service, 8081
error in process sentinel: peculiar error: "failed with code 111
", :host, "localhost", :service, 8081
Error from syntax checker languagetool: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: flycheck-languagetool--read-results: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: peculiar error: "deleted
", :host, "localhost", :service, 8081
error in process sentinel: flycheck-languagetool--read-results: peculiar error: "failed with code 111
", :host, "localhost", :service, 8081
error in process sentinel: peculiar error: "failed with code 111
", :host, "localhost", :service, 8081

Here is my flycheck-languagetool configuration.

;; https://languagetool.org/download/
(use-package flycheck-languagetool
  :after flycheck
  :defines (flycheck-languagetool-commandline-jar flycheck-languagetool-check-time)
  :demand t
  :config
  (setq flycheck-languagetool-commandline-jar (no-littering-expand-etc-file-name
                                               "languagetool-commandline.jar")
        flycheck-languagetool-server-jar (no-littering-expand-etc-file-name
                                          "languagetool-server.jar")
        flycheck-languagetool-check-time 3))
jcs090218 commented 3 years ago

Hmm... I cannot reproduce this error.

Make sure you have valid path for flycheck-languagetool-server-jar and make sure the port is available on your machine, default is 8081.

mavit commented 3 years ago

Also have a look in the buffer *LanguageTool server* (note the leading space) to see if there are any helpful errors there.

mavit commented 3 years ago

Is this fixed by commit b6d0b1515418e5821241ac04143a12997c3bb240?

pittma commented 2 years ago

Hey all. So I ended up here because I was seeing the same thing on a new installation, MacOS specifically. It was just because I hadn't yet installed the JRE.

mavit commented 2 years ago

I was seeing the same thing on a new installation, MacOS specifically. It was just because I hadn't yet installed the JRE.

With what version of flycheck-languagetool? I had hoped that this has been fixed.

pittma commented 2 years ago

I was seeing the same thing on a new installation, MacOS specifically. It was just because I hadn't yet installed the JRE.

With what version of flycheck-languagetool? I had hoped that this has been fixed.

I'm running 20211107.1001.

mavit commented 2 years ago

Hmm. What does M-x flycheck-verify-checker languagetool say when a JRE isn't installed? We now check for a java executable before trying to activate the checker, but I wonder if that check fails on MacOS for some reason.

guilhermecomum commented 2 years ago

@swarnendubiswas are you able to run the language tool server? Did you try run this command: java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081 --allow-origin

Inc0n commented 2 years ago

I have just encountered this problem recently. Do note though I used flymake not flycheck, but since there is a thread here already, and the code seems fairly similar in at least the places I have made some modifications.

I suspect it's because for some reason the server has been started, but the process is not live anymore. For OSX, it would spawn new application named java but is in fact the HTTPServer, I closed it without knowing that which is most likely part of the cause of this error. So now flymake-languagetool--started-server is t, but (process-live-p (get-process "languagetool-server")) returns nil.

What I did for my quick fix was to comment out the following lines:

(unless flymake-languagetool--started-server
      (setq flymake-languagetool--started-server t))

So that flymake-languagetool--start-server will be called every time, but it shouldn't create additional server instances, as there is a process-live-p check.