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

"Invalid json response" body when starting job #461

Open
steshaw opened this issue Apr 19, 2023 · 1 comment
Open

"Invalid json response" body when starting job #461

steshaw opened this issue Apr 19, 2023 · 1 comment

Comments

@steshaw
Copy link
Contributor

steshaw commented Apr 19, 2023

Describe the bug

When you start a job in the UI. The Node server display this error:

FetchError: invalid json response body at http://192.168.49.2:31907/job/11/start reason: Unexpected token o in JSON at position 0
    at /home/steshaw/Code/tweag/chainsail/app/client/node_modules/node-fetch/lib/index.js:272:32
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async handleRequestResponse (webpack-internal:///./utils/handleRequestResponse.js:91:22)
    at async __webpack_exports__.default (webpack-internal:///./pages/api/job/start.js:12:3)
    at async apiResolver (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/api-utils.js:8:1)
    at async DevServer.handleApiRequest (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/next-server.js:64:462)
    at async Object.fn (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/next-server.js:56:492)
    at async Router.execute (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/router.js:23:67)
    at async DevServer.run (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/next-server.js:66:1042)
    at async DevServer.handleRequest (/home/steshaw/Code/tweag/chainsail/app/client/node_modules/next/dist/next-server/server/next-server.js:34:1081) {
  type: 'invalid-json'
}

This error is not reflected in the UI and so the job appears to have started. Indeed it has started and therefore everything appears okay.

To Reproduce

  1. Create a new job
  2. Click 'Start' from the 'My jobs' page.

Expected behaviour

The job starts and there are no errors.

Environment

  • OS name + version: Ubuntu 22.04.2 LTS
  • Version of the code: main branch at 629c294
@steshaw
Copy link
Contributor Author

steshaw commented Apr 19, 2023

A little investigation reveals that the problem is that the response is not JSON — it's the string "ok"

$ curl -XPOST http://192.168.49.2:31907/job/11/start
ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant