ruTorrent icon indicating copy to clipboard operation
ruTorrent copied to clipboard

Retrackers Plugin "Remove Announce URLs" feature not working

Open ancientvamp opened this issue 3 years ago • 10 comments

Please complete the following tasks.

  • [X] Web browser cache cleared
  • [X] Link provided to install script if applicable
  • [X] Web browser, ruTorrent, PHP and OS version provided

Tell us about your environment

Firefox 113.0.1 ruTorrent 4.1.5 PHP 7.4.33 OS Debian 11

Tell us how you installed ruTorrent

Swizzin

Describe the bug

retrackers "Remove Announce URLs" feature is not working. Also when you add a torrent file that contains a tracker url you added in retracker to be removed, the torrent is being added in a stop state now.

Steps to reproduce

Go to retrackers plugin options, add a url you want to remove in Remove Announce Urls Box. Add a torrent file containing the tracker url you wanted removed

Expected behavior

retracker would check each torrent file added for the url i want remove and then remove them. The torrent would begin downloading afterwards.

Additional context

This plugin was last working fine for me when I was on rutorrent v4.1

ancientvamp avatar May 13 '23 22:05 ancientvamp

There were no changes between of the period of v4.1 and v4.1.5 which could have impacted this plugin.

Could you try something? nano /srv/rutorrent/plugins/retrackers/run.sh Remove the last character &. Save and retry. https://github.com/Novik/ruTorrent/blob/48933089370b667e8d3b19fb8f9b92bc6db5409d/plugins/retrackers/run.sh#L3

stickz avatar May 14 '23 08:05 stickz

Just tried that. Having the same issue. I could have been mistaken about rutorrent version it was last working for me. I know it was sometime in April I noticed the retrackers plugin last working for me. Could have been running rutorrent v4.0.4 at that time and just noticed yesterday when I upgraded rutorrent to v4.1.5.

ancientvamp avatar May 14 '23 08:05 ancientvamp

I took the retrackers plugin from v4.04 tree and installed it on rutorrent v4.1.5. It's working correctly now.

ancientvamp avatar May 14 '23 09:05 ancientvamp

There have been no changes to retrackers since v4.0.4 except for a translations file and version bump.

I highly suspect it's that & symbol causing a race condition. This tells the bash job to run in the background asynchronously against other tasks. If this is the case, it will reoccur again at random. The recommended course of action now that everything is working properly is to remove it.

Could you let me know if everything works correctly with that symbol removed? If so, I will release a hotfix tomorrow. There's no valid reason to have that symbol there. I think it was a developer error to silence output.

stickz avatar May 14 '23 12:05 stickz

With the current retrackers plugin v.4.0.4 that's working for me, after I removed that symbol, I restarted rtorrent / rutorrent. After I add a torrent file, it seems like the plugin crashes rtorrent. I get a bad response error message as shown on screenshot. rtorrent will not start again after a restart unless I either disable the retracker plugin or enter back that symbol. When I added that symbol back, I was able to restart rtorrent and everything worked correctly. bad

ancientvamp avatar May 14 '23 20:05 ancientvamp

What version of rTorrent did you install with swizzin? Repo, 0.9.8 or UDNS?

stickz avatar May 14 '23 22:05 stickz

I first noticed the plugin not working while on UDNS. I then tried rtorrent v0.9.8 and get the same issue. I have tried what you suggested regarding removing that symbol on retrackers plugin with rutorrent v4.1.5 for both rtorrent v0.9.8 and UDNS but the plugin still does not work. If I removed that symbol while using retrackers from v4.0.4 tree on rutorrent v4.1.5 for both rtorrent v0.9.8 and UDNS, I get the screenshot above message. So far for both rtorrent v0.9.8 and UDNS, If i use retrackers plugin from v4.0.4 tree with rutorrent v4.1.5, no editing, the plugin works fine. Been testing most of the day.

ancientvamp avatar May 14 '23 23:05 ancientvamp

Okay, thanks for trying. I will spin up a cloud server tomorrow. The next steps for testing are complex. If rTorrent is crashing, I will need to debug it using GDB to retrieve the stack trace. Then view the software code to determinate what is happening.

UDNS is the most stable rTorrent branch on swizzin. There are multiple software patches to improve stability.

stickz avatar May 15 '23 01:05 stickz

Hello!

After these changes, the plugin works for me again.

--- update.php	2023-07-16 19:08:18.000000000 +0300
+++ /var/www/rutorrent-4.17/plugins/retrackers/update.php	2023-07-30 17:00:01.328228323 +0300
@@ -5,7 +5,7 @@

 require_once( 'retrackers.php' );
 require_once( dirname(__FILE__)."/../../php/xmlrpc.php" );
-require_once( dirname(__FILE__)."/../../php/cache.php" );
+require_once( dirname(__FILE__)."/../../php/rtorrent.php" );

 function clearTracker($addition,$tracker)
 {
@@ -29,12 +29,15 @@
 	{
 		foreach( $group as $kt=>$trk )
 		{
-			if(in_array($trk,$todelete))
+			foreach ( $todelete as $kd )
 			{
-				unset($lst[$kg][$kt]);
-				if(!count($lst[$kg]))
+				if(stristr($trk,$kd))
+				{
+					unset($lst[$kg][$kt]);
+					if(!count($lst[$kg]))
 					unset($lst[$kg]);
-				$ret = true;
+					$ret = true;
+				}
 			}
 		}
 	}

dguskovv avatar Jul 30 '23 14:07 dguskovv

Looks good @dguskovv. You can submit a pull request to master.

stickz avatar Jul 30 '23 14:07 stickz