Git Product home page Git Product logo

Comments (16)

papuSpartan avatar papuSpartan commented on June 16, 2024 1

That helped a lot. In a nutshell, this doesn't really negatively effect your installation/workflow other than delaying (initial) connection to the webui by a fraction of a second (and annoying console output of course).

If you care for the details:
I installed brave and noticed using wireshark that brave is trying to connect to the webui using ipv6 ( [::1] instead of 127.0.0.1 which is what the socket is actually running on). I'm not 100% certain, but I think what is happening is brave is seeing the [::1] SAN in the certificate the extension is generating and is trying to upgrade the connection to ipv6 when the socket is in reality running in ipv4 mode. It might be possible to fix this by just removing the [::1] SAN but I will have to test. The other solution might be telling webui to run on an ipv6 socket instead but I'll probably go with the former if possible.

Uvicorn, which is what gradio uses to setup the socket does have ipv6 socket support. So, adding --server-name [::1] to one's webui args seems to at least stop the problem upon connection but it's still happening if I leave it open a while so I guess it's something else.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024 1

This also seems to happen for edge as well so I guess its an issue on all chromium based browsers.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

webui.cert is what is auto-generated by the extension in default (fully automatic) setting. The localhost.cert you are seeing when downloading through brave should be the same certificate (compare hashes if you want to double check or suspect corruption). Brave is likely programmed to just name the certificate to whatever the FQDN is you are inspecting/connected to.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

Full startup log could help in this case. Another user had the same issue (relating to the console errors) and was solved simply by fully restarting the webui.

from stable-diffusion-webui-auto-tls-https.

possibleimprobable avatar possibleimprobable commented on June 16, 2024

Here is my startup log, from just starting webui:

remote: Enumerating objects: 257, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 257 (delta 171), reused 187 (delta 149), pack-reused 38
Receiving objects: 100% (257/257), 130.93 KiB | 3.04 MiB/s, done.
Resolving deltas: 100% (171/171), completed with 60 local objects.
From https://github.com/AUTOMATIC1111/stable-diffusion-webui
3e22e29..3f23e6d master -> origin/master
Updating 3e22e29..3f23e6d
Fast-forward
javascript/dragdrop.js | 10 +++-
javascript/ui.js | 2 +-
modules/api/api.py | 29 ++++++++++--
modules/errors.py | 25 +++++++++-
modules/extras.py | 31 ++++++++++---
modules/hypernetworks/hypernetwork.py | 1 +
modules/interrogate.py | 4 +-
modules/processing.py | 49 +++++++++++---------
modules/sd_hijack.py | 12 ++++-
modules/sd_hijack_inpainting.py | 5 +-
modules/sd_models.py | 63 ++++++++++++++++----------
modules/shared.py | 26 ++++++++---
modules/textual_inversion/preprocess.py | 1 +
modules/textual_inversion/textual_inversion.py | 59 ++++++++++++++++++------
modules/ui.py | 14 +++---
requirements.txt | 2 +-
requirements_versions.txt | 2 +-
script.js | 2 +-
scripts/xy_grid.py | 12 +++++
webui.py | 12 ++++-
20 files changed, 268 insertions(+), 93 deletions(-)
venv "D:\Program Files\StDfwebui\ai\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 3f23e6dabe688c70a7461eabae0eaa6b31eed8de
Installing requirements for Web UI

Launching Web UI with arguments: --allow-code --opt-split-attention --precision full --no-half --lowvram --xformers --autolaunch
Default key/cert pair was already generated by webui
Certificate trust store ready
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading weights [15f710c9] from D:\Program Files\StDfwebui\ai\stable-diffusion-webui\models\Stable-diffusion\Disnime.ckpt
Loading VAE weights from: D:\Program Files\StDfwebui\ai\stable-diffusion-webui\models\VAE\vae-ft-ema-560000-ema-pruned.ckpt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded.
Running with TLS
Warning: Bad ui setting value: img2img/Mask mode/value: Draw mask; Default value "Inpaint masked" will be used instead.
Running on local URL: https://127.0.0.1:7860

To create a public link, set share=True in launch().
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 162, in _call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

from stable-diffusion-webui-auto-tls-https.

possibleimprobable avatar possibleimprobable commented on June 16, 2024

Are these tracebacks indicating that the extension isn't working? Or if not what issues are they indicating?

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

Are these tracebacks indicating that the extension isn't working? Or if not what issues are they indicating?

