gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.77k stars 2.29k forks source link

If you turn on https to download the file, it will show Please check your network connection #8681

Open IdleIdiot opened 5 days ago

IdleIdiot commented 5 days ago

Describe the bug

trun on https,and code click button return gr.components.File,then wait about 5s, click download link,browser show the download error.

Have you searched existing issues? 🔎

Reproduction

root@ai-ubuntu:~# touch /tmp/debug_file_in_server
root@ai-ubuntu:~# 
import json

import gradio as gr

def debug():
    return "/tmp/debug_file_in_server"

def setup_resource_chart():
    with gr.Blocks() as app:

        show_button = gr.Button("history")

        file_exporter = gr.components.File(label="download")

        show_button.click(
            fn=debug,
            inputs=[],
            outputs=[
                file_exporter,
            ],
        )

    return app

if __name__ == "__main__":
    with open("settings.json") as f:
        settings = json.loads(f.read())
    app = setup_resource_chart()
    app.launch(
        share=True,
        inbrowser=False,
        server_name="0.0.0.0",
        server_port=9528,
        show_api=False,
        ssl_keyfile=settings["pages"]["ssl"]["key"],
        ssl_certfile=settings["pages"]["ssl"]["pem"],
        ssl_verify=False,
    )

Screenshot

image

image

Logs

No response

System Info

(llm-experience) root@ai-ubuntu:/data/wanghui01/llm-experience/inference/frontend# gradio environment
Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.29.0
gradio_client version: 0.16.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.2.0
fastapi: 0.110.0
ffmpy: 0.3.2
gradio-client==0.16.1 is not installed.
httpx: 0.27.0
huggingface-hub: 0.22.0
importlib-resources: 6.4.0
jinja2: 3.1.3
markupsafe: 2.1.5
matplotlib: 3.8.3
numpy: 1.26.4
orjson: 3.9.15
packaging: 23.2
pandas: 1.5.3
pillow: 10.2.0
pydantic: 2.6.4
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.3.4
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.10.0
urllib3: 2.2.1
uvicorn: 0.29.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.3.1
httpx: 0.27.0
huggingface-hub: 0.22.0
packaging: 23.2
typing-extensions: 4.10.0
websockets: 11.0.3

Severity

I can work around it

IdleIdiot commented 5 days ago

Network packet capture

d04da784f779fd0e6be48ecab51f749