Localhost unavailable: WSA error
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi từ main.py với giá trị FIRESTORE_EMULATOR_HOST được hiển thị và các phiên bản Python, Windows và emulator được liệt kê. Đọc traceback qua google.api_core và grpc, sau đó so sánh cách client Python xử lý kết nối emulator với cấu hình cloud đang hoạt động. Hoàn tất khi xác định được nguyên nhân có thể tái hiện thuộc SDK hoặc môi trường và thêm một regression test tập trung hoặc hướng dẫn cấu hình được hỗ trợ rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[REQUIRED] Step 2: Describe your environment
- Operating System version: Windows 10
- Firebase SDK version: 12.4.2
- Firebase Product: firestore (auth, database, storage, etc)
- Python version: 3.10.13
- Pip version: 23.2.1
[REQUIRED] Step 3: Describe the problem
I'm dealing with a Python+Emulator problem. My emulator works in Flutter, but not in Python, and it works in Python on Cloud Firestore. It's only the Python+Emulator combo that is giving me trouble.
It was working earlier today, but so far my backtracking attempts have been unsuccessful.
I've tried restarting my machine, and the emulator, but neither have worked so far.
Steps to reproduce:
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
Traceback (most recent call last):
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\grpc_helpers.py", line 162, in error_remapped_callable
return _StreamingResponseIterator(
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\grpc_helpers.py", line 88, in __init__
self._stored_first_result = next(self._wrapped)
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\grpc\_channel.py", line 541, in __next__
return self._next()
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\grpc\_channel.py", line 967, in _next
raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "DNS resolution failed for http://localhost:8080: UNAVAILABLE: WSA Error"
debug_error_string = "UNKNOWN:DNS resolution failed for http://localhost:8080: UNAVAILABLE: WSA Error {created_time:"2023-10-07T20:33:00.4853876+00:00", grpc_status:14}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\retry.py", line 191, in retry_target
return target()
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\timeout.py", line 120, in func_with_timeout
return func(*args, **kwargs)
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\grpc_helpers.py", line 166, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.ServiceUnavailable: 503 DNS resolution failed for http://localhost:8080: UNAVAILABLE: WSA Error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "d:\Projects\info_extractor\main.py", line 66, in <module>
print(doc_ref.get())
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\cloud\firestore_v1\query.py", line 172, in get
return list(result)
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\cloud\firestore_v1\query.py", line 287, in stream
response_iterator, expected_prefix = self._get_stream_iterator(
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\cloud\firestore_v1\query.py", line 221, in _get_stream_iterator
response_iterator = self._client._firestore_api.run_query(
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\cloud\firestore_v1\services\firestore\client.py", line
1309, in run_query
response = rpc(
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\gapic_v1\method.py", line 113, in __call__
return wrapped_func(*args, **kwargs)
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\retry.py", line 349, in retry_wrapped_func
return retry_target(
File "D:\Programs\anaconda3\envs\info_extractor\lib\site-packages\google\api_core\retry.py", line 207, in retry_target
raise exceptions.RetryError(
google.api_core.exceptions.RetryError: Deadline of 300.0s exceeded while calling target function, last exception: 503 DNS resolution failed for http://localhost:8080: UNAVAILABLE: WSA Error
Also, this comes out of one of the emulator processes (unsure which):
Oct 07, 2023 8:54:35 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
Relevant Code:
My .env:
FIRESTORE_EMULATOR_HOST=http://localhost:8080
STORAGE_EMULATOR_HOST=http://localhost:9199
When I remove http:// from the variables, I get instead that no connection adapters are available.
import firebase_admin
def initialize_firestore():
app = firebase_admin.initialize_app()
db = firestore.client()
return app, db
if __name__ == "__main__":
callback_done = threading.Event()
app, db =initialize_firestore()
doc_ref = db.collection('files').where(
filter=FieldFilter('extractedText', '==', ''))
print(doc_ref.get())
print('Statement complete')
Code hangs on the second-to-last statement. It works fine on Google Cloud, it's only on emulator that it doesn't work, which is why I'm posting here.
- Ngôn ngữ chính
- Python
- Star
- 1.2k
- Fork
- 359
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-admin-python
-
api: remoteconfig
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
firebase/firebase-admin-python#957 · 1 bình luận ·
-
api: database type: feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
firebase/firebase-admin-python#978 · 1 bình luận ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Đang mởapi: auth
firebase/firebase-admin-python#949 · 2 bình luận · 1 reaction · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
firebase/firebase-admin-python#945 · 1 bình luận · 1 reaction ·
Tất cả issue của firebase/firebase-admin-python
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·