Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectError: [Errno 99] Cannot assign requested address #8

Open
cn-vhql opened this issue Aug 25, 2023 · 2 comments
Open

ConnectError: [Errno 99] Cannot assign requested address #8

cn-vhql opened this issue Aug 25, 2023 · 2 comments
Labels
question Further information is requested

Comments

@cn-vhql
Copy link

cn-vhql commented Aug 25, 2023

ConnectError: [Errno 99] Cannot assign requested address

@snowby666
Copy link
Owner

Can you specify the error logs here so it would be better to debug

@snowby666 snowby666 added the question Further information is requested label Sep 18, 2023
@bxrjmfh
Copy link

bxrjmfh commented Mar 5, 2024

您可以在此处指定错误日志,以便更好地调试

{
"name": "ConnectError",
"message": "[Errno 99] Cannot assign requested address",
"stack": "---------------------------------------------------------------------------
OSError Traceback (most recent call last)
File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_exceptions.py:10, in map_exceptions(map)
9 try:
---> 10 yield
11 except Exception as exc: # noqa: PIE786

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_backends/sync.py:206, in SyncBackend.connect_tcp(self, host, port, timeout, local_address, socket_options)
205 with map_exceptions(exc_map):
--> 206 sock = socket.create_connection(
207 address,
208 timeout,
209 source_address=source_address,
210 )
211 for option in socket_options:

File ~/miniconda3/envs/duet/lib/python3.8/socket.py:808, in create_connection(address, timeout, source_address)
807 try:
--> 808 raise err
809 finally:
810 # Break explicitly a reference cycle

File ~/miniconda3/envs/duet/lib/python3.8/socket.py:796, in create_connection(address, timeout, source_address)
795 sock.bind(source_address)
--> 796 sock.connect(sa)
797 # Break explicitly a reference cycle

OSError: [Errno 99] Cannot assign requested address

The above exception was the direct cause of the following exception:

ConnectError Traceback (most recent call last)
File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_transports/default.py:67, in map_httpcore_exceptions()
66 try:
---> 67 yield
68 except Exception as exc:

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_transports/default.py:231, in HTTPTransport.handle_request(self, request)
230 with map_httpcore_exceptions():
--> 231 resp = self._pool.handle_request(req)
233 assert isinstance(resp.stream, typing.Iterable)

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py:268, in ConnectionPool.handle_request(self, request)
267 self.response_closed(status)
--> 268 raise exc
269 else:

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py:251, in ConnectionPool.handle_request(self, request)
250 try:
--> 251 response = connection.handle_request(request)
252 except ConnectionNotAvailable:
253 # The ConnectionNotAvailable exception is a special case, that
254 # indicates we need to retry the request on a new connection.
(...)
258 # might end up as an HTTP/2 connection, but which actually ends
259 # up as HTTP/1.1.

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_sync/connection.py:99, in HTTPConnection.handle_request(self, request)
98 self._connect_failed = True
---> 99 raise exc
100 elif not self._connection.is_available():

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_sync/connection.py:76, in HTTPConnection.handle_request(self, request)
75 try:
---> 76 stream = self._connect(request)
78 ssl_object = stream.get_extra_info("ssl_object")

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_sync/connection.py:124, in HTTPConnection._connect(self, request)
123 with Trace("connect_tcp", logger, request, kwargs) as trace:
--> 124 stream = self._network_backend.connect_tcp(**kwargs)
125 trace.return_value = stream

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_backends/sync.py:213, in SyncBackend.connect_tcp(self, host, port, timeout, local_address, socket_options)
212 sock.setsockopt(*option) # pragma: no cover
--> 213 sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
214 return SyncStream(sock)

File ~/miniconda3/envs/duet/lib/python3.8/contextlib.py:131, in _GeneratorContextManager.exit(self, type, value, traceback)
130 try:
--> 131 self.gen.throw(type, value, traceback)
132 except StopIteration as exc:
133 # Suppress StopIteration unless it's the same exception that
134 # was passed to throw(). This prevents a StopIteration
135 # raised inside the "with" statement from being suppressed.

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpcore/_exceptions.py:14, in map_exceptions(map)
13 if isinstance(exc, from_exc):
---> 14 raise to_exc(exc) from exc
15 raise

ConnectError: [Errno 99] Cannot assign requested address

The above exception was the direct cause of the following exception:

ConnectError Traceback (most recent call last)
/root/VLN_2023/MiC/llama_path_choice/poe_api/poe_think_gen.ipynb 单元格 2 line 2
1 from poe_api_wrapper import PoeApi
----> 2 client = PoeApi('DEZ5C54qmM2ZecBMEt5Ixg%3D%3D',proxy=True)

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/poe_api_wrapper/api.py:157, in PoeApi.init(self, cookie, proxy)
154 self.client = Client(headers=self.HEADERS, timeout=180)
155 self.client.cookies.update({'m-b': self.cookie})
--> 157 self.get_channel_settings()
159 self.ws_connecting = False
160 self.ws_connected = False

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/poe_api_wrapper/api.py:207, in PoeApi.get_channel_settings(self)
206 def get_channel_settings(self):
--> 207 response_json = self.client.get(f'{self.BASE_URL}/poe_api/settings', headers=self.HEADERS, follow_redirects=True).json()
208 self.ws_domain = f"tch{random.randint(1, int(1e6))}"[:11]
209 self.formkey = response_json["formkey"]

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:1055, in Client.get(self, url, params, headers, cookies, auth, follow_redirects, timeout, extensions)
1038 def get(
1039 self,
1040 url: URLTypes,
(...)
1048 extensions: typing.Optional[RequestExtensions] = None,
1049 ) -> Response:
1050 """
1051 Send a GET request.
1052
1053 Parameters: See httpx.request.
1054 """
-> 1055 return self.request(
1056 "GET",
1057 url,
1058 params=params,
1059 headers=headers,
1060 cookies=cookies,
1061 auth=auth,
1062 follow_redirects=follow_redirects,
1063 timeout=timeout,
1064 extensions=extensions,
1065 )

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:828, in Client.request(self, method, url, content, data, files, json, params, headers, cookies, auth, follow_redirects, timeout, extensions)
813 warnings.warn(message, DeprecationWarning)
815 request = self.build_request(
816 method=method,
817 url=url,
(...)
826 extensions=extensions,
827 )
--> 828 return self.send(request, auth=auth, follow_redirects=follow_redirects)

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:915, in Client.send(self, request, stream, auth, follow_redirects)
907 follow_redirects = (
908 self.follow_redirects
909 if isinstance(follow_redirects, UseClientDefault)
910 else follow_redirects
911 )
913 auth = self._build_request_auth(request, auth)
--> 915 response = self._send_handling_auth(
916 request,
917 auth=auth,
918 follow_redirects=follow_redirects,
919 history=[],
920 )
921 try:
922 if not stream:

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:943, in Client._send_handling_auth(self, request, auth, follow_redirects, history)
940 request = next(auth_flow)
942 while True:
--> 943 response = self._send_handling_redirects(
944 request,
945 follow_redirects=follow_redirects,
946 history=history,
947 )
948 try:
949 try:

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:980, in Client._send_handling_redirects(self, request, follow_redirects, history)
977 for hook in self._event_hooks["request"]:
978 hook(request)
--> 980 response = self._send_single_request(request)
981 try:
982 for hook in self._event_hooks["response"]:

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_client.py:1016, in Client._send_single_request(self, request)
1011 raise RuntimeError(
1012 "Attempted to send an async request with a sync Client instance."
1013 )
1015 with request_context(request=request):
-> 1016 response = transport.handle_request(request)
1018 assert isinstance(response.stream, SyncByteStream)
1020 response.request = request

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_transports/default.py:231, in HTTPTransport.handle_request(self, request)
218 req = httpcore.Request(
219 method=request.method,
220 url=httpcore.URL(
(...)
228 extensions=request.extensions,
229 )
230 with map_httpcore_exceptions():
--> 231 resp = self._pool.handle_request(req)
233 assert isinstance(resp.stream, typing.Iterable)
235 return Response(
236 status_code=resp.status,
237 headers=resp.headers,
238 stream=ResponseStream(resp.stream),
239 extensions=resp.extensions,
240 )

File ~/miniconda3/envs/duet/lib/python3.8/contextlib.py:131, in _GeneratorContextManager.exit(self, type, value, traceback)
129 value = type()
130 try:
--> 131 self.gen.throw(type, value, traceback)
132 except StopIteration as exc:
133 # Suppress StopIteration unless it's the same exception that
134 # was passed to throw(). This prevents a StopIteration
135 # raised inside the "with" statement from being suppressed.
136 return exc is not value

File ~/miniconda3/envs/duet/lib/python3.8/site-packages/httpx/_transports/default.py:84, in map_httpcore_exceptions()
81 raise
83 message = str(exc)
---> 84 raise mapped_exc(message) from exc

ConnectError: [Errno 99] Cannot assign requested address"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants