cal.com
cal.com copied to clipboard
"Unexpected token p in JSON at position 4" on startup
Issue Summary
Running the latest (3.2.10) release with docker yields the following error message in the console:
calcom_1 | @calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
calcom_1 | @calcom/web:start: https://next-auth.js.org/errors#client_fetch_error Unexpected token p in JSON at position 4 {
calcom_1 | @calcom/web:start: error: {
calcom_1 | @calcom/web:start: message: 'Unexpected token p in JSON at position 4',
calcom_1 | @calcom/web:start: stack: 'SyntaxError: Unexpected token p in JSON at position 4\n' +
calcom_1 | @calcom/web:start: ' at JSON.parse (<anonymous>)\n' +
calcom_1 | @calcom/web:start: ' at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)\n' +
calcom_1 | @calcom/web:start: ' at successSteps (node:internal/deps/undici/undici:6636:27)\n' +
calcom_1 | @calcom/web:start: ' at node:internal/deps/undici/undici:1236:60\n' +
calcom_1 | @calcom/web:start: ' at node:internal/process/task_queues:140:7\n' +
calcom_1 | @calcom/web:start: ' at AsyncResource.runInAsyncScope (node:async_hooks:203:9)\n' +
calcom_1 | @calcom/web:start: ' at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)\n' +
calcom_1 | @calcom/web:start: ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)',
calcom_1 | @calcom/web:start: name: 'SyntaxError'
calcom_1 | @calcom/web:start: },
calcom_1 | @calcom/web:start: url: 'https://cal.example.com/api/auth/csrf',
calcom_1 | @calcom/web:start: message: 'Unexpected token p in JSON at position 4'
calcom_1 | @calcom/web:start: }
Everything seems to still work as expected but the error looks like it should not happen.
Steps to Reproduce
- Upgrade to 3.2.10 using docker
Is the clinet loading at all? @kolaente
How do I check that?
Hey @kolaente I'm unable to re-create it 🤔 Are you still facing this issue in our latest release >= v3.3.6?
@alishaz-polymath Can't check because the docker image is not yet published:
$ docker compose pull
[+] Pulling 2/2
✘ calcom Error 1.5s
✔ database Pulled 1.2s
Error response from daemon: manifest for calcom/cal.com:v3.3.6 not found: manifest unknown: manifest unknown
@alishaz-polymath Can't check because the docker image is not yet published:
$ docker compose pull [+] Pulling 2/2 ✘ calcom Error 1.5s ✔ database Pulled 1.2s Error response from daemon: manifest for calcom/cal.com:v3.3.6 not found: manifest unknown: manifest unknown
Can you try 3.3.4 instead?
That doesn't exist either
Interesting. Let me take a look 🙏
UPDATE We're facing certain issues with the release in docker, and it is under investigation. I'll confirm here when that is sorted 🙏
Hey @kolaente can you test now?
Was able to test with 3.3.7, same error still happening:
calcom-calcom-1 | @calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
calcom-calcom-1 | @calcom/web:start: https://next-auth.js.org/errors#client_fetch_error Unexpected token p in JSON at position 4 {
calcom-calcom-1 | @calcom/web:start: error: {
calcom-calcom-1 | @calcom/web:start: message: 'Unexpected token p in JSON at position 4',
calcom-calcom-1 | @calcom/web:start: stack: 'SyntaxError: Unexpected token p in JSON at position 4\n' +
calcom-calcom-1 | @calcom/web:start: ' at JSON.parse (<anonymous>)\n' +
calcom-calcom-1 | @calcom/web:start: ' at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)\n' +
calcom-calcom-1 | @calcom/web:start: ' at successSteps (node:internal/deps/undici/undici:6636:27)\n' +
calcom-calcom-1 | @calcom/web:start: ' at node:internal/deps/undici/undici:1236:60\n' +
calcom-calcom-1 | @calcom/web:start: ' at node:internal/process/task_queues:140:7\n' +
calcom-calcom-1 | @calcom/web:start: ' at AsyncResource.runInAsyncScope (node:async_hooks:203:9)\n' +
calcom-calcom-1 | @calcom/web:start: ' at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)\n' +
calcom-calcom-1 | @calcom/web:start: ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)',
calcom-calcom-1 | @calcom/web:start: name: 'SyntaxError'
calcom-calcom-1 | @calcom/web:start: },
calcom-calcom-1 | @calcom/web:start: url: 'https://cal.kolaente.de/api/auth/csrf',
calcom-calcom-1 | @calcom/web:start: message: 'Unexpected token p in JSON at position 4'
calcom-calcom-1 | @calcom/web:start: }
calcom-calcom-1 | @calcom/web:start: react-i18next:: You will need to pass in an i18next instance by using initReactI18next
calcom-calcom-1 | @calcom/web:start: 16:02:51.758 WARN RateLimit Disabled due to not finding UPSTASH env variables
calcom-calcom-1 | @calcom/web:start: [PERF]: getByViewer(1) took 28.900772094726562ms
No docker image for 3.4.1 available, but 3.4.0 exists. Still the same error though.
I had the same issue, and it was my env var ALLOWED_HOSTNAMES that was not a valid JSON. I update it with : ALLOWED_HOSTNAMES=["https://cal.domain.com"] and this error is gone, on my side.
Same here and solution/this comment from @lionep helped.
I had the same issue, and it was my env var ALLOWED_HOSTNAMES that was not a valid JSON. I update it with : ALLOWED_HOSTNAMES=["https://cal.domain.com"] and this error is gone, on my side.
This seems to have solved it for everybody 🙏 Thank you @lionep 🙌 🚀
using ALLOWED_HOSTNAMES=["https://cal.domain.com"] did not work for me, i'm running coolify and if I used that i got "Unexpected token p in JSON at position 2" and application wouldnt run
Maybe coolify is escaping some chars in environment ? Can you try do enter your container (if any?) and print the output of :
env | grep ALLOWED_HOSTNAMES