Opened 10 years ago

Closed 10 years ago

#4377 closed Bug (fixed)

Incomplete Folder removed when sub-folder of Default Location

Reported by: metaclam Owned by:
Priority: Normal Milestone: None Set
Component: Transmission Version: 2.33
Severity: Critical Keywords:
Cc:

Description

When the Incomplete Folder is a sub-folder of the Default download folder, that folder is removed when a torrent completes. I see no sign of it being trashed, must be rm'd.

At first I thought it was because I used a leading space in the folder name. But had the same result with a leading "!".

It does not do this when the Incomplete Folder is at the same level as the Download Folder. It did not do this is previous versions of Transmission.

This is fairly major, because after that folder is removed, downloads cannot proceed and/or Transmission crashes (unsure if crash is related). Seems to be no fallback route if that folder goes missing.

See:

https://forum.transmissionbt.com/viewtopic.php?f=4&t=11943&p=55480#p55480

This may be a problem with the 2.32+ nightly builds. Using r12545.

Change History (36)

comment:1 Changed 10 years ago by jordan

I'm not able to reproduce this error. Here's how I tested:

  1. created a directory, /tmp/downloads, and set it as my default download directory.
  2. created a directory, /tmp/downloads/incomplete, and set it as my incomplete directory.
  3. turned on the incomplete directory feature.
  4. started downloading a torrent.

Results:

  • While the torrent's files were downloading, they were stored in /tmp/downloads/incomplete/torrentname/.
  • When the torrent finished downloading, torrentname/ was moved to /tmp/downloads.
  • /tmp/downloads/incomplete was not removed by Transmission, and existed as an empty directory after downloading finished.

comment:2 Changed 10 years ago by metaclam

thanks for trying. it happened 3 times at least here.

to attempt to reproduce, try on an external volume, and also with non alpha lead character:

/Volumes/Drive_Name/Downloads/Torrents/ /Volumes/Drive_Name/Downloads/Torrents/ Transmission Incomplete

Also wait some time (a couple hours?) to see if that " Transmission Incomplete" folder is removed. I am rather sure it happens as soon as the last transfer is finished, but I never saw it happen, until returning to computer after some hours.

comment:3 Changed 10 years ago by jordan

Are you saying that it happens to you on external drives with nonalpha lead characters, but not on internal drives in directories beginning with a letter? Or are you just throwing out suggestions?

If you know the circumstances where this happens, please let me know instead of sending me on a snipe hunt.

comment:4 Changed 10 years ago by metaclam

With all due respect and gratitude for you work, that's not very fair. I provided 2 conditions where this occurred for me, and 2 where it did not. It's not my job to isolate the definitive cause of a bug, but rather to provide the information I have. I have not tested an internal drive or this condition with an alpha lead char folder name.

On the other (possibly related) issue I reported in the forums about failure to start torrents, I provide pages of test results with limited interest.

comment:5 Changed 10 years ago by jordan

With equal respect, you're the only one seeing this behavior, so it would be extremely helpful if you could outline the recipe to trigger the behavior.

I followed your steps in the ticket description, reported back, and when I asked for more information you said that wasn't your job.

Do you have specific steps that you know will trigger the behavior?

comment:6 Changed 10 years ago by metaclam

I really am not looking for an argument about this. But let me point out that you did not follow the steps in the ticket description, because I specifically said that it happened with folder names that started with space or "!". I admit I did not specify this was on an external volume.

So could you please try to reproduce more closely those specific conditions?:

  1. build 2.32+
  2. external volume
  3. incomplete as subfolder of downloads
  4. leading space in incomplete folder

If then you find this doesn't occur, I will then try to test some more, including on internal volume.

comment:7 Changed 10 years ago by jordan

Okay. I set up a Downloads and " Incomplete" directory on a patriot brand flash drive and started a session with r12580.

  1. $ mkdir -p "/media/PATRIOT/Downloads/ Incomplete"
  2. In Transmission, set /media/PATRIOT/Downloads/ as the default save folder
  3. In Transmission, set /media/PATRIOT/Downloads/ Incomplete/ as the incomplete folder
  4. Added http://www.archlinux.org/iso/2010.05/archlinux-2010.05-core-dual.iso.torrent and started downloading.

While downloading:

$ ls -R /media/PATRIOT/Downloads/
/media/PATRIOT/Downloads/:
 Incomplete

