Deluge 2.1.1: hostlist.conf cleared on startup

Specific support for Deluge on Microsoft Windows OS
Post Reply
donovanlarnia
New User
New User
Posts: 2
Joined: Tue Aug 30, 2022 2:40 am

Deluge 2.1.1: hostlist.conf cleared on startup

Post by donovanlarnia »

hostlist.conf gets overwritten with only the localhost in the list on every startup.

I added a remote host to the list and successfully connected to it. Then after closing and reopening Deluge 2.1.1 the hostlist.conf got overwritten by the standard localhost entry, removing the just added remote entry.

User has proper access to hostlist.conf in the respective roaming profile and can also manually be edited.
Same effect, if entry is being added to hostlist.conf and saved before starting up Deluge.

how to prevent this?
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge 2.1.1: hostlist.conf cleared on startup

Post by mhertz »

Sorry this issue isn't known why happens and why only for some, and has been reported a few times through out last 2 years - I could finally reproduce once or twice, a year or so ago, but I just found happens occasionally, and upon reading not writing, and so overwritten on close when happens. Only workaround currently is to write-protect the file when hosts added, and restarting client when host-list empty and then should work next startup, well for me at least.

Sorry cannot help. When trying I of-course cannot reproduce for troubleshooting, in 20 restarts, like last I tried, and ever only happened to me "by surprise" one day, so no logging enabled etc.

Can you try enable debug-logging and see if catches anything - I cannot remember if I ever got feedback of such from affected users.
donovanlarnia
New User
New User
Posts: 2
Joined: Tue Aug 30, 2022 2:40 am

Re: Deluge 2.1.1: hostlist.conf cleared on startup

Post by donovanlarnia »

thx for getting back on this. I tested again, list is being overwritten on startup, not when closing the app.

debug 1:
08:49:58 [DEBUG ][deluge.configmanager :91 ] Getting config: gtk3ui.conf
08:49:58 [DEBUG ][deluge.config :441 ] Config C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf.1.2 version: 1.1 loaded: {'hosts': [['6e132e1478f85de0892a1802b3d1ca8b73e86c38', '127.0.0.1', 58846, '', '']]}
08:49:58 [DEBUG ][deluge.config :485 ] Saving new config file C:\Users\donovan\AppData\Local\Temp\hostlist.conf.z60i0a0y
08:49:58 [DEBUG ][deluge.config :499 ] Backing up old config file to C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf.bak
08:49:58 [WARNING ][deluge.config :502 ] Unable to backup old config: [Errno 13] Permission denied: 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.bak'
08:49:58 [DEBUG ][deluge.config :507 ] Moving new config file C:\Users\donovan\AppData\Local\Temp\hostlist.conf.z60i0a0y to C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf
08:49:58 [ERROR ][deluge.ui.hostlist :72 ] [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2' -> 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2.old'
Traceback (most recent call last):
File "deluge\ui\hostlist.py", line 64, in migrate_hostlist
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2' -> 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2.old'

while checking permissions of hostlist.conf.bak it was set to read-only. Therefore I tried again after removing read-only and made sure that my user has full control over the file.

debug 2:
08:55:44 [DEBUG ][deluge.configmanager :91 ] Getting config: gtk3ui.conf
08:55:44 [DEBUG ][deluge.config :441 ] Config C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf.1.2 version: 1.1 loaded: {'hosts': [['6e132e1478f85de0892a1802b3d1ca8b73e86c38', '127.0.0.1', 58846, '', '']]}
08:55:44 [DEBUG ][deluge.config :485 ] Saving new config file C:\Users\donovan\AppData\Local\Temp\hostlist.conf.qril9jzx
08:55:44 [DEBUG ][deluge.config :499 ] Backing up old config file to C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf.bak
08:55:44 [DEBUG ][deluge.config :507 ] Moving new config file C:\Users\donovan\AppData\Local\Temp\hostlist.conf.qril9jzx to C:\Users\donovan\AppData\Roaming\deluge\hostlist.conf
08:55:44 [ERROR ][deluge.ui.hostlist :72 ] [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2' -> 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2.old'
Traceback (most recent call last):
File "deluge\ui\hostlist.py", line 64, in migrate_hostlist
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2' -> 'C:\\Users\\donovan\\AppData\\Roaming\\deluge\\hostlist.conf.1.2.old'

error regarding backup file is not appearing anymore, but list is still getting cleared.

while testing I just realized something looking at the timestamps. I used to have a 1.X installation. But since 2.X came out, I only used webinterface since there was no proper windows build. So most likely the issue came from migrating the config from 1.X to 2.X when I installed using the 2.1.1 windows installer. I moved the folder in roaming profile and had 2.1.1 recreate it - works without flaw now.

hope that helps you or others running into the same problem :-)
mhertz
Moderator
Moderator
Posts: 2216
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge 2.1.1: hostlist.conf cleared on startup

Post by mhertz »

Thanks alot for the logs and info, appreciate your help in this mate! :) Finally we're coming somewhere with this after several years! :)

So indeed I can reproduce this issue if generating manually both a hostlist.conf.1.2 and a hostlist.conf.1.2.old and resets hostlist on every startup untill manually deleting the old version.

I tried several times now with clean config going from deluge 1 to deluge2, but could never reproduce this myself, and only if done manually/artificially, as only ever had the hostlist.conf.1.2.old but never also hostlist.conf.1.2 together with it, but seemingly can happen. I just don't understand why only happened to me a select few times among a bunch of tests, but here is a static fail always, but regardless.

I'll whip up a bug-ticket referencing this thread later, maybe in a few days later first, but again really appreciate your help, and finally have something usefull to say when this issue raised again! :) I though always recommend people try fresh profile in whatever issue they have, including this(doh! of-course I forget here!), but cannot remember if ever got feedback back from such request, so probably didn't then, as would have fixed it like your experience.

Thanks again!

Edit: I do though now remember some said that the write-protect hostlist.conf trick worked for some time, but sooner or later would fail again, like I myself have seen and where next startup worked, so seemingly there can be an other issue still than this, unless i'm misunderstanding it, but again, much appreciate your help in atleast one of the fail-cases, if not the only one as very well I could be misunderstanding this
Post Reply