Opened 5 years ago
Last modified 3 years ago
#3313 new bug
GTKUI thinclient cannot start localhost daemon on Windows.
Reported by: | mhertz | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.6 |
Component: | GTK UI | Version: | 2.0.3 |
Keywords: | Cc: |
Description
Using Cas's manual install instructions for Deluge2 on windows 10, then when selecting 'Start daemon' from connection-manager, it fails with error message: "Check deluged package is installed and logs for further details".
Something i'm guessing is related, is that when starting deluged.exe manually, then it does work to connect to, but the daemon doesn't background itself no more, as it did in previous deluge 1.3.15, and no options to make it fork itself to background is available. The same with the webUI, so i'm guessing it is related with above issue, or otherwise there is two issues to report here.
The fix for pidfile creation(#3278), when applied, didn't fix either of these issues.
Thanks in advance.
Change History (6)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
This can be fixed by applying the following change:
-
deluge/ui/client.py
diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 686f962b3..4db737c28 100644
a b def start_daemon(self, port, config): 668 668 bool: True is successfully started the daemon, False otherwise. 669 669 670 670 """ 671 # subprocess.popen does not work with unicode args (with non-ascii characters) on windows672 config = config.encode(sys.getfilesystemencoding())673 671 try: 674 subprocess.Popen(['deluged', '--port=%s' % port, b'--config=%s' % config])672 subprocess.Popen(['deluged', '--port=%s' % port, '--config=%s' % config]) 675 673 except OSError as ex: 676 674 from errno import ENOENT
On Python 3 this works even when the config directory path contains non-ASCII characters, but on Python 2 it likely won't.
comment:3 by , 5 years ago
Awesome, thank you so much tobbez, I really appreciate this alot! :)
I now only have one issue left still, and that is that the deluged daemon still doesn't background itself, so when selecting 'Start daemon' from connection-manager, then there opens a terminal-window which keeps staying open, and the same if running deluged manually where it doesn't background itself, like it did in deluge 1.3.15. No errors though.
Do you have any ideas aabout that?
In either case, I really appreciated your help with this so many thanks again!
comment:4 by , 5 years ago
@tobbez, do the code you posted for .5 work for you locally?
I used my deluge2 from Cas's install-instructions and because of admin-rights needed, I copied deluged.exe into my win10 VM's user(fooba) Downloads folder and changed your code to match my system and then runned it and it did change the file I could see from the file-properties, and then I overwrote deluged.exe from Downloads and back to correct place again(I did backup it first), but the result is same as before and I can see python and not pythonw.exe runs deluged.exe still and doesn't background itself.
I apologize in advance if messing up your instructions, as that is very likely ;)
Edit: Sorry, forgot pasting in code used:
# replace PYTHONDIR with the root of your Python installation with open(r'C:\Program Files\Python36\Lib\site-packages\pip\_vendor\distlib\w64.exe', 'rb') as f: launcher = f.read() with open(r'C:\Users\fooba\Downloads\deluged.exe', 'rb') as f: d = f.read() with open(r'C:\Users\fooba\Downloads\deluged.exe', 'wb') as f: f.write(launcher) f.write(d[d.rindex(b'#!'):])
Edit2: Sorry, posted in wrong ticket, doh! :) I got confused lol with the 3 tickets I made in last couple of days... I reposted it in correct ticket now.
comment:5 by , 3 years ago
Milestone: | needs verified → 2.0.6 |
---|
comment:6 by , 3 years ago
Remember will need to verify can still handle non-ascii paths: https://dev.deluge-torrent.org/ticket/2093
Sorry, forgot adding debug-logs previously. There where no errors shown when running debug-log of deluged.exe, but has issue as stated before of not going to background and staying in foreground, so if doubleclicking it, then it leaves the new terminal open, instead of just briefly "blinking" it.
Here follows snippet of erronymous part of debug-log of GTKUI in thinclient mode while selecting 'Start daemon' from connection-manager, which fails with error message in GUI as described in previous post: