znck/grammarly

Stopped working even if logged in

amacgregor opened this issue ยท 14 comments

Started getting the following error:

1618161793982 DEBUG  [TextGrammarCheckHost] (66696c) Hosting file:///Volumes/Workspace/Writing/Draft.dev/in-progress/Achieving%20Repeatability%20in%20Continuous%20Integration/Request.md
(node:392999) UnhandledPromiseRejectionWarning: Error: Socket connection failed: NOT_AUTHORIZED
    at GrammarlyClient._connect (/home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38903:19)
    at GrammarlyClient._queueOrSend (/home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38978:18)
    at /home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38876:18
    at new Promise (<anonymous>)
    at GrammarlyClient.send (/home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38874:16)
    at GrammarlyClient.start (/home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39160:21)
    at GrammarlyClient.onConnection [as _onConnection] (/home/amacgregor/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39809:32)
(node:392999) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

I got the same error these days.

I am getting the same error.

UnhandledPromiseRejectionWarning: Error: Socket connection failed: NOT_AUTHORIZED

What to do?

Ironically, it's helping to write this comment :-|

Getting the same error

znck commented

I'll try look into this today.

znck commented

Couldn't reproduce. Need more info.

(node:49088) UnhandledPromiseRejectionWarning: Error: Socket connection failed: NOT_AUTHORIZED
    at GrammarlyClient._connect (/home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38903:19)
    at GrammarlyClient._queueOrSend (/home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38978:18)
    at /home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38876:18
    at new Promise (<anonymous>)
    at GrammarlyClient.send (/home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38874:16)
    at GrammarlyClient.start (/home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39160:21)
    at GrammarlyClient.onConnection [as _onConnection] (/home/emre/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39809:32)
(node:49088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

It is resolved today for me.
Start vscode.
Login.
Close vscode.
Start vscode again.

I was facing the same problem, I logged out (Grammarly: Logout of grammarly.com) and then it started to work again and was still working when I logged back in.

Maybe the token expired?

znck commented

Nice catch. I am not checking token for expiration. Will try to fix.

Any updates on this, the "login" popups that we cannot do anything about are a serious distraction.

Getting the same error:

(node:16276) UnhandledPromiseRejectionWarning: Error: Socket connection failed: NOT_AUTHORIZED
    at GrammarlyClient._connect (c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:38903:19)
    at GrammarlyClient._queueOrSend (c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:38978:18)
    at c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:38876:18
    at new Promise (<anonymous>)
    at GrammarlyClient.send (c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:38874:16)
    at GrammarlyClient.start (c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:39160:21)
    at GrammarlyClient.onConnection [as _onConnection] (c:\Users\michi\.vscode\extensions\znck.grammarly-0.14.0\dist\server\index.js:39809:32)
(node:16276) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Logging out and in again does not help. It works fine though on a different workstation.

znck commented

The NOT_AUTHORIZED error code occurs when access token received from OAuth has expired. I haven't implemented token deletion or refreshing. However, as a workaround you can:

  1. Logout using Grammarly: Logout from grammarly.com
  2. Reload or Restart VS Code
  3. Login using Grammarly: Login to grammarly.com

I don't have bandwidth to fix this issue right now but I am open to PRs.

I have the same issue, but the above workaround does not work for me. When I log out it works fine, though.

1633538118610 DEBUG  [TextGrammarCheckHost] (66696c) Hosting file:///home/christophe/code/PhD/chapters/split/4.creek.texpart.0.tex
1633538145369 DEBUG  [TextGrammarCheckHost] (66696c) ChangeSet [
  {
    ops: [
      {
        insert: ' <snip>
          ' '
      },
      [length]: 1
    ]
  },
  [length]: 1
]
(node:36426) UnhandledPromiseRejectionWarning: Error: Socket connection failed: NOT_AUTHORIZED
    at GrammarlyClient._connect (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38903:19)
    at GrammarlyClient._queueOrSend (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38978:18)
    at /home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38876:18
    at new Promise (<anonymous>)
    at GrammarlyClient.send (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:38874:16)
    at GrammarlyClient.sendWithErrorHandling (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39102:31)
    at GrammarlyClient.submitOT (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39194:21)
    at TextGrammarCheckHost.sync (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39943:24)
    at TextGrammarCheckHost.setText (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39886:19)
    at Function.update (/home/christophe/.vscode/extensions/znck.grammarly-0.14.0/dist/server/index.js:39686:28)
(Use `code --trace-warnings ...` to show where the warning was created)
(node:36426) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:36426) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

znck commented

Fixed in v0.18.0