question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clinic v0.6.2 / Node v8.9.4: Error: Invalid JSON (Unexpected "p" at position 24584 in state STOP)

See original GitHub issue

This pops up after hanging at ‘analyzing data’ for a few seconds:

analysing data
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Invalid JSON (Unexpected "p" at position 24584 in state STOP)
    at Parser.proto.charError (/home/aaron/code/mspdna-ssh/node_modules/jsonparse/jsonparse.js:90:16)
    at Parser.proto.write (/home/aaron/code/mspdna-ssh/node_modules/jsonparse/jsonparse.js:154:23)
    at Stream.<anonymous> (/home/aaron/code/mspdna-ssh/node_modules/JSONStream/index.js:21:12)
    at Stream.stream.write (/home/aaron/code/mspdna-ssh/node_modules/through/index.js:26:11)
    at TraceEventDecoder._transform (/home/aaron/code/mspdna-ssh/node_modules/@nearform/clinic-doctor/format/trace-event-decoder.js:114:19)
    at TraceEventDecoder.Transform._read (_stream_transform.js:186:10)
    at TraceEventDecoder.Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:387:12)
    at writeOrBuffer (_stream_writable.js:373:5)
    at TraceEventDecoder.Writable.write (_stream_writable.js:290:11)
19:12:39 ⌂131% [aaron@ripley:~/code/mspdna-ssh] [mspdna] develop(+2861/-42)* 1 ± 

The instructions say it would be super helpful if I tell clinic to upload some data to the cloud to help with debugging. I’m hesitant to do that on a private project that has SSH keys loaded into memory. What’s “the cloud”, where’s the data going, and who gets to see it? 😉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollinacommented, Feb 4, 2018

How about we put that explanation of the files being uploaded into the README? Seems a valid question.

1reaction
AndreasMadsencommented, Feb 4, 2018

Properly this is because you use Node v8.9.4. There are some issues with Node v8.9.4 that will be fixed in Node 8.10.0. Unfortunately, that hasn’t been released yet. Please try Node v9.4.0 and see if that helps.

What’s “the cloud”, where’s the data going, and who gets to see it? 😉

The cloud is our Amazon server that is in the US (@mafintosh confirm please) and only the clinic team gets to see it.

I think the more important question is what gets uploaded. There are three files, the information is not sensitive at all. The upload code is in https://github.com/nearform/node-clinic/blob/master/lib/tar-and-upload.js you can confirm yourself that it only uploads the clinic data. The clinic data itself contains three files:

  • {pid}.clinic-doctor-traceevent: A JSON file containing GC data and execution timing data (inspect it yourself). This is also the file that is partial.
  • {pid}.clinic-doctor-systeminfo: A JSON file (inspect it yourself).
  • {pid}.clinic-doctor-processstat: A protocol buffer file, containing samples of memory usage, cpu usage, delay, and number of handles. You can see the schema here: https://github.com/nearform/node-clinic-doctor/blob/master/format/process-stat.proto

Could you tell me if you have any files called node_trace.2.log?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clinic v0.6.2 / Node v8.9.4: Error: Invalid JSON ... - GitHub
Clinic v0.6.2 / Node v8.9.4: Error: Invalid JSON (Unexpected "p" at position 24584 in state STOP) #9.
Read more >
Unexpected token in JSON at position 0, when reading and ...
The error is indicating some unsupported characters at the beginning of ... invalid json syntax (check for quotations, trailing commas, etc.) ...
Read more >
What Is JSON and How to Handle an “Unexpected Token” Error
Learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as "Unexpected Token < in JSON...
Read more >
Security Bulletin 25 May 2022
SingCERT's Security Bulletin summarises the list of vulnerabilities collated from the National Institute of Standards and Technology ...
Read more >
Unexpected token } in JSON at position 65 - Google Groups
the error is telling you that msg.payload is a string, but is not valid JSON. If you pass the message to the Debug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found