Dasherr
Dasherr copied to clipboard
[Bug] Host Check Causes Issues With Some Services
This is clearly not a "Dasherr" bug "per se", but perhaps some alternate check methods may be a good idea. (I.e. perhaps perform a HTTP GET (i.e. curl) instead of just opening a connection to the port.)
Example: With https://github.com/AUTOMATIC1111/stable-diffusion-webui the check causes the Stable Diffusion WebUI to throw an exception. It appears to still run so mostly this just makes it's console a horrible mess but it's possible that with other applications it may cause problems.
In this case, when Dasherr 'pings' the port, Stable Diffusion WebUI throws this exception:
ERROR:asyncio:Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "C:\Python\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Python\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
If I use curl to the host:port, it doesn't throw an exception.
Could you pls do a simple test for me? There's this checkOnline function in include/worker.js
Pls change:
const options = {
method: 'GET',
mode: 'no-cors'
};
to
const options = {
method: 'GET',
mode: 'no-cors',
connection: 'close'
};
Does it help?
EDIT: SD still throws an exception.
(I didn't refresh properly and got a false result.)
Bummer! I saw the email notification of your original reply and was like "ok that wasn't too bad" lol
I did include the added option in the latest release, though I'm still keeping this open.
Another test - could you pls replace the checkOnline() function in worker.js with this and let me know?
async function checkOnline(thisUrl, thisId) {
//reads all tiles from settings and sets their respective indicators to green
let controller = new AbortController();
const options = {
method: 'GET',
mode: 'no-cors',
connection: 'close',
signal: controller.signal
};
const response = await fetch(thisUrl,options);
if (response.status = 200) {
controller.abort();
thisId.className = thisId.className.replace(/dot(?!\S)/g, 'dot dot-green');
//this theming needs to be done here because js can't change style of future elements of a class
$('.dot-green').css('background-color', currTheme.colorOn);
} else {
controller.abort();
//console.log(thisUrl + ' : ' + response.status);
}
}
@erohtar I can't check this right now but I will when I get back home.
No rush, take your time
Still happening.
Hmm. I'm not sure what else I could do differently - But I'll keep this open and come back to it in case I have other ideas.