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

Share link issues #3677

Open
1 task done
Ju1-js opened this issue Mar 28, 2023 · 29 comments · Fixed by #5731
Open
1 task done

Share link issues #3677

Ju1-js opened this issue Mar 28, 2023 · 29 comments · Fixed by #5731
Labels
bug Something isn't working

Comments

@Ju1-js
Copy link

Ju1-js commented Mar 28, 2023

Describe the bug

There was an issue for this before, but even the test code that worked for them doesn't work for me.
The code works for me on Gradio 1.18.0, but the moment I upgrade past it ex. 1.19.x+. The share link breaks.

Is there an existing issue for this?

  • I have searched the 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)

Logs

py --version
Python 3.11.1
py -m pip list
Package            Version
------------------ ---------
...
gradio             3.23.0
...

System Info

Gradio version: 3.23.0
Os: Windows 10 21H2 (OS Build 19044.2604)
Browser: Brave - Chromium

Severity

Blocking upgrade to latest gradio version

@Ju1-js Ju1-js added the bug Something isn't working label Mar 28, 2023
@Chris-pap
Copy link

Chris-pap commented Mar 29, 2023

I have the same problem with VSCode.
I tried yesterday a couple of times and the same today.

ddd

I have the latest version of vscode (1.76.2) and from Gradio (3.23.0)
Python (3.10.7)

@abidlabs abidlabs changed the title Could not create share link. Please check your internet connection or our status page: https://status.gradio.app Share link issues Mar 29, 2023
@abidlabs
Copy link
Member

Taking a look! @Chris-pap what OS are you running?

@abidlabs
Copy link
Member

I'm also going to pin this issue. If anyone else is experiencing share link issues, please chime into this issue

@abidlabs abidlabs pinned this issue Mar 29, 2023
@Chris-pap
Copy link

Chris-pap commented Mar 29, 2023

Taking a look! @Chris-pap what OS are you running?

Windows 11 Home , 22H2, 22621.1413

@abidlabs
Copy link
Member

Do you guys have an antivirus that's running? It looks like Windows Defender sometimes blocks the share link binary file from running. See #3230

@Chris-pap
Copy link

Do you guys have an antivirus that's running? It looks like Windows Defender sometimes blocks the share link binary file from running. See #3230

I have windows defender and Malwarebytes, i deactivate both of them but it didn't fix the problem.

@Ju1-js
Copy link
Author

Ju1-js commented Mar 30, 2023

image
That was the issue for me! Thanks!
@Chris-pap Check protection history, it may have already been quarantined so that when defender or Malwarebytes was deactivated, it wouldn't change anything.

@Chris-pap
Copy link

@Chris-pap Check protection history, it may have already been quarantined so that when defender or Malwarebytes was deactivated, it wouldn't change anything.

I am keep having the same problem. (blocked apps are not from gradio)
Screenshot_1

@abidlabs
Copy link
Member

Thanks @Ju1-js for letting us know. @Chris-pap, sorry this didn't solve it for you, I'll let you know if we can think of anything else that may be going on.

@erbill
Copy link

erbill commented Apr 1, 2023

Ok I've found solution for my problem on this link as Abidlabs shared
https://www.makeuseof.com/how-to-whitelist-files-windows-defender/

I've whitelisted entire Folder instead of just the app.py which worked for me

@Ju1-js
Copy link
Author

Ju1-js commented Apr 11, 2023

Most problems seem resolved.

@renatz
Copy link

renatz commented Jun 20, 2023

@Chris-pap Check protection history, it may have already been quarantined so that when defender or Malwarebytes was deactivated, it wouldn't change anything.

I am keep having the same problem. (blocked apps are not from gradio) Screenshot_1

maybe you run the code in a server with the proxy? I closed the agents and the problem is solved.

@jamiechoi1995
Copy link

I met the same problem on Ubuntu, any solution?

@Kefan-pauline
Copy link

I also encountered this issue in a remote notebook that is different from colab, kaggle, sagemaker etc.

share = True outputs only Running on local URL: http://127.0.0.1:7860/, the share link is not created, and the kernel keeps busy.

More details see: #2918 (comment)

@logiczr
Copy link

logiczr commented Aug 13, 2023

I met the same problem on Ubuntu, any solution?

I met the same problem on ubuntu2204,have you solved this problem?

@C4l1b3r
Copy link

C4l1b3r commented Sep 8, 2023

With sd I edited the bat file added --share --gradio-auth someUsername:somePassword and it works just fine

@cansik
Copy link
Contributor

cansik commented Sep 25, 2023

@abidlabs It seems that the tunneling.py code is not written to cover any error that happens with the underlaying binary. The while loop never exits and sometimes even misses errors. For example on my system (Windows 11), the line printed by frpc reads:

2023/09/25 22:10:51 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout

And now gradio will just wait forever for a line that reads start proxy success: (.+)\n. But all the lines that are sent by frpc are just \n and not None.

while url == "":
    if self.proc.stdout is None:
        continue
    line = self.proc.stdout.readline()
    line = line.decode("utf-8")
    if "start proxy success" in line:
        result = re.search("start proxy success: (.+)\n", line)
        if result is None:
            raise ValueError("Could not create share URL")
        else:
            url = result.group(1)
return url

In my opinion this code should have a limit of messages to check before exiting gracefully and raising a proper exception with all the lines logged to the error stream.

@abidlabs
Copy link
Member

Thanks @cansik I believe you are correct. Would you like to open a PR in which any errors are outputted to the user?

@sylee96
Copy link

sylee96 commented Sep 26, 2023

@abidlabs It seems that the tunneling.py code is not written to cover any error that happens with the underlaying binary. The while loop never exits and sometimes even misses errors. For example on my system (Windows 11), the line printed by frpc reads:

2023/09/25 22:10:51 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout

And now gradio will just wait forever for a line that reads start proxy success: (.+)\n. But all the lines that are sent by frpc are just \n and not None.

while url == "":
    if self.proc.stdout is None:
        continue
    line = self.proc.stdout.readline()
    line = line.decode("utf-8")
    if "start proxy success" in line:
        result = re.search("start proxy success: (.+)\n", line)
        if result is None:
            raise ValueError("Could not create share URL")
        else:
            url = result.group(1)
return url

In my opinion this code should have a limit of messages to check before exiting gracefully and raising a proper exception with all the lines logged to the error stream.

I also found out that this was a problem while debugging. The while loop never exits.
I used to get a public ip and share the link as a temporary measure like this.


#while url == "":
        #    if self.proc.stdout is None:
        #        continue
        #    line = self.proc.stdout.readline()
        #    line = line.decode("utf-8")
        #    if "start proxy success" in line:
        #        result = re.search("start proxy success: (.+)\n", line)
        #        if result is None:
        #            raise ValueError("Could not create share URL")
        #        else:
        #            url = result.group(1)
public_ip = subprocess.run(["curl", "ifconfig.me"], stdout=subprocess.PIPE)
url = f"http://{public_ip.stdout.decode('utf-8')}:{self.local_port}/"
return url

@cansik
Copy link
Contributor

cansik commented Sep 28, 2023

@abidlabs Have a look at #5731

@MysticDaedra
Copy link

So I was using SD.Next when my URL was... cancelled? Reset? Anyhow, the only thing I can think of other than a bug is that my VPN reset the IP address for my home PC, causing the url to be reset or something. Since --share with any Automatic1111 fork is inherently insecure (anyone with access to the URL could potentially use it for nefarious purposes I assume), I'd ideally always be using a VPN like ExpressVPN when opening my instance to the web.

Please let me know if you need any more info from me, I'll do my best.

@abidlabs
Copy link
Member

abidlabs commented Oct 3, 2023

So I was using SD.Next when my URL was... cancelled? Reset? Anyhow, the only thing I can think of other than a bug is that my VPN reset the IP address for my home PC, causing the url to be reset or something

