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 sql
Controls ·  Search New posts · Mark unread

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

2022-08-03 21:17:32
STorrents2020:
My tracker is down too, everything red. I’ll help out once I sort that out too. Gotta love bugs that comes out of non-existence.  

MDR  🤣

not trouble, at least I'm not the only one to have this problem, thank you for your help, very much appreciated!  🤓
2022-08-26 21:33:40
Still no solution? lol
Last edited by spiritblue on 2022-08-26 21:33:57
2023-07-22 13:11:45
hello gang!

I made corrections to try to solve this damn problem with the announcement and after testing, I have no more error
I'm not perfect, so let me know if I forgot anything.
=================================

Allo gang !

J'ai fait des corrections pour tenter de résoudre ce maudit problème avec l'annonce et après testé, j'ai plus d'erreur
je ne suis pas parfait, donc faite le moi savoir si j'ai oublié de quoi.


Replace for:
////////////////// 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
   
mysqli_query("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)";
       }
   }

} else {

$ret = mysqli_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, passkey) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, ".time().", ".time().", '$seeder', {$user['id']}, " . sqlesc($agent) . "," . sqlesc($passkey) . ")");
   
   if ($ret){
       if ($seeder == "yes")
           $updateset[] = "seeders = seeders + 1";
       else
           $updateset[] = "leechers = leechers + 1";
   }
}

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


i have more sql errors and all my torrents are shared and working
================================
j'ai plus d'erreurs sql et tous mes torrents sont en partage et sont en fonction
announce.rar
Download

Last edited by spiritblue on 2023-07-22 13:14:47
2023-07-22 16:36:34
Cool. I never had any problems with mine, not sure why, but I have some code that I changed for some reason, I cant remember why. I think the count was a problem. I can only think that because I have alot of stuff commented. I comment old code rather than remove it in case I screw it up. Again, I cant remember why I did this, But I will post it for reference to read. I will attach mine if you want to compare in case it is useful in any way
I removed this
 if (count($updateset))
    SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");

I changed it to this at one point
 if (is_countable($updateset) && count($updateset))
    SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");

then researched some and fiddled around and I use this. Its seems ok I think. It just kind of covers either array or count. probably overthinking the whole thing really lol
if (is_array($updateset) || $updateset instanceof Countable) {
   $updatesCount = count($updateset);

   if ($updatesCount > 0) {
       $updatesString = join(",", $updateset);
       SQL_Query_exec("UPDATE torrents SET $updatesString WHERE id=$torrentid");
   }
}
announce.zip
Download

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 2023-07-22 16:57:31
2023-07-22 21:04:48
yess! cool!!


...I still have the same error with your file
Database Error in announce.php on line 375: Data too long for column 'client' at row 1. Query was: UPDATE peers SET ip = 'x.xxx.xx.xxx', passkey = 'e678fa713ab983b9482125b66e812085', port = 4323, uploaded = 0, downloaded = 0, to_go = 0, last_action = '2023-07-22 21:02:10', client = 'rtorrent/0.9.8/0.13.8', seeder = 'yes' WHERE torrent = 18816 AND peer_id = '-lt0D80-)c2(6wQ3��'.


if I change SQL_Query_exec for mysqli_query I have no more error and it works #1

    mysqli_query("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)";
       }
   }

} else {

   $ret = mysqli_query("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) . ")");

announce.rar
Download

Last edited by spiritblue on 2023-07-22 21:14:06
2023-07-22 21:11:50
have you tried setting varchar at 50 on your client table? extend the amount of the string that can be inputted?
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 2023-07-22 21:22:00
2023-07-22 21:17:05
Yes!

2023-07-22 21:20:02
houps ! It just gave an SQL error
Database Error in announce.php on line 341: BIGINT UNSIGNED value is out of range in '`no_name`.`users`.`uploaded` + 14254080'. Query was: UPDATE users SET uploaded = uploaded + 14254080 WHERE id=3351.
announce.rar
Download

Last edited by spiritblue on 2023-07-22 21:45:22
2023-07-22 21:28:03
hmm, well to be honest, using mysqli_query is probably the best method anyways. Its highly probable that we should eliminate sql_query exec anyways and use the built-in php code. We been relying on a function that does a function that php already does, so......
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 2023-07-22 21:29:48
2023-07-22 21:49:22
it took a while but the torrents turned red and no longer in seed, so it's not good yet
2023-07-22 21:55:39
I've tested both files and MicroMonkey's announce works flawlessly but it can't tell your announce Spiritblue, yours doesn't work unfortunately


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-07-22 22:21:50
I had to come back with the file that gives this error on all torrents  😂

Database Error in announce.php on line 341: Unknown column 'agent' in 'field list'. Query was: INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, passkey) VALUES ('no', 18428, '-lt0D80-3B����n\"��', '5.9.77.169', 45001, 0, 0, 0, 1690064319, 1690064319, 'yes', 166, 'rtorrent/0.9.8/0.13.8','40147e4d6a706dceda92206685eda7b9').


announce.rar
Download

Last edited by spiritblue on 2023-07-22 22:22:57
2023-07-22 22:27:31
just noticed, I dont speak french, but I think OUI means yes, and your client table should be NO (Non) for null on that table and default is blank, nada, zip, ziltch, zero, nothing, rien, vide. Perhaps that is an issue?
Screenshot 2023-07-22 183250.jpg
Screenshot 2023-07-22 183250.jpg

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 2023-07-22 22:37:35
2023-07-23 01:15:16
This is classic overflow behavior.

What happens, is if for some reason 1 or more values end up representing a negative value, and if not handled will produce a problem in most languages when expecting a non-negative integer.


$upthis = max(0, $data['uploaded'] - $peer_row['uploaded']);
$downthis = max(0, $data['downloaded'] - $peer_row['downloaded']);


This is how I handle it.
2023-07-23 04:39:08
I handed over announcement of MicroMonkey With modification to STorrents2020
I deleted the customer table and put them back to the original table

torrent en partage, mais j'ai une erreur sql
Database Error in announce.php on line 391: Data too long for column 'client' at row 1. Query was: INSERT INTO peers (connectable, torrent, peer_id, ip, passkey, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, client) VALUES ('no', 18837, '-lt0D60-������k� \n�', '212.32.243.206', 'aa9e435f906c460eb6059cd50215ddc5', 20024, 8427244272, 8710703856, 0, '2023-07-23 04:34:01', '2023-07-23 04:34:01', 'yes', '2887', 'rtorrent/0.9.6/0.13.6').


It repeats, but not from the same torrent id

*thanks for your help everyone!
announce.rar
Download

Last edited by spiritblue on 2023-07-23 04:41:19
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728