On our testnet node (https://ceramic-clay.disco.xyz) and configured to 3ID network testnet-clay we inconsistently get this error message when we are either trying to load data from Ceramic or connect to 3ID. It works fine and then without any changes on our end we will start to get this error. It usually lasts several minutes and then works again. If we point to mainnet everything works as expected. It used to only occur about once a day but recently it happens constantly.
Access to XMLHttpRequest at 'https://ceramic-clay.disco.xyz/api/v0/streams' from origin 'https://staging.disco.xyz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
POST https://ceramic-clay.disco.xyz/api/v0/streams net::ERR_FAILED 504`
browser-ponyfill.js:480 Uncaught (in promise) TypeError: Network request failed
at M.i.onerror (browser-ponyfill.js:480:16)
at XMLHttpRequest.r (helpers.ts?2d75:99:17)
No idea, really. I have read Express and CORS code few times. There is literally nothing suspicious in the CORS code. There is definitely something wrong with it, but I fail to see where exactly. The only idea I have is to replace slow express with fastify, which seems to be more optimised for our kind of load.
From my experience, CORS errors are actually rarely actually about CORS itself.
I always look for other errors in the vicinity of the CORS errors, and, surely enough, there’s a 504 for the Post to the streams endpoint in the screenshot @sruddy posted on Discord.
Moreover, CORS errors don’t take 30-60 seconds as reported in this case.
The fact that it is occurring constantly is probably actually a good thing We should be able to debug it much more easily. Errors that occur intermittently across hours or days are much harder to investigate.
@sruddy, could you attach your Ceramic node log? Or search the log for messages with the text “loading queue is full” and let us know if you’re seeing those regularly?
Also could you let us know what version of ceramic you are running (the version of the @ceramicnetwork/cli package)?