From what I've been able to make of this so far, the extension has created the cert and the checks that are run internally by gradio and then by ssl libraries are checking out meaning that the cert is valid. If you have any other extensions enabled, but particularly any you know of that connect to the internet for anything, try disabling them and then seeing if you get the same crash.

The latest version of this extension takes your python trust store/bundle and then creates an intermediary bundle to pass to gradio which has the chosen/generated certificate injected into it. It's been a while but I think I may have had this problem during development at some point. I remember an early version of another extension was phoning home somewhere and would crash because at that point I was only passing the generated certificate and not the rest of the python/certifi trust store. Because of that the related connection(s) would be seen as untrusted which was causing it to refuse them.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

Screenshot what extensions you have installed from the extensions tab and I'll try and reproduce this later.

from stable-diffusion-webui-auto-tls-https.

possibleimprobable avatar possibleimprobable commented on June 16, 2024

If you have any other extensions enabled, but particularly any you know of that connect to the internet for anything, try disabling them and then seeing if you get the same crash.

I'm just trying to understand though. When you say "crash". What exactly is crashing? If I'm receiving these tracebacks every 20-30 seconds, does that mean that your extension is running correctly and throwing tracebacks at me for something it thinks is going wrong? Or has your extension stopped working and the terminal is just reminding me each time it's trying to use your extension? I suppose I should mention all functions of SD, the webui, and my extensions are working fine.

Here's my list of extensions. Under "embedding-inspector-main" is listed just "extensions" and I'm not quite sure why but I included it.

Config-Presets
a1111-sd-webui-tagcomplete
embedding-inspector-main
extensions
multi-subject-render | https://github.com/Extraltodeus/multi-subject-render
sd-web-ui-quickcss | https://github.com/Gerschel/sd-web-ui-quickcss
sdweb-merge-board | https://github.com/bbc-mc/sdweb-merge-board
stable-diffusion-webui-auto-tls-https | https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https
stable-diffusion-webui-sonar | https://github.com/Kahsolt/stable-diffusion-webui-sonar
stable-diffusion-webui-tokenizer | https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer
LDSR
ScuNET
SwinIR
prompt-bracket-checker
roll-artist

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

I'm just trying to understand though. When you say "crash". What exactly is crashing? If I'm receiving these tracebacks every 20-30 seconds, does that mean that your extension is running correctly and throwing tracebacks at me for something it thinks is going wrong? Or has your extension stopped working and the terminal is just reminding me each time it's trying to use your extension? I suppose I should mention all functions of SD, the webui, and my extensions are working fine.

If you are able to use the UI / you can connect to the UI through https then it is at least mostly working. What I think is happening is there is something trying to make connections to somewhere from the webui which it does not trust. It is possibly a TLS handshake problem.

If you don't notice any loss in functionality then it should be fine.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

Do these errors show up before you even open the webui in your browser? I've mirrored your setup but am currently unable to reproduce the problem. What browser are you using? Any plugins that might have to do with TLS (something like https everywhere comes to mind)? I'm currently using firefox nightly 110.0a1 and don't get this issue. See if this still happens when trying to connect to the webui through a fresh install of a browser.

from stable-diffusion-webui-auto-tls-https.

possibleimprobable avatar possibleimprobable commented on June 16, 2024

My main browser is Brave browser which is pretty high security. I've just spent a bunch of time trying to lower Brave's security with my SDWebui url but no avail. Then I tried it with Firefox and no tracebacks. I suppose I don't mind switching, but if you're able to figure out what can be done to help it run better with Brave, that would be pretty cash money.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

From what I've been able to find out, it seems that this is something that chromium does in order to prevent delays with sockets. But as in this case, it can sometimes cause problems.

Packet capture of connection reset happening with brave. Placing this here for reference:
https://drive.google.com/file/d/1znRu3Ta2lN3TVo6VH4FgyjDt230F0HHZ/view?usp=share_link

from stable-diffusion-webui-auto-tls-https.

chrisgoringe avatar chrisgoringe commented on June 16, 2024

Getting the same issue with Epic web browser. Irritating, but definitely non-fatal.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

Getting the same issue with Epic web browser. Irritating, but definitely non-fatal.

Hadn't heard of that browser until now, but it looks like that one is also chromium based so it checks out. I'm going to have to ask in some different places because I don't seem to be getting any response from the uvicorn team on it.

from stable-diffusion-webui-auto-tls-https.

papuSpartan avatar papuSpartan commented on June 16, 2024

I believe this was fixed in the dev branch. Let me know if it happens again on that version.

from stable-diffusion-webui-auto-tls-https.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.