WindmillWWindmill
Powered by
goodhawkG
Windmill•2y ago•
7 replies
goodhawk

Connection aborted with the large request body

with the large request body, it will happen the "Connection aborted"

def writeAiResultDoc(data):
    apiUrl = resource['LANGCHAIN_ERPNEXT_DEV_API_BASIS_URL']
    url = f"{apiUrl}/resource/ResearchFee Initial Evaluation"

    headers = {
        "Authorization": resource['LANGCHAIN_ERPNEXT_DEV_API_KEY']
    }

    # data['business_type'] = '精测'
    
    body = data
    print(url)
    print(headers)
    # return 0
    response = requests.post(url,json=body, headers=headers)
    
    if response.status_code == 200:
        # result = response.json()
        return 1
    else:
        error_msg = f"请求失败 - Header: { response.headers } 状态码: {response.status_code},原因: {response.text}"
        print(error_msg)  # 输出错误日志
        return 0
def writeAiResultDoc(data):
    apiUrl = resource['LANGCHAIN_ERPNEXT_DEV_API_BASIS_URL']
    url = f"{apiUrl}/resource/ResearchFee Initial Evaluation"

    headers = {
        "Authorization": resource['LANGCHAIN_ERPNEXT_DEV_API_KEY']
    }

    # data['business_type'] = '精测'
    
    body = data
    print(url)
    print(headers)
    # return 0
    response = requests.post(url,json=body, headers=headers)
    
    if response.status_code == 200:
        # result = response.json()
        return 1
    else:
        error_msg = f"请求失败 - Header: { response.headers } 状态码: {response.status_code},原因: {response.text}"
        print(error_msg)  # 输出错误日志
        return 0

ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  File "/tmp/windmill/wk-default-abe5b65c9b69-hy248/018e0dfe-a3eb-c72d-aca9-367bd8620e38/u/goodhawk/dazzling_script.py", line 153, in main
    r2 = writeAiResultDoc(data)
         ^^^^^^^^^^^^^^^^^^^^^^
ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  File "/tmp/windmill/wk-default-abe5b65c9b69-hy248/018e0dfe-a3eb-c72d-aca9-367bd8620e38/u/goodhawk/dazzling_script.py", line 153, in main
    r2 = writeAiResultDoc(data)
         ^^^^^^^^^^^^^^^^^^^^^^
WindmillJoin
3,362Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Accepting raw body
TylerTTyler / help
2y ago
Body of a preprocessor
LeandroLLeandro / help
11mo ago
Large SQL input field like in the native one
wdesertWwdesert / help
14mo ago
Need Help with Cursor and Windmill MCP Connection
Draculer_zionDDraculer_zion / help
7mo ago