FastAPI + Apache. Die 409-Antwort von FastAPI wird in 502 umgewandelt. Was kann der Grund sein?Python

Python-Programme
Guest
 FastAPI + Apache. Die 409-Antwort von FastAPI wird in 502 umgewandelt. Was kann der Grund sein?

Post by Guest »

Ich habe eine FastAPI-Anwendung, die im Allgemeinen gut funktioniert. Mein Setup ist Apache als Proxy und ein FastAPI-Server dahinter. Dies ist die Apache-Konfiguration:

Code: Select all

ProxyPass /fs http://127.0.0.1:8000/fs retry=1 acquire=3000 timeout=600 Keepalive=On disablereuse=ON
ProxyPassReverse /fs http://127.0.0.1:8000/fs
Ich habe einen Endpunkt, der 409 HTTP-Antwort zurückgeben kann, wenn ein Objekt vorhanden ist. FastAPI funktioniert ordnungsgemäß. Ich kann in den Protokollen sehen:

Code: Select all

INFO:     172.**.0.25:0 - "PUT /fs/Automation/123.txt HTTP/1.1" 409 Conflict
Aber die endgültige Antwort an den Client lautet „502 Bad Gateway“.
Das Apache-Fehlerprotokoll enthält einen Eintrag dafür:

Code: Select all

[Tue Dec 31 04:45:54.545972 2024] [proxy:error] [pid 3019178:tid 140121168807680] (32)Broken pipe: [client 172.31.0.25:63759] AH01084: pass request body failed to 127.0.0.1:8000 (127.0.0.1), referer: https://10.100.21.13/fs/view/Automation
[Tue Dec 31 04:45:54.545996 2024] [proxy_http:error] [pid 3019178:tid 140121168807680] [client 172.31.0.25:63759] AH01097: pass request body failed to 127.0.0.1:8000 (127.0.0.1) from 172.31.0.25 (), referer: https://10.100.21.13/fs/view/Automation
Was kann der Grund sein?
Eine weitere interessante Sache ist, dass dies bei keiner PUT-Anfrage der Fall ist.
Wie kann ich das debuggen? Vielleicht muss FastAPI etwas anderes zurückgeben, einen Header? Oder gibt es zu viel zurück, einige zusätzliche Daten? Wie fängt man das an?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post