NNTmux / newznab-tmux

Laravel based usenet indexer
GNU General Public License v3.0
210 stars 52 forks source link

Query error occurred. #1229

Closed ghost closed 2 years ago

ghost commented 2 years ago

This happens on updating binaries a lot. Tmux binaries pane shows: Query error occurred.. Can't find the actual error though.

The error gets thrown after update binaries hangs without output for a while. Sometimes more than a minute. No INSERT queries related to binaries shown in MariaDB when it hangs.

[2022-02-06 21:51:27] REMOVED.ERROR: #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/REMOVED/vendor/league/climate/src/Util/Writer/StdOut.php(14): fwrite()
#2 /var/www/REMOVED/vendor/league/climate/src/Util/Output.php(183): League\CLImate\Util\Writer\StdOut->write()
#3 /var/www/REMOVED/vendor/league/climate/src/TerminalObject/Router/BasicRouter.php(37): League\CLImate\Util\Output->write()
#4 /var/www/REMOVED/vendor/league/climate/src/TerminalObject/Router/Router.php(99): League\CLImate\TerminalObject\Router\BasicRouter->execute()
#5 /var/www/REMOVED/vendor/league/climate/src/CLImate.php(384): League\CLImate\TerminalObject\Router\Router->execute()
#6 /var/www/REMOVED/vendor/league/climate/src/CLImate.php(399): League\CLImate\CLImate->buildTerminalObject()
#7 /var/www/REMOVED/vendor/league/climate/src/CLImate.php(435): League\CLImate\CLImate->routeRemainingMethod()
#8 /var/www/REMOVED/Blacklight/ColorCLI.php(94): League\CLImate\CLImate->__call()
#9 /var/www/REMOVED/Blacklight/Binaries.php(997): Blacklight\ColorCLI->primary()
#10 /var/www/REMOVED/Blacklight/Binaries.php(686): Blacklight\Binaries->outputHeaderInitial()
#11 /var/www/REMOVED/misc/update/multiprocessing/.do_not_run/switch.php(117): Blacklight\Binaries->scan()
#12 {main}
egyptianbman commented 2 years ago

I'm seeing some groups taking a looooong time. They also fail to insert on the first run, then seem to succeed on the second run, when repairing:

Updated group alt.binaries.hdtv.x264                                                                                                                                                                           

Attempting to repair 20,000 parts.                                                                                                                                                                             
-                                                                                                                                                                                                              
0s to download articles, 0s to process collections, 0s to insert binaries/parts, 0s for part repair, 1s total.                                                                                                 
-                                                                                                                                                                                                              
514s to download articles, 19s to process collections, 0s to insert binaries/parts, 0s for part repair, 533s total.                                                                                            
-                                                                                                                                                                                                              
220s to download articles, 19s to process collections, 0s to insert binaries/parts, 0s for part repair, 239s total.                                                                                            
.                                                                                                                                                                                                              
483s to download articles, 22s to process collections, 0s to insert binaries/parts, 0s for part repair, 506s total.                                                                                            

20,000 parts repaired.                                                                                                                                                                                         
Updated group alt.binaries.hdtv.x264                                                                                                                                                                           

Received 20,000 articles of 20,000 requested, 0 blacklisted, 0 not yEnc.                                                                                                                                       
20000 articles failed to insert! [Blacklight\Binaries::scan]                                                                                                                                                   
2116s to download articles, 83s to process collections, 0s to insert binaries/parts, 0s for part repair, 2199s total.                                                                                          
Updated group alt.binaries.x264  813257342  813277341  77                                                                                                                                                      

This is in comparison to other groups that take no time to download and process 20k articles:

Received 20,000 articles of 20,000 requested, 0 blacklisted, 9066 not yEnc.                                                                                                                                    
0s to download articles, 0s to process collections, 0s to insert binaries/parts, 0s for part repair, 1s total.                                                                                                 
Updated group alt.binaries.dvd  6887535424  6887555423  8                                              

Received 20,000 articles of 20,000 requested, 0 blacklisted, 362 not yEnc.                                                                                                                                     
1s to download articles, 0s to process collections, 2s to insert binaries/parts, 0s for part repair, 4s total.                                                                                                 
Updated group alt.binaries.blu-ray  4457930149  4457950148  14                                                                                                                                                 

Received 20,000 articles of 20,000 requested, 0 blacklisted, 2021 not yEnc.                                                                                                                                    
0s to download articles, 0s to process collections, 3s to insert binaries/parts, 0s for part repair, 4s total.                                                                                                 
Updated group alt.binaries.multimedia  12393080493  12393100492  5                                                                                                                                             

I tried to dig into the nttp code but unfortunately, I'm not very familiar with how it all works. I tracked the delay to a while loop in Net_NNTP_Protocol_Client->_getTextResponse() but am not sure how to resolve the issue.

DariusIII commented 2 years ago

I noticed this behaviour, but it stopped on my end couple of days ago, so i am not sure what is the cause. Are you running latest master?

egyptianbman commented 2 years ago

I last updated on Feb 12. I just updated now to see if the latest upstream updates fix the issue for me as well. My suspicion is that the groups got hit with a massive load of spam that is taking a while to work through. If you got through it first, it would make sense because I ended up disabling my system for a few of days while I tried to debug the issues with part failures, etc.