acheong08 / EdgeGPT

Reverse engineered API of Microsoft's Bing Chat AI
The Unlicense
8.09k stars 912 forks source link

[Bug]: #392

Closed SergeyHat closed 1 year ago

SergeyHat commented 1 year ago

Is there an existing issue for this?

What happened?

When trying to use the Tor proxy, an error occurs. Traceback (most recent call last): File “C:\Users\Sergey\PY\Lib\site-packages\socks.py”, line 809, in connect negotiate(self, dest_addr, dest_port) File “C:\Users\Sergey\PY\Lib\site-packages\socks.py”, line 443, in _negotiate_SOCKS5 self.proxy_peername, self.proxy_sockname = self._SOCKS5_request( ^^^^^^^^^^^^^^^^^^^^^ File “C:\Users\Sergey\PY\Lib\site-packages\socks.py”, line 533, in _SOCKS5_request raise SOCKS5Error(”{:#04x}: {}“.format(status, error)) socks.SOCKS5Error: 0x01: General SOCKS server failure. All I found is that Tor does not support direct IP addresses.

Steps to reproduce the problem

Run Tor through stem by specifying in the config file (or as I did, passed directly "config={ 'SocksPort': str(9050), 'ControlPort': str(9051), 'UseBridges': '1', 'Bridge': first_unblocked_bridge, 'Log': ['NOTICE stdout'], 'AvoidDiskWrites': '1', 'CookieAuthentication': '1', 'DormantCanceledByStartup': '1',

Use the current working directory for obfs4proxy.exe and snowflake-client.exe files

        'ClientTransportPlugin': [f'meek_lite,obfs2,obfs3,obfs4,scramblesuit exec {os.path.join(os.getcwd(), "obfs4proxy.exe")}', f'snowflake exec {os.path.join(os.getcwd(), "snowflake-client.exe")}']
    },) ") 

After trying to connect proxy = 'SOCKS5://localhost:9050' bot = await Chatbot.create(cookies=cookies, proxy=proxy)"

What should have happened?

Running edgeGPT through TOR.

Version where the problem happens

version="0.3.7

What Python version are you running this with?

No response

What is your operating system ?

Windows

Command Line Arguments

no

Console logs

May 10 03:48:31.000 [notice] Bootstrapped 0% (starting): Starting
May 10 03:48:35.000 [notice] Bootstrapped 1% (conn_pt): Connecting to pluggable transport
May 10 03:48:35.000 [notice] Bootstrapped 2% (conn_done_pt): Connected to pluggable transport
May 10 03:48:36.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
May 10 03:48:36.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
May 10 03:48:36.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
May 10 03:48:36.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
May 10 03:48:36.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
May 10 03:48:38.000 [notice] Bootstrapped 100% (done): Done
NOTICE BOOTSTRAP PROGRESS=100 TAG=done SUMMARY="Done"
deley 2 sec
Traceback (most recent call last):
  File "C:\Users\Sergey\PY\Lib\site-packages\socks.py", line 809, in connect
    negotiate(self, dest_addr, dest_port)
  File "C:\Users\Sergey\PY\Lib\site-packages\socks.py", line 443, in _negotiate_SOCKS5
    self.proxy_peername, self.proxy_sockname = self._SOCKS5_request(
                                               ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\site-packages\socks.py", line 533, in _SOCKS5_request
    raise SOCKS5Error("{:#04x}: {}".format(status, error))
socks.SOCKS5Error: 0x01: General SOCKS server failure

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sergey\Desktop\assistent\start3_0.py", line 138, in <module>
    asyncio.run(main())  # Запускаем асинхронную функцию main с помощью функции run из библиотеки asyncio
    ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\asyncio\runners.py", line 189, in run
    with Runner(debug=debug) as runner:
  File "C:\Users\Sergey\PY\Lib\asyncio\runners.py", line 59, in __enter__
    self._lazy_init()
  File "C:\Users\Sergey\PY\Lib\asyncio\runners.py", line 137, in _lazy_init
    self._loop = events.new_event_loop()
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\asyncio\events.py", line 806, in new_event_loop
    return get_event_loop_policy().new_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\asyncio\events.py", line 695, in new_event_loop
    return self._loop_factory()
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\asyncio\windows_events.py", line 315, in __init__
    super().__init__(proactor)
  File "C:\Users\Sergey\PY\Lib\asyncio\proactor_events.py", line 639, in __init__
    self._make_self_pipe()
  File "C:\Users\Sergey\PY\Lib\asyncio\proactor_events.py", line 784, in _make_self_pipe
    self._ssock, self._csock = socket.socketpair()
                               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\socket.py", line 641, in socketpair
    csock.connect((addr, port))
  File "C:\Users\Sergey\PY\Lib\site-packages\socks.py", line 47, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sergey\PY\Lib\site-packages\socks.py", line 814, in connect
    raise GeneralProxyError("Socket error", error)
socks.GeneralProxyError: Socket error: 0x01: General SOCKS server failure
sys:1: RuntimeWarning: coroutine 'main' was never awaited
Exception ignored in: <function BaseEventLoop.__del__ at 0x0000024DB7BEC360>
Traceback (most recent call last):
  File "C:\Users\Sergey\PY\Lib\asyncio\base_events.py", line 694, in __del__
  File "C:\Users\Sergey\PY\Lib\asyncio\proactor_events.py", line 696, in close
  File "C:\Users\Sergey\PY\Lib\asyncio\proactor_events.py", line 776, in _close_self_pipe
AttributeError: 'ProactorEventLoop' object has no attribute '_ssock'

Additional information

No response

github-actions[bot] commented 1 year ago

Automated: 👋 Thanks for reporting this issue. @acheong08 will review it shortly. In the meantime, please check to see if there are any similar issues already closed.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 2 days with no activity.

judgementc commented 1 year ago

I met the same question

acheong08 commented 1 year ago

Looks like a proxy issue.

socks.SOCKS5Error: 0x01: General SOCKS server failure

Out of scope