node_characterai icon indicating copy to clipboard operation
node_characterai copied to clipboard

ProtocolError

Open gamersindo1223 opened this issue 10 months ago • 11 comments

Hi, This is an issue that I've encountered now. This issue happened just now, sometimes I got this error or it's stuck after sending message (noresponse): ProtocolError: Could not load body for this request. This might happen if the request is a preflight request.

gamersindo1223 avatar Apr 19 '24 15:04 gamersindo1223

Hello, could you send the stack trace?

realcoloride avatar Apr 19 '24 16:04 realcoloride

This another error that I got

[node_characterai] Puppeteer - Error: net::ERR_FAILED at https://character.ai/chat/history/continue/
/root/rest-api/node_modules/node_characterai/client.js:144
        if (request.status() === 200 || request.status() === 404) {
                    ^

TypeError: Cannot read properties of undefined (reading 'status')

and other than that it would just hang

gamersindo1223 avatar Apr 20 '24 00:04 gamersindo1223

What version of the package are you using?

realcoloride avatar Apr 20 '24 02:04 realcoloride

Been getting this randomly too, not often. But maybe 2-3 times when used for 3-4 hours continuously.

sivertheisholt avatar Apr 20 '24 12:04 sivertheisholt

This is weird because I do not think I've ever encountered this before. Whats your operating system and chromium version? I personally cannot reproduce this issue (yet).

Could you guys try to open the browser up (switching headless to false) and leave the network tab open so whenever the issue happens you check what happened? or just print whatever comes out as a response.

Related to the ProtocolError issue, I don't know what could be causing this. Perhaps CharacterAI (or the old interface) is going through downtimes or maintenances? However I've found this: https://github.com/puppeteer/puppeteer/issues/9864#issuecomment-1620651839 which could indicate its perhaps not an error caused by the package.

Once you've tested and the error happens again, show me as much as information you got from the error and then try to uninstall the node_characterai package along with puppeteer and reinstall it and see if it happens again.

realcoloride avatar Apr 20 '24 13:04 realcoloride

This is weird because I do not think I've ever encountered this before. Whats your operating system and chromium version? I personally cannot reproduce this issue (yet).

Could you guys try to open the browser up (switching headless to false) and leave the network tab open so whenever the issue happens you check what happened? or just print whatever comes out as a response.

Related to the ProtocolError issue, I don't know what could be causing this. Perhaps CharacterAI (or the old interface) is going through downtimes or maintenances? However I've found this: puppeteer/puppeteer#9864 (comment) which could indicate its perhaps not an error caused by the package.

Once you've tested and the error happens again, show me as much as information you got from the error and then try to uninstall the node_characterai package along with puppeteer and reinstall it and see if it happens again.

Running the library in self hosted Docker as a Service with REST. Its probably Character AI having issues to be honest, because today its been running without issues. I have added file logging, so I will provide the logs if it happens again.

sivertheisholt avatar Apr 20 '24 13:04 sivertheisholt

Okay thank you. Sadly, if it is a CharacterAI issue, I cannot do much for now. However I recommend you use something like pm2 to automatically restart your script if it crashes or whatnot.

Good luck and keep me updated.

realcoloride avatar Apr 20 '24 13:04 realcoloride

@realcoloride just checked the logs, looks lke this happened because the new interface I think,

Is there any plan to use the new c.ai website so this issue would probably get fixed? Thanks

gamersindo1223 avatar Apr 20 '24 14:04 gamersindo1223

Hello,

Could you send me the logs/traces?

As I said before, I will use the old interface as long as possible (for compatibility & stability reasons). I will switch to using the new interface and endpoints when the old interface will no longer work or be fully broken.

realcoloride avatar Apr 20 '24 16:04 realcoloride

@realcoloride I'm sorry but looks like I can't provide it, because it would stuck indefinitely without giving any output

gamersindo1223 avatar Apr 20 '24 17:04 gamersindo1223

@realcoloride hmm this issue still exist? is there any update?

gamersindo1223 avatar May 17 '24 13:05 gamersindo1223

Shouldn't. Could you try & let me know?

realcoloride avatar May 17 '24 13:05 realcoloride

nvm I need to reinstall my whole node_modules to fix this issue, and/or use another session_id from other account

gamersindo1223 avatar May 17 '24 15:05 gamersindo1223