Open Mazawrath opened 11 months ago
Thanks @Mazawrath for reporting this
I will have a look, I think this does show up sometimes and typically waiting and retrying should do the trick. I will see if I can do something about this
Yeah unfortunately for me it's 100% consistent and happens every time I am running a much older version on this project my other VM and this issue doesn't happen on that one, so not sure what the difference is.
I was able to do further testing. I tried wscat -c wss://sydney.bing.com/sydney/ChatHub
to see if the WebSocket responds and got
error: Unexpected server response: 200
This is happening on my DigitalOcean VM, when I was originally using Azure.
Is there anything that can be done to fix this?
Yeah unfortunately for me it's 100% consistent and happens every time I am running a much older version on this project my other VM and this issue doesn't happen on that one, so not sure what the difference is.
Hi @Mazawrath Which version are you using that does not have this issue? If that's the case, there's probably a regression
Latest version 0.20.1
could possibly fix this due to improvements in the API compatibility.
@vsakkas I still get the same error on AWS server. It's working fine on computer but not on my AWS server. I will try to use a VPN to see if it's not related to a blacklist of datacenter IPs.
Yeah unfortunately for me it's 100% consistent and happens every time I am running a much older version on this project my other VM and this issue doesn't happen on that one, so not sure what the difference is.
@Mazawrath Could you tell me which version of this lib is working on your VM ? Is it with or without cookies ? Because all my tests failed on datacenter.
I can also confirm going from DigitalOcean to Oracle Cloud didn't fix it either. Seems like Bing is blacklisting IPs from both of those services.
The only service I've actually managed to use that works is Azure.
I can also confirm going from DigitalOcean to Oracle Cloud didn't fix it either. Seems like Bing is blacklisting IPs from both of those services.
The only service I've actually managed to use that works is Azure.
I am not sure if it's related because even with residential proxy, I can't use the script on datacenter. Which version of the lib is working on Azure ?
It is working on Namecheap VPS @vsakkas @Mazawrath @IKDH I've noticed that my Digital Ocean droplet running Ubuntu 22 can't connect to Bing Chat, while my Namecheap VPS running the same OS can. It seems Bing might blacklist certain IP ranges.
To check if your server can connect to Bing Chat, use this command:
curl https://edgeservices.bing.com/edgesvc/turing/conversation/create?bundleVersion=1.1381.12
If you get a JSON response like:
{"conversationId":"_something_","clientId":"_something_","result":{"value":"Success","message":null}}
then your server is good to go for running sydney.py. This is a quick way to verify connectivity before proceeding with your setup. If the response is empty, it's possible that your server may not allow connecting to Bing Chat
Hope this helps!
So, I went down quite the rabbithole.
First of all, thank you for @haiht24 for confirming what I assumed was true, that yes, Bing is blocking Oracle Cloud. Now, I was able to get around this with a proxy. However, sydney.py uses websockets
, which does not support proxies.
I was able to get a proxy setup using websocket-client
, and was able to string together a successful solution, however it doesn't seem to be async and might have issues if it gets implemented here.
Worth looking into @vsakkas of maybe finding a way to support proxies for the actual websocket part, I didn't find the issue to be with aiohttp
, so that use_proxy
argument did not fix my issue.
Thank you @haiht24 @Mazawrath for the investigation!
I've been somewhat busy lately, so development has slowed down in the last couple of weeks, but this is definitely something that I'd like to tackle wherever I have the time for it.
I will look int some websocket alternatives or maybe even a way to add proxy support without replacing the current library. Will follow up once I have something ready!
I've been using sydney since a month, but then it started to require captcha consistently. Now I'm going through either one of these 4 errors every time I try to enable cookie or proxy or use sydney without them:
sydney.exceptions.CreateConversationException: Failed to create conversation, received status: 500
sydney.exceptions.ConnectionTimeoutException: Failed to connect to Copilot, connection timed out
sydney.exceptions.NoResponseException: No response was returned
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1729.0')
What I found has helped so far was only switching to a different machine and network.
I carefully followed recommendations to enable cookies but couldn't set them to work, any time I tried I got one of the above errors. I didn't get any "Verified" message, although I was logged in (tried "guest" as well) and talked through multiple conversations till they reached the quota. Adding optional cookie didn't make any difference: os.environ["BING_U_COOKIE"] = 'OPTIONAL'
Apologizes for the rather non-helpful error, I saw someone else had issues with this same error but I just can't seem to figure out what it is.
If I remove the
BING_COOKIES
, I get this error instead