[SOLVED] Error migrating deluged from Debian 10 to 11

General support for problems installing or using Deluge
Post Reply
Dr Trix
New User
New User
Posts: 3
Joined: Fri Aug 05, 2022 9:59 pm

[SOLVED] Error migrating deluged from Debian 10 to 11

Post by Dr Trix »

Hello,

I am trying to migrate my deluged installation from Debian 10 Buster (deluged 1.3.15 + libtorrent 1.1.11.0) to something more recent like Debian 11.
My current setup is in a Debian 10 VM running in a Proxmox hypervisor, working for many years without much problems ;)
I am trying to migrate it to a VM with more recent versions of Debian and, of course, deluged.

But whether I try with Debian 11, Ubuntu Server 20.04 or Ubuntu Server 22.04, each time with the latest deluged release from PPA (2.1.1), I am encountering errors.
It looks like I can run a fresh installed deluged (at least I checked on my last try on Ubuntu Server 20, did not check on Debian 11/Ubuntu Server 22).
But as soon as I try to migrate all of my deluged conf folder, I have an error when starting deluged service. Migration is done by creating a tar archive of /var/lib/deluge/.config/deluge folder on my old setup and extracting it on the new setup, and I verified permissions (owned by deluge user in both cases)

The error :

Code: Select all

23:47:31 [WARNING ][deluge.core.core              :332 ] Unable to load /var/lib/deluge/.config/deluge/session.state.bak: [Errno 2] No such file or directory: '/var/lib/deluge/.config/deluge/session.state.bak'
23:47:31 [WARNING ][deluge.core.preferencesmanager:465 ] GeoIP Unavailable: [Errno 24] Too many open files: '/usr/share/GeoIP/GeoIP.dat'
23:47:31 [WARNING ][deluge.core.authmanager       :229 ] Unable to load /var/lib/deluge/.config/deluge/auth: [Errno 24] Too many open files: '/var/lib/deluge/.config/deluge/auth'
23:47:31 [WARNING ][deluge.core.authmanager       :229 ] Unable to load /var/lib/deluge/.config/deluge/auth.bak: [Errno 24] Too many open files: '/var/lib/deluge/.config/deluge/auth.bak'
23:47:31 [ERROR   ][deluge.component              :128 ] [Failure instance: Traceback: <class 'OSError'>: [Errno 24] Too many open files: '/var/lib/deluge/.config/deluge/auth'
/usr/lib/python3/dist-packages/twisted/internet/base.py:1276:mainLoop
/usr/lib/python3/dist-packages/twisted/internet/base.py:902:runUntilCurrent
/usr/lib/python3/dist-packages/twisted/internet/defer.py:460:callback
/usr/lib/python3/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python3/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/usr/lib/python3/dist-packages/twisted/internet/task.py:865:<lambda>
/usr/lib/python3/dist-packages/deluge/core/authmanager.py:68:start
/usr/lib/python3/dist-packages/deluge/core/authmanager.py:279:__load_auth_file
/usr/lib/python3/dist-packages/deluge/common.py:1221:create_localclient_account
]
23:47:31 [ERROR   ][deluge.component              :128 ] [Failure instance: Traceback: <class 'OSError'>: [Errno 24] Too many open files: '/var/lib/deluge/.config/deluge/state/.safe_state_check'
/usr/lib/python3/dist-packages/twisted/internet/base.py:1276:mainLoop
/usr/lib/python3/dist-packages/twisted/internet/base.py:902:runUntilCurrent
/usr/lib/python3/dist-packages/twisted/internet/defer.py:460:callback
/usr/lib/python3/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python3/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/usr/lib/python3/dist-packages/twisted/internet/task.py:865:<lambda>
/usr/lib/python3/dist-packages/deluge/core/torrentmanager.py:246:start
]
A little search on my favorite engine lead me to something related with limits (because of the 'Errno 24 Too many open files') but adding the code below to /etc/security/limits.conf did not help :

Code: Select all

*                soft    nofile          1000000
*                hard    nofile          1000000
Log says something about file /var/lib/deluge/.config/deluge/state/.safe_state_check which does not exist

Like I said, I also tried on Debian 11 and Ubuntu Server 22.04 without success. I am open to any help, maybe I am missing something or else? ;)
With the number of torrents, I would be a bit annoyed if I had to add all of them manually on the new setup :mrgreen:
Last edited by Dr Trix on Wed Aug 10, 2022 6:21 pm, edited 1 time in total.
IBTB
New User
New User
Posts: 4
Joined: Sun Jun 06, 2021 11:16 am

