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

SSR does not work with auth enabled #10204

Open
1 task done
laoshancun opened this issue Dec 16, 2024 · 0 comments
Open
1 task done

SSR does not work with auth enabled #10204

laoshancun opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working SSR Related to server-side rendering

Comments

@laoshancun
Copy link

Describe the bug

Failed to start while auth and ssr on

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

        import gradio as gr

        def greet(name):
            return f"Hello, {name}!"

        # Define the username and password for authentication
        auth = ('username', 'password')

        # Create the Gradio interface
        iface = gr.Interface(fn=greet, inputs="text", outputs="text")

        # Launch the interface with SSR enabled
        iface.launch(server_name="0.0.0.0", ssr_mode=True, auth=auth)

Screenshot

No response

Logs

Error: Error: Login credentials are required to access this space.
    at Client._resolve_config (file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-9Q2E4iJ-.js:39575:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.init (file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-9Q2E4iJ-.js:39491:5)
    at async Client.connect (file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-9Q2E4iJ-.js:39530:5)
    at async load$1 (file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/chunks/2-9Q2E4iJ-.js:41454:15)
    at async load_data (file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/index.js:1178:18)
    at async file:///project/.venv/lib/python3.10/site-packages/gradio/templates/node/build/server/index.js:2618:18

>           raise ValueError(
                "When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost."
            )
E           ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.

System Info

❯ gradio environment
Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 5.8.0
gradio_client version: 1.5.1

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

aiofiles: 23.2.1
anyio: 4.7.0
audioop-lts is not installed.
fastapi: 0.115.6
ffmpy: 0.4.0
gradio-client==1.5.1 is not installed.
httpx: 0.28.1
huggingface-hub: 0.26.5
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.2.0
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.9.2
pydub: 0.25.1
python-multipart: 0.0.19
pyyaml: 6.0.2
ruff: 0.8.3
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.38.6
tomlkit: 0.12.0
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.32.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.28.1
huggingface-hub: 0.26.5
packaging: 24.2
typing-extensions: 4.12.2
websockets: 14.1

Severity

Blocking usage of gradio

@laoshancun laoshancun added the bug Something isn't working label Dec 16, 2024
@abidlabs abidlabs changed the title Failed to start while auth and ssr on SSR does not work with auth enabled Dec 16, 2024
@abidlabs abidlabs mentioned this issue Dec 16, 2024
11 tasks
@abidlabs abidlabs added the SSR Related to server-side rendering label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SSR Related to server-side rendering
Projects
None yet
Development

No branches or pull requests

2 participants