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

[Bug] Host Check Causes Issues With Some Services #16

Open
LeeThompson opened this issue Dec 9, 2022 · 9 comments
Open

[Bug] Host Check Causes Issues With Some Services #16

LeeThompson opened this issue Dec 9, 2022 · 9 comments

Comments

@LeeThompson
Copy link

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.

@erohtar
Copy link
Owner

erohtar commented Dec 10, 2022

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?

@LeeThompson
Copy link
Author

LeeThompson commented Dec 10, 2022

EDIT: SD still throws an exception.

(I didn't refresh properly and got a false result.)

@erohtar
Copy link
Owner

erohtar commented Dec 10, 2022

Bummer! I saw the email notification of your original reply and was like "ok that wasn't too bad" lol

@erohtar
Copy link
Owner

erohtar commented Dec 12, 2022

I did include the added option in the latest release, though I'm still keeping this open.

@erohtar
Copy link
Owner

erohtar commented Dec 23, 2022

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);
	}
}

@LeeThompson
Copy link
Author

@erohtar I can't check this right now but I will when I get back home.

@erohtar
Copy link
Owner

erohtar commented Dec 25, 2022

No rush, take your time

@LeeThompson
Copy link
Author

Still happening.

@erohtar
Copy link
Owner

erohtar commented Dec 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants