Ich habe eine Fastapi -Funktion, die eine Datei empfängt, sie lokal speichert, sie entrichtet und das unberechtigte Bild an einen artifaktorischen Ort drückt. Aus irgendeinem Grund werden größere Dateien oder manchmal kleinere Dateien zeitlich festgelegt, während Sie mit einer 200 -Code> -Antwort hochladen. Ich habe alle Vorschläge wie nginx ohne Glück gefolgt.
Ich habe eine Fastapi -Funktion, die eine Datei empfängt, sie lokal speichert, sie entrichtet und das unberechtigte Bild an einen artifaktorischen Ort drückt. Aus irgendeinem Grund werden größere Dateien oder manchmal kleinere Dateien zeitlich festgelegt, während Sie mit einer 200 -Code> -Antwort hochladen. Ich habe alle Vorschläge wie nginx ohne Glück gefolgt. [code] @router.post("/upload_container") async def post_container(file: UploadFile = File(), new_container_image: str = Form(), new_tag: str = Form()): if file.content_type != "application/x-tar": raise HTTPException(status_code=400, detail="Can only accept tarred version of Docker file") file_path = str(str(uuid.uuid4()).split("-")[1]) + ".tar" async with aiofiles.open(file_path, "wb") as out_file: while content := await file.read(1024): # async read chunk await out_file.write(content) # async write chunk file_path = str(os.path.abspath(os.path.join(os.getcwd(), file_path))) command = "podman load --input {}".format(file_path) result = subprocess.run(split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) if result.returncode != 0: return {"filename": file.filename, "details": result.stderr, "Error": {" failed to unwrap"}} tagged_image = str(str(result.stdout).split("\n")[0]).split("Loaded image(s):")[1] if os.path.exists(file_path): os.remove(file_path) if tagandpull(tagged_image, new_container_image, new_tag) != True: return {"message": "Unable to push the image", "image_name": f"{file.filename}"} return { "filename": file.filename, "Details": { "new_url": "artifactorylocation.cloud.com/" + config_data.output["repos"]["local"]["deploy_repo"] + "/" + new_container_image, "new_tag": new_tag, }, } < /code> Hier ist meine nginx -Annotation: < /p> annotations: { 'kubernetes.io/ingress.class': 'nginx', 'nginx.ingress.kubernetes.io/proxy-body-size': '2400m', 'nginx.ingress.kubernetes.io/proxy-connect-timeout': '600', 'nginx.ingress.kubernetes.io/proxy-read-timeout': '600', 'nginx.ingress.kubernetes.io/proxy-send-timeout': '600' }, [/code] Hat jemand vor diesem [url=viewtopic.php?t=11587]Problem[/url] konfrontiert?
Ich verwende eine POST-Anfrage, um eine Datei über Postman in eine FastAPI-Anwendung hochzuladen und sie in meinem lokalen Verzeichnis zu speichern. Es wird jedoch der Fehler 422 (Unverarbeitbare...
Ich versuche, eine große GPKG-Datei mithilfe einer WPF-Anwendung an eine API zu senden, stoße jedoch auf die folgende Ausnahme:
Fehler beim Kopieren von Inhalten in einen Stream.
Was ich versucht...
Beim PHP-Upload eines Videos tritt derzeit ein Problem auf. Es wird eine Fehlermeldung zurückgegeben. Ich verwende Laravel PHP auf GKE und verwende nginx-ingress.
Ich habe die notwendigen Werte in...