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
32.53k stars 2.45k forks source link

No public link on Sagemaker #5655

Open Serallan opened 1 year ago

Serallan commented 1 year ago

Describe the bug

I can't get Gradio to create public links on Amazon Sagemaker, it just hangs at "Running on local URL". Tried various versions using the example from the Quickstart, the newest being 3.44.3.

Here's the full traceback from when I interrupt it:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <cell line: 8>:8                                                                              │
│                                                                                                  │
│   5                                                                                              │
│   6 demo = gr.Interface(fn=greet, inputs="text", outputs="text")                                 │
│   7                                                                                              │
│ ❱ 8 demo.launch(share=True)                                                                      │
│   9                                                                                              │
│                                                                                                  │
│ /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/gradio/blocks.py:1479 in   │
│ launch                                                                                           │
│                                                                                                  │
│   1476 │   │   │   "analytics_enabled": self.analytics_enabled,                                  │
│   1477 │   │   │   "components": [],                                                             │
│   1478 │   │   │   "css": self.css,                                                              │
│ ❱ 1479 │   │   │   "title": self.title or "Gradio",                                              │
│   1480 │   │   │   "space_id": self.space_id,                                                    │
│   1481 │   │   │   "enable_queue": getattr(self, "enable_queue", False),  # launch attributes    │
│   1482 │   │   │   "show_error": getattr(self, "show_error", False),                             │
│                                                                                                  │
│ /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/gradio/networking.py:168   │
│ in setup_tunnel                                                                                  │
│                                                                                                  │
│   165 │   for port in server_ports:                                                              │
│   166 │   │   try:                                                                               │
│   167 │   │   │   # The fastest way to check if a port is available is to try to bind to it wi   │
│ ❱ 168 │   │   │   # If the port is not available, socket will throw an OSError.                  │
│   169 │   │   │   s = socket.socket()                                                            │
│   170 │   │   │   s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)                        │
│   171 │   │   │   # Really, we should be checking if (server_name, server_port) is available,    │
│                                                                                                  │
│ /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/gradio/tunneling.py:61 in  │
│ start_tunnel                                                                                     │
│                                                                                                  │
│    58 │   │   self.download_binary()                                                             │
│    59 │   │   self.url = self._start_tunnel(BINARY_PATH)                                         │
│    60 │   │   return self.url                                                                    │
│ ❱  61 │                                                                                          │
│    62 │   def kill(self):                                                                        │
│    63 │   │   if self.proc is not None:                                                          │
│    64 │   │   │   print(f"Killing tunnel {self.local_host}:{self.local_port} <> {self.url}")     │
│                                                                                                  │
│ /home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/gradio/tunneling.py:97 in  │
│ _start_tunnel                                                                                    │
│                                                                                                  │
│    94 │   │   │   │   continue                                                                   │
│    95 │   │   │   line = self.proc.stdout.readline()                                             │
│    96 │   │   │   line = line.decode("utf-8")                                                    │
│ ❱  97 │   │   │   if "start proxy success" in line:                                              │
│    98 │   │   │   │   result = re.search("start proxy success: (.+)\n", line)                    │
│    99 │   │   │   │   if result is None:                                                         │
│   100 │   │   │   │   │   raise ValueError("Could not create share URL")                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyboardInterrupt

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

def greet(name):
    return "Hello " + name + "!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")

demo.launch(share=True, debug=True)

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 3.44.3
gradio_client version: 0.5.0

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

aiofiles: 23.2.1
altair: 5.1.1
fastapi: 0.103.1
ffmpy: 0.3.1
gradio-client==0.5.0 is not installed.
httpx: 0.25.0
huggingface-hub: 0.17.2
importlib-resources: 6.1.0
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.8.0
numpy: 1.26.0
orjson: 3.9.7
packaging: 23.1
pandas: 2.1.1
pillow: 10.0.1
pydantic: 2.3.0
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
requests: 2.31.0
semantic-version: 2.10.0
typing-extensions: 4.8.0
uvicorn: 0.23.2
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.9.1
httpx: 0.25.0
huggingface-hub: 0.17.2
packaging: 23.1
requests: 2.31.0
typing-extensions: 4.8.0
websockets: 11.0.3

Severity

Blocking usage of gradio

Maverick1983 commented 11 months ago

I have same problem. In addition with debug=True I have this error:

Running on local URL:  http://127.0.0.1:6006/
2023/10/20 12:29:54 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app/.
txy6666yr commented 10 months ago

I have same problem. In addition with debug=True I have this error:

Running on local URL:  http://127.0.0.1:6006/
2023/10/20 12:29:54 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app/.

The same! Sir, are u solve it?


Running on local URL:  http://127.0.0.1:7860
2023/11/16 15:01:09 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout

Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.