gfodor / p2pcf

Low cost, low effort P2P WebRTC serverless signalling using Cloudflare Workers
MIT License
964 stars 53 forks source link

bug: cf worker error 1101 causing JSON.parse error #9

Open ThaUnknown opened 2 years ago

ThaUnknown commented 2 years ago
Error 1101 Ray ID: 73427f0fcf93b363 • 2022-08-01 23:53:59 UTC
Worker threw exception
What happened?
You've requested a page on a website (p2pcf.minddrop.workers.dev) that is on the Cloudflare network. An unknown error occurred while rendering the page.

What can I do?
If you are the owner of this website:
you should login to Cloudflare and check the error logs for p2pcf.minddrop.workers.dev.

POST https://p2pcf.minddrop.workers.dev/ 500

causes:

SyntaxError: Unexpected token < in JSON at position 0

at: https://github.com/gfodor/p2pcf/blob/3b3988592a60e3f1e9ce59fc2cf866d4c26829ed/src/p2pcf.js#L356

gfodor commented 2 years ago

Is this happening continuously or sporadically? I've noticed occasionally cloudflare throws errors about a connection loss but haven't investigated. (The client code should obviously handle this better.)

If it's continuous, please try deploying the worker yourself to see if you can reproduce and tail the log to get the underlying bug. Thanks!

ThaUnknown commented 2 years ago

continuously by far

gfodor commented 2 years ago

Can you paste a dump of the payload going to the server or a CURL to repro? (Right click in the network tab and copy as curl)

ThaUnknown commented 2 years ago

payload:

{"r":"77dc3677df83be5f","k":"aR6mDaWWriOXvezZM1nRJ8wfIWE","d":["C8NprUJbq26mEvHaCdmwO+HqMGU","d8a4cc5b7b1732dd",false,"HpVqtw9iAzantbZBE7BZn+zjJerYXHlor0PFOqKEOds=",1659709213060,["IP"]],"t":1659709318894,"x":120000,"p":[]}
ThaUnknown commented 2 years ago

this could be lightly related to #14