/media/PATRIOT/Downloads/ Incomplete:
archlinux-2010.05-core-dual.iso.part

Right after downloading finished:

$ ls -R /media/PATRIOT/Downloads/
/media/PATRIOT/Downloads/:
archlinux-2010.05-core-dual.iso   Incomplete

/media/PATRIOT/Downloads/ Incomplete:

And 30 minutes later:

$ ls -R /media/PATRIOT/Downloads/
/media/PATRIOT/Downloads/:
archlinux-2010.05-core-dual.iso   Incomplete

/media/PATRIOT/Downloads/ Incomplete:

comment:8 Changed 10 years ago by metaclam

Thanks, Jordan. I'm a bit confused by a path that begins with "/media" rather than "/volumes" but it is probably not relevant.

I've done some more testing and at the moment I am also unable to reproduce this problem in any location (internal, and two external drives, including the original locations where the problem occurred.) This is weird because it happened at least 3 times before I reported the problem. So now I have no idea what conditions are necessary to reproduce.

If you don't mind, leave this ticket open a couple weeks. If it happens again I'll try harder to nail it down.

comment:9 Changed 10 years ago by sfera

i cannot emphasize how annoying this bug is. one has to actually check if the incomplete directory exists before adding a torrent.

i'll also have to point out #4350 as i suspect it's the same problem, regardless of the UI.

comment:10 Changed 10 years ago by x190

Hi sfera,

In order to help the developers track this issue down, can you please list the exact steps needed to cause the incomplete directory to go AWOL in a repeatable fashion? This has proved elusive, even for metaclam who opened this ticket.

comment:11 Changed 10 years ago by dopefish3d

I can confirm the Incomplete folder (that i've created as a subfolder of my Torrents folder) also is being removed.

For me I can confirm it happens every single time I right-click a completed torrent and choose "Remove Data File".

Both the file and the Incomplete folder can then be found in the trash.

comment:12 Changed 10 years ago by blalor

I'm also experiencing this problem. I don't have steps to reproduce, but it's happening frequently. Transmission 2.33 on Mac OS X 10.6.8.

comment:13 Changed 10 years ago by jordan

  • Version changed from 2.32+ to 2.33

comment:14 Changed 10 years ago by metaclam

Interesting test, dopefish. I tried this and again was not able to reproduce (vers. 2.33). I first tried removing data file of a paused torrent that was complete. Did not recur. Then I tried removing a paused torrent that was not complete (after making copy of .part file). Also did not recur. I haven't yet tried removing an active torrent that is either complete or not complete.

I do think you're on to something tho, because when I first reported this problem I was rebuilding a somehow corrupted set of resume files, and in the process removing a fair amount of data files I no longer needed, etc.

comment:15 Changed 10 years ago by sfera

sorry for taking so long to respond. the behavior can be reproduced: if you remove a torrent+data when the incomplete directory is empty , the incomplete dir also gets removed. i just tested it with a torrent containing just a few small text files.

comment:16 Changed 10 years ago by x190

Same issue with a mysterious twist. The plot thickens. :-) https://forum.transmissionbt.com/viewtopic.php?f=9&t=12007&p=55663#p55663

comment:17 Changed 10 years ago by sfera

update to my previous comment: i just checked the behavior again, as i had to remove two paused/finished torrents (they were paused because they reached the seed ratio), but this time the incomplete directory wasn't deleted.

comment:18 Changed 10 years ago by keithlard

Yep, same here - incomplete downloads folder being removed and causing downloads to stop with an 'Error! No data found!' message.

comment:19 Changed 10 years ago by metaclam

This happened again since I last reported I could not reproduce. Again, not sure of cause. ☹

However here is some info from the log:

