REditorSupport / REditorSupport/languageserver

error handling json: Error: lexical error: invalid char in json text.

Open
#465 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

When running some of my R scripts, I always get following errors which shuts down the server.
Cannot figure out what json text it is referring to, and what causes it.

[2021-08-09 16:03:38.041] error handling json:  Error: lexical error: invalid char in json text.
                                       Content-Length: 10492    {"json
                     (right here) ------^

Stack trace:
1: parse_string(txt, bigint_as_char)
2: parseJSON(txt, bigint_as_char)
3: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, 
    simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix, 
    flatten = flatten, ...)
4: jsonlite::fromJSON(data, simplifyVector = FALSE)

[2021-08-09 16:03:38.046] Error: Unexpected non-empty line
Call: self$read_header()
Stack trace:
1: stop("Unexpected non-empty line")
2: self$read_header()
3: self$fetch(blocking = FALSE)

[2021-08-09 16:03:38.046] exiting

[Error - 4:03:38 pm] Connection to server is erroring. Shutting down server.
[Error - 4:03:38 pm] Connection to server is erroring. Shutting down server.
[Error - 4:03:38 pm] Connection to server is erroring. Shutting down server.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported stack trace, especially jsonlite::fromJSON(data, simplifyVector = FALSE), parseJSON, and self$read_header(). Reproduce the failure using the affected R scripts or equivalent input and determine which message contains the invalid JSON. Done should include a confirmed cause and a way for the server to handle it without shutting down.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.