Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actualize_script.php PHP errors since 3 days when updating the feeds #3476

Closed
andreascschmidt opened this issue Feb 24, 2021 · 11 comments
Closed
Labels
Bug (confirmed) 🐞 issues that are reproducable Vote to close Maybe it's time to close that issue!

Comments

@andreascschmidt
Copy link

Since I believe 3 days I noted issues with my feed updating or well not properly updating.
I have a cronjob doing that for me calling

.... /public_html/app/actualize_script.php

I did run that command from command line and noted the following errors.

PHP Warning: Error while sending STMT_PREPARE packet. PID=406805 in ... /public_html/lib/Minz/Pdo.php on line 40

PHP Warning: DOMXPath::query(): Invalid expression in ... /public_html/lib/lib_phpQuery.php on line 1780
PHP Notice: Trying to get property 'length' of non-object in ... /public_html/lib/lib_phpQuery.php on line 1782
PHP Warning: Invalid argument supplied for foreach() in ... /public_html/lib/lib_phpQuery.php on line 1785

The server is running under ubuntu 20.04 with APACHE and NGinx. No config changes made, but Ubuntu did update the php versions around that time too.
I'm running on php 7.4

Side related question are there plans for PHP 8 support?
Thanks

@Frenzie
Copy link
Member

Frenzie commented Feb 24, 2021

1.18 supports PHP 8. There are a few minor remaining issues before an RC can be put out.

Your error suggests it might be something with your DB? Is there enough disk space and such?

@andreascschmidt
Copy link
Author

Hmm thanks a lot
I didn't think about the DB.
There is plenty of free space, but I noted that I had a max_connections of 70 and bumped that to 140 and max_user_connections from 30 to 60 in the /etc/mysql/my.cnf

So far that seems to have (hopefully not coincidental) worked.

Thanks a lot again.

@andreascschmidt
Copy link
Author

sorry that didnt do the job
just got those

PHP Warning: Error while sending STMT_PREPARE packet. PID=27500 in /public_html/lib/Minz/Pdo.php on line 40
PHP Fatal error: Uncaught Error: Call to a member function bindParam() on bool in /public_html/app/Models/CategoryDAO.php:189
Stack trace:
#0 /public_html/app/Models/Feed.php(483): FreshRSS_CategoryDAO->searchById(0)
#1 /public_html/app/Controllers/feedController.php(422): FreshRSS_Feed->cleanOldEntries()
#2 /public_html/app/Controllers/feedController.php(548): FreshRSS_feed_Controller::actualizeFeed(false, false, '1', NULL, false, 10)
#3 public_html/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction()
#4 /public_html/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction('actualizeAction')
#5 /public_html/lib/Minz/FrontController.php(81): Minz_Dispatcher->run()
#6 /public_html/app/Models/CategoryDAO.php on line 189
Results:

Warning: Error while sending STMT_PREPARE packet. PID=27500 in /public_html/lib/Minz/Pdo.php on line 40

checked for updates
ran mysqlcheck
of course rebooted the server

any ideas where to look further please?

@Frenzie
Copy link
Member

Frenzie commented Feb 24, 2021

@Alkarex knows a lot more about DBs than I do. Is there a log for the DB itself? With any luck it's more specific.

@andreascschmidt
Copy link
Author

db log only states
[Warning] Aborted connection 155 to db: 'rss' user: 'rss' host: 'localhost' (Got timeout reading communication packets)
[Warning] Aborted connection 238 to db: 'rss' user: 'rss' host: 'localhost' (Got timeout reading communication packets)

@Alkarex
Copy link
Member

Alkarex commented Feb 26, 2021

What is your MySQL config for:

show local variables like 'wait_timeout';

How many feeds do you have / how long time does actualize_script.php typically?

@Alkarex
Copy link
Member

Alkarex commented Feb 26, 2021

What address are you using for your database?
Check in ./FreshRSS/data/config.php

@andreascschmidt
Copy link
Author

andreascschmidt commented Feb 27, 2021

grep -i timeout my.cnf

wait_timeout=60
interactive_timeout=50

./FreshRSS/data/config.php

 'db' => 
  array (
    'type' => 'mysql',
    'host' => 'localhost',
    'user' => 'USER',
    'password' => 'PASSWORD',
    'base' => 'BASE',
    'prefix' => 'freshrss_',
    'connection_uri_params' => '',
    'pdo_options' => 

I have around 120 feeds

The script runs at most maybe 2 minutes but is usually quite faster.

sudo -u RSS /public_html/app/actualize_script.php 
FreshRSS starting feeds actualization at 2021-02-27T09:28:35+01:00
FreshRSS actualize USER1...
PHP Warning:  DOMXPath::query(): Invalid expression in /public_html/lib/lib_phpQuery.php on line 1780
PHP Notice:  Trying to get property 'length' of non-object in /public_html/lib/lib_phpQuery.php on line 1782
PHP Warning:  Invalid argument supplied for foreach() in /public_html/lib/lib_phpQuery.php on line 1785
FreshRSS actualize USER2...
FreshRSS actualize USER3...
FreshRSS actualization done for 3 users, using 22.00 MiB of memory, in 0 day(s), 0 hour(s), 0 minute(s) and 41 seconds.
Results: 
USER1 
Warning: DOMXPath::query(): Invalid expression in /public_html/lib/lib_phpQuery.php on line 1780
Notice: Trying to get property 'length' of non-object in /public_html/lib/lib_phpQuery.php on line 1782
Warning: Invalid argument supplied for foreach() in /public_html/lib/lib_phpQuery.php on line 1785
OK
USER2 OK
USER3 OK
End.

I'm checking if that USER1 which is my main user has some bad feeds.
I also noted that using the buttons Purge now & Optimize database under configuration settings and, Purge removed maybe 1000 articles but Optimize DB increased the DB size from 45MB to 51MB)

Current user 36 580 articles (51.42 MiB)
Purge now
Optimize database

Maybe some DB corruption?

@Alkarex
Copy link
Member

Alkarex commented Feb 27, 2021

The errors related to lib_phpQuery are probably due to an invalid CSS expression when retrieving full article content

@math-GH math-GH added the Bug (confirmed) 🐞 issues that are reproducable label Aug 28, 2022
@math-GH
Copy link
Contributor

math-GH commented Aug 28, 2022

Is it still an actual issue?

@math-GH math-GH added the Vote to close Maybe it's time to close that issue! label Aug 28, 2022
@andreascschmidt
Copy link
Author

andreascschmidt commented Sep 25, 2023

Sorry for that. It became an issue again when I moved to a new Ubuntu VPS and had the exact issue again, but could not recall what I did the last time to fix in the end. But now I did because I found my own entry here.

I'm not sure if it's related to the default HestiaCP MySQL config, but I had to change (again) the default values in /etc/mysql/my.cnf
to
max_connections=200
max_user_connections=120
wait_timeout=120
interactive_timeout=100
long_query_time=10

And restart the database. (systemctl restart mysql)
Then all was fine afterwards.

@Alkarex Alkarex closed this as completed Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug (confirmed) 🐞 issues that are reproducable Vote to close Maybe it's time to close that issue!
Projects
None yet
Development

No branches or pull requests

4 participants