2011-08-02 04:16:26 -0400 utils.c:443 [Debug] Transmission: Couldn't read "/Users/myuser/Library/Application Support/Transmission/Resume/somevideo.wmv.edc31157ee0d5b95.resume": No such file or directory
2011-08-02 04:16:26 -0400 resume.c:686 [Debug] somevideo.wmv: Couldn't read "/Users/myuser/Library/Application Support/Transmission/Resume/somevideo.wmv.edc31157ee0d5b95.resume"
2011-08-02 04:16:26 -0400 bencode.c:1721 [Info] Transmission: Saved "/Users/myuser/Library/Application Support/Transmission/Torrents/somevideo.wmv.edc31157ee0d5b95.torrent"
2011-08-02 04:16:26 -0400 peer-mgr.c:2074 [Debug] Transmission: Banned IP address "92.24.241.45" tried to connect to us
2011-08-02 04:16:26 -0400 verify.c:260 [Info] somevideo.wmv: Queued for verification
2011-08-02 04:16:26 -0400 verify.c:218 [Info] somevideo.wmv: Verifying torrent
2011-08-02 04:16:26 -0400 verify.c:61 [Debug] somevideo.wmv: verifying torrent...
2011-08-02 04:16:26 -0400 verify.c:155 [Debug] somevideo.wmv: Verification is done. It took 0 seconds to verify 931946560 bytes (931946560 bytes per second)
2011-08-02 04:16:26 -0400 peer-mgr.c:2074 [Debug] Transmission: Banned IP address "84.204.13.37" tried to connect to us
2011-08-02 04:16:26 -0400 Controller.m:1724 [Info] Transmission: restarting download torrent in mac queue
2011-08-02 04:16:26 -0400 Torrent.m:322 [Info] somevideo.wmv: restarting via startTransfer
2011-08-02 04:16:28 -0400 announcer.c:1484 [Debug] somevideo.wmv: Announcing to tracker
2011-08-02 04:16:28 -0400 peer-mgr.c:2074 [Debug] Transmission: Banned IP address "64.183.151.38" tried to connect to us
2011-08-02 04:16:28 -0400 peer-mgr.c:2074 [Debug] Transmission: Banned IP address "85.17.20.205" tried to connect to us
2011-08-02 04:16:29 -0400 torrent.c:515 [Debug] somevideo.wmv: Got 4 peers from tracker
[OTHER UNRELATED STUFF CUT]
2011-08-02 04:16:49 -0400 fdlimit.c:359 [Error] Transmission: Couldn't open "/Volumes/ExternalVol/Downloads/Torrent/ Incomplete": No such file or directory
2011-08-02 04:16:49 -0400 inout.c:100 [Error] somevideo.wmv: tr_fdFileCheckout failed for "/Volumes/ExternalVol/Downloads/Torrent/ Incomplete/somevideo.wmv.part": No such file or directory
2011-08-02 04:16:49 -0400 torrent.c:487 [Error] somevideo.wmv: No such file or directory (/Volumes/ExternalVol/Downloads/Torrent/somevideo.wmv)
2011-08-02 04:16:49 -0400 torrent.c:1677 [Info] somevideo.wmv: Pausing
2011-08-02 04:16:49 -0400 fdlimit.c:359 [Error] Transmission: Couldn't open "/Volumes/ExternalVol/Downloads/Torrent/ Incomplete": No such file or directory
2011-08-02 04:16:49 -0400 inout.c:100 [Error] somevideo.wmv: tr_fdFileCheckout failed for "/Volumes/ExternalVol/Downloads/Torrent/ Incomplete/somevideo.wmv.part": No such file or directory
2011-08-02 04:16:49 -0400 bencode.c:1721 [Info] Transmission: Saved "/Users/myuser/Library/Application Support/Transmission/Resume/somevideo.wmv.edc31157ee0d5b95.resume"

comment:20 Changed 10 years ago by keithlard

It does it every time I remove a completed download. I've had to move the 'incomplete' folder elsewhere for now or Transmission is unusable.

When I upgrade other programs I wonder what bugs the upgrade is going to fix. With Transmission, I wonder what new bugs it's going to introduce...

comment:21 Changed 10 years ago by cachapa

I'm having a similar problem, which might be related. I wanted to post it here before opening a new issue.

My torrent watch-dir is being deleted after all the downloads finish. I think this is because that directory is contained in the "incomplete dir".
In fact, all empty directories contained in the incomplete dir are deleted as soon as the downloads finish.

My dir tree is as follows:

/Downloads - Incomplete dir
/Downloads/Complete - Complete dir
/Downloads/Torrents - Watch dir

I realize that this is an unsafe configuration anyway, and I've now created a new directory under "Downloads" to hold the incomplete files.
However, it still seems to be a bug, which only started happening very recently - I only noticed it last week.
I suspect it might be due to the fix for the bug where sometimes after moving downloads to the completed folder, some empty folders would be left in the incoming directory.

I'm running Transmission 2.33

Last edited 10 years ago by cachapa (previous) (diff)

comment:22 Changed 10 years ago by x190

Last edited 10 years ago by x190 (previous) (diff)

comment:23 Changed 10 years ago by jordan

