Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled JSON parse error #95

Open
k1o0 opened this issue Jun 20, 2023 · 0 comments
Open

Unhandled JSON parse error #95

k1o0 opened this issue Jun 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@k1o0
Copy link
Collaborator

k1o0 commented Jun 20, 2023

The CI froze due to an unhandled rejection. My hypothesis is that a previous test took too long but the CI failed to kill the subprocess. The CI then tried reading the JSON file as the previous test's subprocess was writing to it.

2023-06-15T12:03:56.660Z ci:lib Loading test records from /home/experiment/.ci/.db.json for id 7293f56
Unhandled Rejection at: Promise Promise {
  <rejected> SyntaxError: Unexpected end of JSON input
      at JSON.parse (<anonymous>)
      at loadTestRecords (/home/experiment/Documents/github/matlab-ci/lib.js:111:20)
      at updateJobFromRecord (/home/experiment/Documents/github/matlab-ci/lib.js:167:15)
      at shortCircuit (/home/experiment/Documents/github/matlab-ci/lib.js:251:19)
      at Immediate.<anonymous> (/home/experiment/Documents/github/matlab-ci/main.js:17:26)
      at processImmediate (internal/timers.js:463:21)
} reason: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at loadTestRecords (/home/experiment/Documents/github/matlab-ci/lib.js:111:20)
    at updateJobFromRecord (/home/experiment/Documents/github/matlab-ci/lib.js:167:15)
    at shortCircuit (/home/experiment/Documents/github/matlab-ci/lib.js:251:19)
    at Immediate.<anonymous> (/home/experiment/Documents/github/matlab-ci/main.js:17:26)
    at processImmediate (internal/timers.js:463:21)
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at loadTestRecords (/home/experiment/Documents/github/matlab-ci/lib.js:111:20)
    at updateJobFromRecord (/home/experiment/Documents/github/matlab-ci/lib.js:167:15)
    at shortCircuit (/home/experiment/Documents/github/matlab-ci/lib.js:251:19)
    at Immediate.<anonymous> (/home/experiment/Documents/github/matlab-ci/main.js:17:26)
    at processImmediate (internal/timers.js:463:21)

First priority is to handle this exception, but it could also try reading the file twice just in case.

@k1o0 k1o0 added the bug Something isn't working label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant