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

Problem when using the --public-api flag. #3570

Closed
1 task done
akaikite opened this issue Aug 14, 2023 · 8 comments
Closed
1 task done

Problem when using the --public-api flag. #3570

akaikite opened this issue Aug 14, 2023 · 8 comments
Labels
bug Something isn't working stale

Comments

@akaikite
Copy link

Describe the bug

I used the --api --public-api flag as usual, but got an error.
So I fixed it by opening text-generation-webui\extensions\api\util.py and modifying public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id) to public_url = _run_cloudflared(port, port + 1).

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

--api --public-api flag

Screenshot

No response

Logs

2023-08-14 17:30:05 INFO:Loading the extension "gallery"...
Traceback (most recent call last):
  File "D:\AIchat\oobabooga-windows\text-generation-webui\extensions\api\util.py", line 102, in _start_cloudflared
    public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id)
TypeError: _run_cloudflared() got an unexpected keyword argument 'tunnel_id'
Traceback (most recent call last):
  File "D:\AIchat\oobabooga-windows\text-generation-webui\extensions\api\util.py", line 102, in _start_cloudflared
    public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id)
TypeError: _run_cloudflared() got an unexpected keyword argument 'tunnel_id'
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Exception in thread Thread-7 (_start_cloudflared):
Exception in thread Thread-8 (_start_cloudflared):
Traceback (most recent call last):
Traceback (most recent call last):
  File "D:\AIchat\oobabooga-windows\installer_files\env\lib\threading.py", line 1016, in _bootstrap_inner
  File "D:\AIchat\oobabooga-windows\installer_files\env\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
    self.run()
  File "D:\AIchat\oobabooga-windows\installer_files\env\lib\threading.py", line 953, in run
  File "D:\AIchat\oobabooga-windows\installer_files\env\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
    self._target(*self._args, **self._kwargs)
  File "D:\AIchat\oobabooga-windows\text-generation-webui\extensions\api\util.py", line 112, in _start_cloudflared
  File "D:\AIchat\oobabooga-windows\text-generation-webui\extensions\api\util.py", line 112, in _start_cloudflared
    raise Exception('Could not start cloudflared.')
Exception: Could not start cloudflared.
    raise Exception('Could not start cloudflared.')
Exception: Could not start cloudflared.

System Info

Windows 11 pro, text-generation-webui one-click mode
@akaikite akaikite added the bug Something isn't working label Aug 14, 2023
@15899885850
Copy link

Me too, have you solved this problem?

@akaikite
Copy link
Author

akaikite commented Aug 15, 2023

Me too, have you solved this problem?

So I fixed it by opening text-generation-webui\extensions\api\util.py and modifying public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id) to public_url = _run_cloudflared(port, port + 1). <<<<<< you can read it.
and yes, I fixed that shitty bug.

@15899885850
Copy link

Me too, have you solved this problem?

So I fixed it by opening text-generation-webui\extensions\api\util.py and modifying public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id) to public_url = _run_cloudflared(port, port + 1). <<<<<< you can read it. and yes, I fixed that shitty bug.

Thx!!!!

@ausboss
Copy link
Contributor

ausboss commented Aug 17, 2023

I just did a pr that should fix this so you don't have to manually edit the file.

@mattscott
Copy link

After pulling the latest, I have this updated code in utils.py:

        if tunnel_id is not None:
            public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id)
        else:
            public_url = _run_cloudflared(port, port + 1)

However, attempting to run with the --public-api switch still produces an error and the public api never starts.

Traceback (most recent call last):
File "/home/user/oobabooga_linux/text-generation-webui/extensions/api/util.py", line 105, in _start_cloudflared
public_url = _run_cloudflared(port, port + 1)
File "/home/user/oobabooga_linux/installer_files/env/lib/python3.10/site-packages/flask_cloudflared.py", line 75, in _run_cloudflared
cloudflared = subprocess.Popen([executable, 'tunnel', '--url', 'http://127.0.0.1:' + str(port), '--metrics', '127.0.0.1:' + str(metrics_port)], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
File "/home/user/oobabooga_linux/installer_files/env/lib/python3.10/subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/user/oobabooga_linux/installer_files/env/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 26] Text file busy: '/tmp/cloudflared-linux-amd64'
Exception in thread Thread-4 (_start_cloudflared):
Traceback (most recent call last):
File "/home/user/oobabooga_linux/installer_files/env/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/home/user/oobabooga_linux/installer_files/env/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/user/oobabooga_linux/text-generation-webui/extensions/api/util.py", line 115, in _start_cloudflared
raise Exception('Could not start cloudflared.')
Exception: Could not start cloudflared.

@github-actions github-actions bot added the stale label Sep 30, 2023
@github-actions
Copy link

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

@alicat22
Copy link

alicat22 commented Oct 22, 2023

This is still an issue. Same error as above.

@akaikite If this is still an issue, please feel free to reopen, as I'm unable to.

@marijnbent
Copy link

Can confirm, still an issue.

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

No branches or pull requests

6 participants