Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
error announce
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2021-08-15 16:44:41
Hey gang !

Hello I have had this error for some time and tried to fix it but it comes back, thanks in advance for your help.

Here l'error SQL:
Database Error in announce.php on line 370: BIGINT UNSIGNED value is out of range in '`XXXXX`.`torrents`.`leechers` - 1'. Query was: UPDATE torrents SET times_completed = times_completed + 1,seeders = seeders + 1,leechers = leechers - 1,visible = 'yes',last_action = '2021-08-15 15:32:50' WHERE id=14304.

Last edited by spiritblue on 2021-08-15 16:45:42
2021-08-15 17:18:22
It is when seeders and leeches is below 0

I noticed this before in Micromonkeys edition which you could try added to updateset array

$updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
 
2021-08-15 18:12:14
I have v3 Here
...a big thank you M-jay, I test and get back to you if it persists   :angel
Last edited by spiritblue on 2021-08-15 18:16:54
2021-08-15 19:43:16
hmm, nothing in the database on my announce has a BIGINT value. Perhaps you made a change to your database at some point?
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2021-08-16 01:46:54
allo
no nothing modify the SQL table to announce
and error returns even with the modification:

Database Error in announce.php on line 373: BIGINT UNSIGNED value is out of range in '`xxxx`.`torrents`.`leechers` - 1'. Query was: UPDATE torrents SET times_completed = times_completed + 1,seeders = seeders + 1,leechers = leechers - 1,visible = 'yes',leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END) WHERE id=14261.


my modification:
// SEEDED, LETS MAKE IT VISIBLE THEN
if ($seeder == "yes") {
   if ($torrent["banned"] != "yes") // DONT MAKE BANNED ONES VISIBLE
   $updateset[] = "visible = 'yes'";
   #$updateset[] = "last_action = '".get_date_time()."'";
$updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
}

// NOW WE UPDATE THE TORRENT AS PER ABOVE
#if (count($updateset))
   #SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid") or err("Erreur de suivi : impossible de mettre à jour torrent");

if (count($updateset))
   SQL_Query_exec("UPDATE torrents SET " .join(",", $updateset). " WHERE id=$torrentid") or err("Erreur du tracker: impossible de mettre a jour le torrent") or die(mysqli_error($GLOBALS["DBconnector"]));
   #SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid") or die(mysqli_error($GLOBALS["DBconnector"]));

// NOW BENC THE DATA AND SEND TO CLIENT???
benc_resp_raw($resp);
mysqli_close($GLOBALS["DBconnector"]);

Last edited by spiritblue on 2021-08-16 01:47:43
2021-08-16 14:03:54
Here is the announce I saw

https://github.com/D3monCoder/TORRENTTRADER-V2.08-MICRO-EDITION/blob/master/upload/announce.php

Around lines 388 and 410

You could change table columns  to allow negative numbers but I would see if the code edits work first.
2021-08-16 16:43:46
This is a fault in the TT announce logic. I had it too, I no longer have it at all.

Your best to change your column type to TEXT if not updating the PHP code to use  conditional integer checks.
2021-08-16 22:10:33
thank you M-jay

I made the updates of the lines to ask and more, I will get back to you if problem.

////////////////// NOW WE DO THE TRACKER EVENT UPDATES ///////////////////

if ($event == "stopped") { // UPDATE "STOPPED" EVENT
       SQL_Query_exec("DELETE FROM peers WHERE $selfwhere");
       if (mysqli_affected_rows($GLOBALS["DBconnector"])){
           if ($self["seeder"] == "yes")
$updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
               #$updateset[] = "seeders = seeders - 1";
           else
$updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
               #$updateset[] = "leechers = leechers - 1";
       }
}

if ($event == "completed") { // UPDATE "COMPLETED" EVENT    
   $updateset[] = "times_completed = times_completed + 1";

if ($MEMBERSONLY)
   {
   SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");
   SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `completed` = '1' WHERE `tid` = '$torrentid' AND `uid` = '$userid' AND `utime` = '" . gmtime() . "'");
   }
}//END COMPLETED

if (isset($self)){// NO EVENT? THEN WE MUST BE A NEW PEER OR ARE NOW SEEDING A COMPLETED TORRENT
   
   SQL_Query_exec("UPDATE peers SET ip = " . sqlesc($ip) . ", passkey = " . sqlesc($passkey) . ", port = $port, uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = '".get_date_time()."', client = " . sqlesc($agent) . ", seeder = '$seeder' WHERE $selfwhere");

   if (mysqli_affected_rows($GLOBALS["DBconnector"]) && $self["seeder"] != $seeder){
       if ($seeder == "yes"){
           $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
           $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
           #$updateset[] = "seeders = seeders + 1";
           #$updateset[] = "leechers = leechers - 1";
       } else {
           $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
           $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
           #$updateset[] = "seeders = seeders - 1";
           #$updateset[] = "leechers = leechers + 1";
       }
   }

} else {

   $ret = SQL_Query_exec("INSERT INTO peers (connectable, torrent, peer_id, ip, passkey, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, client) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", " . sqlesc($passkey) . ", $port, $uploaded, $downloaded, $left, '".get_date_time()."', '".get_date_time()."', '$seeder', '$userid', " . sqlesc($agent) . ")");
// Mod Snatched
   if ( ($MEMBERSONLY) && (($seeder == 'no' && $torrent['freeleech'] == 0)) ) {
   SQL_Query_exec("INSERT INTO `snatched` (`uid`, `tid`, `stime`, `utime`) VALUES ('$userid', '$torrentid', '".gmtime()."', '".gmtime()."') ON DUPLICATE KEY UPDATE `utime` = '" . gmtime() . "'");
   }
   ///  
   if ($ret){
       if ($seeder == "yes")
           #$updateset[] = "seeders = seeders + 1";
   $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
       else
           #$updateset[] = "leechers = leechers + 1";
   $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
   }
}

//////////////////    END TRACKER EVENT UPDATES ///////////////////


for the moment the torrents will be my wish to all come back  :smile
Last edited by spiritblue on 2021-08-16 22:15:27
2021-08-16 22:12:46
thank you STorrents2020, but yes I update but the forums of tt this lose and I lose the updates, dous I made this update.

no need to change type to text, but thank you very much for your help
2021-08-17 08:09:14
M-jay, all torrent in seed, problem solved!
Thanks a lot for your help.   :thumb  :smile
Last edited by spiritblue on 2021-08-17 08:09:32
2021-08-27 18:45:18
My personal copy of V3 micro edition has always had this. The copy on github was direct conversion of the 2.08svn without any modifications other than the necessary modifications to operate under php 7+. Maybe I should go ahead and update the announce file in that copy to avoid future confusions. Github announce file updated
////////////////// NOW WE DO THE TRACKER EVENT UPDATES ///////////////////

if ($event == "stopped") { // UPDATE "STOPPED" EVENT
       SQL_Query_exec("DELETE FROM peers WHERE $selfwhere");
       if (mysqli_affected_rows($GLOBALS["DBconnector"])){
           if ($self["seeder"] == "yes")
               $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
           else
                $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
       }
}

if ($event == "completed") { // UPDATE "COMPLETED" EVENT    
   $updateset[] = "times_completed = times_completed + 1";

if ( $MEMBERSONLY )
{
SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");
//uncomment below if using snatched table
//SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `completed` = '1' WHERE `tid` = '$torrentid' AND `uid` = '$userid' AND `utime` = '" . gmtime() . "'");
}
}//END COMPLETED

if (isset($self)){// NO EVENT? THEN WE MUST BE A NEW PEER OR ARE NOW SEEDING A COMPLETED TORRENT
   
   SQL_Query_exec("UPDATE peers SET ip = " . sqlesc($ip) . ", passkey = " . sqlesc($passkey) . ", port = $port, uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = '".get_date_time()."', client = " . sqlesc($agent) . ", seeder = '$seeder' WHERE $selfwhere");

   if (mysqli_affected_rows($GLOBALS["DBconnector"]) && $self["seeder"] != $seeder){
       if ($seeder == "yes"){
           $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
            $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
       } else {
           $updateset[] = "seeders = (CASE WHEN (seeders < 1) THEN 0 ELSE (seeders - 1) END)";
           $updateset[] = "leechers = (CASE WHEN (leechers < 1) THEN 0 ELSE (leechers - 1) END)";
       }
   }

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-08-28 13:13:57
2021-08-29 11:55:42
thanks MicroMonkey, indeed you should make the correction.  :thumb
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 8
  • Members: 0
  • Guests online: 8
  • Comments: 3
  • Messages: 1,728