torrents removal problem

Bug #1020227 reported by tekko
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qBittorrent
Fix Released
Undecided
Christophe Dumez

Bug Description

qBittorrent v3.0.0rc1, libtorrent-rasterbar 0.16.1, xp sp3

still exists in rc2+rc3

Deleted torrents reappear after qBittorrent restarts.

tekko (tekko81)
description: updated
tekko (tekko81)
description: updated
Revision history for this message
King Tomaso (tomasotheking) wrote :

This problem is not specific for v3.0.0.
I made a post about this problem when I was using the very buggy v2.9.8 build for Windows:
http://qbforums.shiki.hu/index.php?topic=789.msg2985#msg2985
I haven't been able to reproduce the problem with other builds myself though.

Revision history for this message
King Tomaso (tomasotheking) wrote :

oh yeah.. and I reported it here:
https://bugs.launchpad.net/qbittorrent/+bug/1001369

Revision history for this message
tekko (tekko81) wrote :

If you're still encountering it in the RC's, then it should be fixed before 3.0 become final. I've never seen it in the past though.

Revision history for this message
King Tomaso (tomasotheking) wrote :

He has already noted in his first post that he's encountering it with all the current RC's.

Revision history for this message
King Tomaso (tomasotheking) wrote :

Sorry for the last post, I didn't notice in a hurry that the post before that was yours, tekko. :)
hmm.. Why can't we edit or delete any of our posts here?
Anyway, I've not encountered this bug in any of the RC's myself.
In fact, the only time that I encountered it was in v2.9.8.

Revision history for this message
tekko (tekko81) wrote :

@King Tomaso
No problem, in regards to the last post; I tried to change my comment a few hours ago... with no luck.

If I am the only one that encounter it then I'll be the only one who can't use the RC's...
I went back to 2.9.11 due to this problem. I think I'll leave the RC testing to the other users for now until it's fixed or a new version comes.

Revision history for this message
King Tomaso (tomasotheking) wrote :

Have you tried to perform a clean install?

If often do wonders with any software (although, it didn't help me with this exact problem when I encountered it):

1) Do a backup of whatever temp. files that you might need/want.
2) Make sure qBittorrent isn't running (check your running processes via Windows Task Manager).
3) Uninstall old qBittorrent version.
4) Reboot.
5) Delete these folders (if they exist):
C:\Program Files\qBittorrent (or its equivalent on other Windows versions)
C:\Documents and Settings\*****\Application Data\qBittorrent (or its equivalent on other Windows versions)
C:\Documents and Settings\*****\Local Settings\Application Data\qBittorrent (or its equivalent on other Windows versions)
6) Delete this reg. string (if it exist):
HKEY_LOCAL_MACHINE\SOFTWARE\qbittorrent
7) Install new qBittorrent version.
8) Reboot.

Revision history for this message
tekko (tekko81) wrote :

I've tried it, but it still doesn't work.
Thanks for the detailed instruction though.
I'll leave the testing of the RC's to you and the others...

Revision history for this message
sledgehammer999 (sledgehammer-999) wrote :

Yes I can confirm that if I delete a torrent in rc3(my own build), close qbt and reopen it the torrent is still there. It never gets delete from BT_backup. This doesn't occur with 2.9.11

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I cannot reproduce on Mac OS X so it is not easy for me to fix. Sledge, do you have time to look into it? Since you can reproduce :)

Changed in qbittorrent:
status: New → Confirmed
Revision history for this message
sledgehammer999 (sledgehammer-999) wrote :

I think I have found it. I(looked what changed between 2.9.x and 3.0.0 code). The torrent files BT_backup have the "read only" flag set. I assume that QFile::remove() fails on them for this reason. And I assume that why you had this line in misc::saferemove() MyFile.setPermissions(MyFile.permissions()|QFile::ReadOwner|QFile::WriteOwner|QFile::ReadUser|QFile::WriteUser);

I will reintroduce it and compile test the code. For now this is the only logical explanation.

Revision history for this message
sledgehammer999 (sledgehammer-999) wrote :

Confirmed. I used the misc::safeRemove() code (from 2.9.11) instead of QFile::Remove() in qbtsession.cpp line 841 (3.0.0rc3) and the torrents get correctly removed and they don't reappear upon restart of qbt.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Yes, safeRemove() was a hack to work around a permission issue on Windows. I was hoping the issue was fixed by now and I got rid of safeRemove(). I would really like to solve the origin of the problem instead of using safeRemove(). There is no reason for those torrent files to be readonly.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I brought back the safeRemove() in GIT master. The issue should be solved in next release candidate.

Changed in qbittorrent:
assignee: nobody → Christophe Dumez (hydr0g3n)
status: Confirmed → In Progress
status: In Progress → Fix Released
Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

Thanks a lot Sledge for debugging this.

Revision history for this message
sledgehammer999 (sledgehammer-999) wrote :

I would investigate further and discover why the readonly flag is set but I currently don't have the time. Anyway, you're welcome.

Revision history for this message
King Tomaso (tomasotheking) wrote :

Honestly, I've not been having this problem with any of the v3.0.0 RC bulids.
I have lots of stuff disabled in Windows though.. stuff that's normally enabled (e.g. System Restore, Indexing Service, Thumbnails Cache and such).
I guess one of those features could be the culprit (with the Indexing Service as the prime suspect).
..But then again; all those features were also disabled back when I DID encouter the problem with the v2.9.8 build.

Revision history for this message
tekko (tekko81) wrote :

System Restore, Indexing Service and Thumbnails Cache has always been disabled on my system... If it has to do with permission like Christ said, then the only info. I can give is that the "Everyone" group's permission has always been removed on my drives. Since Christ is changing the add dialog part of the code, I am suspecting that the so call read-only flag is set at that time?

Thanks to Christ and Sledgehammer for fixing this, and the others who tried to help.

Revision history for this message
sledgehammer999 (sledgehammer-999) wrote :

I found from where the "read only" flag originates. This is tried with Firefox but maybe applicable to other browsers to.

Use case 1:
User clicks on a torrent link. Firefox pops up a dialog. User decides to "open with qbittorrent". Firefox behind the scenes downloads the torrent file to the Temp folder and the nlaunches qbt. The file in the Temp folder is set to "read only", so when qbt copies it to BT_backup the flag is copied too.

Use case 2:
User clicks on a torrent link. Firefox pops up a dialog. User decides to "Save file". Firefox saves the file to user selected folder without setting "read only". User double clicks on torrent file(or adds it to qbt throught the file menu). qbt copies the file to BT_backup without a "read only" flag.

Revision history for this message
King Tomaso (tomasotheking) wrote :

I always use the method described in "Use case 2".
I'm not using Firefox though, but Opera.
Opera has got native torrent support, but I've disabled it by changing the way those files are handled:
My usual configuration is "Save to disk", which brings up the normal Windows "Save As" dialog whenever I click on a torrent file ("Open with.." is not an option).
I tried changing the setting in Opera to "Open with default application", which sends torrent files directly to qBittorrent, but the problem still didn't occur.
I guess Opera just handles files in a different way than Firefox does.
It STILL doesn't explain why I encountered the problem in Dib's v2.9.8 build though, but that build was an abomination! :)
Anyway, I'm glad that the problem seems to be solved.
Good job investigating, Sledge! :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.