r12665: possible fix.

Could people experiencing this issue please give a nightly build of r12665 or higher a try?

comment:24 follow-up: Changed 10 years ago by x190

I'm guessing that "strcmp( d->d_name, ".." )" in Line 2712 and Line 2795 is the item that has the potential to cause trouble, so as long as you've taken care of that… (one level above)?

comment:25 Changed 10 years ago by x190

Where can we get a dmg for this? All d/l sites I know of are currently 5 days or more out of date.

comment:26 in reply to: ↑ 24 ; follow-up: Changed 10 years ago by jordan

Replying to x190:

I'm guessing that "strcmp( d->d_name, ".." )" in Line 2712 and Line 2795 is the item that has the potential to cause trouble, so as long as you've taken care of that… (one level above)?

I don't understand the question. Checking for "." and ".." is because readdir() will return those two as entries for cwd and parent... we don't want to treat those in the same way as we would other entries.

comment:27 in reply to: ↑ 26 ; follow-up: Changed 10 years ago by x190

Replying to jordan:

Replying to x190:

I'm guessing that "strcmp( d->d_name, ".." )" in Line 2712 and Line 2795 is the item that has the potential to cause trouble, so as long as you've taken care of that… (one level above)?

I don't understand the question. Checking for "." and ".." is because readdir() will return those two as entries for cwd and parent... we don't want to treat those in the same way as we would other entries.

Yet somehow, assuming the premise of this ticket is correct, the original code allowed the parent directory to be removed in certain cases, so as long as that has been dealt with, we should be good to go . :-)

comment:28 in reply to: ↑ 27 Changed 10 years ago by jordan

Replying to x190:

Replying to jordan:

Replying to x190:

I'm guessing that "strcmp( d->d_name, ".." )" in Line 2712 and Line 2795 is the item that has the potential to cause trouble, so as long as you've taken care of that… (one level above)?

I don't understand the question. Checking for "." and ".." is because readdir() will return those two as entries for cwd and parent... we don't want to treat those in the same way as we would other entries.

Yet somehow, assuming the premise of this ticket is correct, the original code allowed the parent directory to be removed in certain cases, so as long as that has been dealt with, we should be good to go . :-)

Well, obviously. What I'm saying is that I don't understand what that has to do with the ".." readdir entry.

comment:29 Changed 10 years ago by larkost

I am the one who submitted the post from comment 22 (found the forums, not the trac), and I think the missing element might be that it is not the moving of the completed payload from Incomplete to Downloads that triggers the problem, but rather the deleting of the payload from within the GUI that does it. I have this completely re-produceable on one computer, so if you need version numbers on anything I can provide.

I tried Build #4531 and the problem still manifested. I only had to delete the item from within the GUI (no new download needed) and it whisked away my Incomplete folder. I should note that I tried to work around this problem previously by putting a locked file in the Incomplete folder. But since the bug is actually using the "send to trash" method, it just moved the whole folder (still containing the locked file) into the trash.

comment:30 Changed 10 years ago by jordan

Build #4531 is from r12632, which predates the r12665 that I mentioned in comment:23. Could you try a newer build once build.transmissionbt.com gets updated?

comment:31 Changed 10 years ago by KyleK

The changes made in r12665-r12667 cause Transmission to delete any files that are completed on my machine.

My folder structure is the other way around from the OP:

The incomplete folder is /Hd_a2/Downloads The download folder is /Hd_a2/Downloads/#done (So the complete folder is a subfolder of the incomplete folder).

With the above commits, any torrent that completes vanishes into thin air. If the torrent contained directories, those will be created in /Hd_a2/Downloads/#done, but they will be empty.

Let me know if any additional information is required.

(I tried to debug, but alas, gdb and Transmission aren't friends on my NAS :/)

comment:32 Changed 10 years ago by jordan

aaaaaaargh :)

comment:33 Changed 10 years ago by jordan

KyleK: this seems to be fixed now in r12692, could you re-test?

comment:34 Changed 10 years ago by KyleK

Yes, r12692 seems to fix the issue I had.

comment:35 Changed 10 years ago by jordan

This issue seems to be fixed.

comment:36 Changed 10 years ago by jordan

  • Resolution set to fixed
  • Status changed from new to closed

Closing this ticket because it, and the regression its fix caused, both seem to be fixed.

Please reopen if you find a test case that I've missed. :)

Note: See TracTickets for help on using tickets.