Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
IdleIdiot opened this issue Jul 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@IdleIdiot
Copy link

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? 🔎

  • I have searched and found no 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 IdleIdiot added the bug Something isn't working label Jul 2, 2024
@IdleIdiot
Copy link
Author

Network packet capture
d04da784f779fd0e6be48ecab51f749

@pcasagranda
Copy link

pcasagranda commented Jul 8, 2024

Same problem. Using HTTPS with gradio we can download a file we generate for a few seconds. Then we have "Please check your network connection" in the browser.
gradio -> 4.37.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants