emacs-grammarly / flycheck-grammarly

Grammarly support for Flycheck
GNU General Public License v3.0
127 stars 8 forks source link

Request callback error #9

Closed swarnendubiswas closed 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 Grammarly do not finds it.

The flycheck checkers are set as follows.

Syntax checkers for buffer *scratch* in text-mode:

First checker to run:

  textlint
    - may enable:         yes
    - executable:         Found at /home/swarnendu/tmp/textlint-workspace/node_modules/.bin/textlint
    - configuration file: Found at "/home/swarnendu/tmp/textlint-workspace/textlintrc.json"
    - textlint plugin:    @textlint/text
    - next checkers:      grammarly

Checkers that may run as part of the first checker's chain:

  grammarly
    - may enable: yes

The following syntax checkers are not registered:
  - proselint
Try adding these syntax checkers to `flycheck-checkers'.

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20210321.852)
Emacs version:    27.1
System:           x86_64-pc-linux-gnu
Window system:    x

Flycheck does not list errors from Grammarly. Opening the file or Invoking flycheck-buffer shows the following error.

connecting as swarnendu@**********
[error] request--callback: peculiar error: 401
connecting as swarnendu@**********
[error] request--callback: peculiar error: 401

I have a PRO account with Grammarly, and VS Code works fine. What could be the issue here? Thanks.

jcs090218 commented 3 years ago

I think this is duplicate of https://github.com/emacs-grammarly/grammarly/issues/3.

swarnendubiswas commented 3 years ago

Ok, thanks. So, we must use lsp-grammarly for using a PAID account. That is fine.

I get an error with lsp-grammarly, I will post it quickly here to see if you know of a solution.

/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:417
            throw new SocketError(this._statusCode, `Socket connection failed: ${this._statusMessage}`);
                  ^

SocketError: Socket connection failed: NOT_AUTHORIZED
    at GrammarlyClient._connect (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:417:19)
    at GrammarlyClient._queueOrSend (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:494:18)
    at /home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:390:18
    at new Promise (<anonymous>)
    at GrammarlyClient.send (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:388:16)
    at GrammarlyClient.sendWithErrorHandling (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:618:31)
    at GrammarlyClient.submitOT (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/node_modules/@emacs-grammarly/unofficial-grammarly-api/dist/index.cjs.js:710:21)
    at TextGrammarCheckHost.sync (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/dist/index.cjs.js:584:24)
    at TextGrammarCheckHost.setText (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/dist/index.cjs.js:527:19)
    at Function.update (/home/swarnendu/github/dotemacs/var/lsp/server/npm/@emacs-grammarly/unofficial-grammarly-language-server/lib/node_modules/@emacs-grammarly/unofficial-grammarly-language-server/dist/index.cjs.js:327:28) {
  code: 4001
}

Do you know why I get this error? I have logged in to my PAID Grammarly account with VS Code.

jcs090218 commented 3 years ago

I think the error is from the upstream https://github.com/znck/grammarly/issues/183. Duplicate of https://github.com/emacs-grammarly/lsp-grammarly/issues/12.

The current workaround is to logout and login again!

jcs090218 commented 3 years ago

Closing this for duplicate reason.

swarnendubiswas commented 3 years ago

I think the error is from the upstream znck/grammarly#183. Duplicate of emacs-grammarly/lsp-grammarly#12.

The current workaround is to logout and login again!

@jcs090218 The error I get says SocketError: Socket connection failed: SHUTDOWN. Is this the same as the issue you point to, since that error is SocketError: Socket connection failed: NOT_AUTHORIZED.

Logging out and logging in does not seem to solve the issue for me.