That is indeed quite possible, if your connection dropped / reset, the share link could be broken. Has this happenened repeatedly, or only once?

@MysticDaedra
Copy link

It happened twice in one day, about two hours apart. When I got home from work and was able to view the console, I didn't see any specific errors or anything there, which makes me think it's more on the Gradio-side of things. It's a totally understandable function, I'm wondering if there is something that could be done by SD.Next to perhaps try to re-connect, or maybe a bit of lag time after the connection drops before the url gets reset? I'm so out of my depth here lol. Thanks for your help.

@abidlabs
Copy link
Member

To anyone following along this issue, we are planning on open-sourcing our FRP server as part of the launch of Gradio 4.0. You can see this PR: #6091, or join us for the launch of 4.0, where we'll discuss this in more depth.

@abidlabs abidlabs unpinned this issue Oct 27, 2023
@abidlabs abidlabs pinned this issue Dec 26, 2023
@ugoktas
Copy link

ugoktas commented Dec 26, 2023

From (closed) #6880 :

image

Gradio Environment Information:

Operating System: Windows
gradio version: 4.12.0
gradio_client version: 0.8.0


gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.2.0
fastapi: 0.105.0
ffmpy: 0.3.1
gradio-client==0.8.0 is not installed.
httpx: 0.26.0
huggingface-hub: 0.19.4
importlib-resources: 6.1.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.8.2
numpy: 1.26.2
orjson: 3.9.10
packaging: 23.2
pandas: 2.1.4
pillow: 10.1.0
pydantic: 2.5.2
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.8.0
uvicorn: 0.25.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.12.1
httpx: 0.26.0
huggingface-hub: 0.19.4
packaging: 23.2
typing-extensions: 4.8.0
websockets: 11.0.3

@beautyhansonboy
Copy link

我在Ubuntu上也遇到了同样的问题,有解决办法吗?

I want to know how you solved it

@xxxmuzart
Copy link

@abidlabs I changed mine NVAPI Key and nothing changed =/
What I should do than?

@samueleruffino99
Copy link

I have the same issue actually.
I am trying to generate a shareble link with gradio, but I am getting the following error message:

2024-04-10 16:46:50 | ERROR | stderr | 2024/04/10 16:46:50 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout
2024-04-10 16:46:50 | INFO | stdout | 
2024-04-10 16:46:50 | INFO | stdout | Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.

I have:

gradio                    4.16.0                   pypi_0    pypi
gradio-client             0.8.1                    pypi_0    pypi

I have seen it is possible to deal with it downgrading gradio to 3.9, but currenlty I have a strict requirement using this version.

Reproduction

import gradio as gr

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

demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox")
    
demo.launch(share=True)  # Share your demo with just 1 extra parameter 🚀

Logs

2024-04-10 16:46:34 | INFO | httpx | HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2024-04-10 16:46:35 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-initiated-analytics/ "HTTP/1.1 200 OK"
2024-04-10 16:46:37 | INFO | stdout | Running on local URL:  http://0.0.0.0:7860
2024-04-10 16:46:37 | INFO | httpx | HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
2024-04-10 16:46:37 | INFO | httpx | HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2024-04-10 16:46:40 | INFO | httpx | HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
2024-04-10 16:46:50 | ERROR | stderr | 2024/04/10 16:46:50 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout
2024-04-10 16:46:50 | INFO | stdout | 
2024-04-10 16:46:50 | INFO | stdout | Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.
2024-04-10 16:46:51 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-launched-telemetry/ "HTTP/1.1 200 OK"
2024-04-10 16:46:51 | INFO | httpx | HTTP Request: POST https://api.gradio.app/gradio-error-analytics/ "HTTP/1.1 200 OK"

System Info

gradio                    4.16.0                   pypi_0    pypi
gradio-client             0.8.1                    pypi_0    pypi

@MichaelJWelsh
Copy link

+1 Same issue as above

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

Successfully merging a pull request may close this issue.