Re: Error migrating deluged from Debian 10 to 11

Post by IBTB »

Regarding the Errno 24, I read this a few months ago: viewtopic.php?f=7&t=56164
It has some suggestions. There is also a link to more information in a post there. You can try to read up on those a bit first! :)
Dr Trix
New User
New User
Posts: 3
Joined: Fri Aug 05, 2022 9:59 pm

Re: Error migrating deluged from Debian 10 to 11

Post by Dr Trix »

IBTB wrote: Tue Aug 09, 2022 8:14 pm Regarding the Errno 24, I read this a few months ago: viewtopic.php?f=7&t=56164
It has some suggestions. There is also a link to more information in a post there. You can try to read up on those a bit first! :)
Hello! Thanks for your answer!
I actually did read this post and other on Internet suggesting to modify limits and tried this - with no effect.

BUT! I think I have found the origin. I have tried migrating my config one file/directory after another to check if/which one caused the error to trigger (because I have checked before that a freshly installed deluged works without any error, so I arrived at the conclusion that the migration is causing this).
Torrents states caused no harm, no more than auth file, but core.conf did cause the error. I then checked differences between my old file (version 1.3.15) and the new from 2.1.1 and noticed a few differences, some parameters were no more present...

So what I finally did is only migrating torrents state + auth, and barely modified core.conf directly from new version (I just modified download and move directories to adapt to my actual config). And everything started normally, torrents resumed correctly :)
I finished modifying conf from within Deluge thin client in order to adapt some more parameters, and noticed again than others disappeared (eg. autoload torrent directory) that were in my old core.conf. But I did not take care of those ones, I only adapted parameters that I was able to find.
Maybe those parameters were causing my troubles? I don't know, and I'm not sure I will push tests further, considering I managed what I wanted to do : upgrading Debian and Deluge(d) :D

To mods : may I mark this thread as solved?
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Error migrating deluged from Debian 10 to 11

Post by mhertz »

Dr Trix wrote: Wed Aug 10, 2022 2:00 pm [...]
To mods : may I mark this thread as solved?
Of-course you may, and glad to hear you solved it, and thanks for posting back your fix :)

I Googled your issue initially but didn't find anything obvious, other than you did already.

It is strange as deluge have code for handling/updating outdated config, and I've never seen this myself when have run v1.x after v2.x, or vice-versa, but though believe only done it in a windows VM mind you, maybe changing things. Just strange error all the same, but something in your core.conf obviously must be the culprit per your good troubleshooting.

Thanks.
Dr Trix
New User
New User
Posts: 3
Joined: Fri Aug 05, 2022 9:59 pm

Re: Error migrating deluged from Debian 10 to 11

Post by Dr Trix »

mhertz wrote: Wed Aug 10, 2022 2:55 pm It is strange as deluge have code for handling/updating outdated config, and I've never seen this myself when have run v1.x after v2.x, or vice-versa, but though believe only done it in a windows VM mind you, maybe changing things. Just strange error all the same, but something in your core.conf obviously must be the culprit per your good troubleshooting.
I am supposing there have been cumulating things : some 'bad' old parameter causing an Errno 24. For example, among other things, I had a complete range of ports opened (something between 57000 and 57100 I think, I can't even remember :lol: ) and so during a try with debug log I had so many lines with opening/opend connections... I am wondering (though not an expert in this domain) if those open connections may have play a role in this. On my current setup with Debian 11 / deluged 2.1.1 I moved to 1 port opened with port forwarding on my VPN.
But not 100% sure, neither if removed parameters such as autoload directory were faulty... And as I said, I have to admit I don't care as long as I finally managed to upgrade everything - with less pain than having to re-import manually every torrent :D

(OK if we count the time I spent trying to solve this... maybe not so much less :lol: )

Marked topic as solved, and thanks for the replies!
mhertz wrote: Wed Aug 10, 2022 2:55 pm and thanks for posting back your fix
You're welcome, it's normal, and who knows if someone will not have a similar problem one day. So I do it with pleasure, I am happy too to benefit from other's solutions :)
cara
New User
New User
Posts: 2
Joined: Tue Jan 03, 2023 4:34 am

Re: [SOLVED] Error migrating deluged from Debian 10 to 11

Post by cara »

Thanks for sharing this quality information with us. I really enjoyed reading. Will surely going to share this URL with my friends
among us
Post Reply