friendica / friendica-directory

Global directory for the Friendica project. The repository has moved to git.friendi.ca/friendica/friendica-directory
GNU Affero General Public License v3.0
20 stars 11 forks source link

Support: Is my DB broken? Cron jobs aren't running appropriately. #56

Closed realkinetix closed 3 years ago

realkinetix commented 3 years ago

socialdir.isurf.ca has over 10,000 records in the profile_poll_queue, so in having a look at the logs, I see these in the 'app.log':

2020-09-13 23:46:02 - ERROR {"uid":"a509cb1"}: SQLSTATE[HY000]: General error: 1364 Field 'path' doesn't have a default value: #0 /var/www/clients/client2/web33/web/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() #1 /var/www/clients/client2/web33/web/src/classes/Pollers/Server.php(107): Atlas\Pdo\Connection->perform('INSERT INTO `se...', Array) #2 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(148): Friendica\Directory\Pollers\Server->__invoke('http://164.41.7...') #3 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(77): Friendica\Directory\Controllers\Cron->pollServers(24) #4 /var/www/clients/client2/web33/web/bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() #5 {main} []
2020-09-13 23:46:02 - ERROR {"uid":"a509cb1"}: SQLSTATE[HY000]: General error: 1364 Field 'path' doesn't have a default value: #0 /var/www/clients/client2/web33/web/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() #1 /var/www/clients/client2/web33/web/src/classes/Pollers/Server.php(107): Atlas\Pdo\Connection->perform('INSERT INTO `se...', Array) #2 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(148): Friendica\Directory\Pollers\Server->__invoke('https://f.decoh...') #3 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(77): Friendica\Directory\Controllers\Cron->pollServers(24) #4 /var/www/clients/client2/web33/web/bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() #5 {main} []
2020-09-13 23:46:03 - ERROR {"uid":"a509cb1"}: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `c2socialdir`.`profile`.`available` at row 1: #0 /var/www/clients/client2/web33/web/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() #1 /var/www/clients/client2/web33/web/src/classes/Pollers/Profile.php(224): Atlas\Pdo\Connection->perform('INSERT INTO `pr...', Array) #2 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(203): Friendica\Directory\Pollers\Profile->__invoke('https://social....') #3 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(79): Friendica\Directory\Controllers\Cron->pollProfiles(58) #4 /var/www/clients/client2/web33/web/bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() #5 {main} []
2020-09-13 23:46:04 - ERROR {"uid":"a509cb1"}: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `c2socialdir`.`profile`.`available` at row 1: #0 /var/www/clients/client2/web33/web/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() #1 /var/www/clients/client2/web33/web/src/classes/Pollers/Profile.php(224): Atlas\Pdo\Connection->perform('INSERT INTO `pr...', Array) #2 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(203): Friendica\Directory\Pollers\Profile->__invoke('https://social....') #3 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(79): Friendica\Directory\Controllers\Cron->pollProfiles(58) #4 /var/www/clients/client2/web33/web/bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() #5 {main} []
2020-09-13 23:46:05 - ERROR {"uid":"a509cb1"}: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `c2socialdir`.`profile`.`available` at row 1: #0 /var/www/clients/client2/web33/web/vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() #1 /var/www/clients/client2/web33/web/src/classes/Pollers/Profile.php(224): Atlas\Pdo\Connection->perform('INSERT INTO `pr...', Array) #2 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(203): Friendica\Directory\Pollers\Profile->__invoke('https://social....') #3 /var/www/clients/client2/web33/web/src/classes/Controllers/Cron.php(79): Friendica\Directory\Controllers\Cron->pollProfiles(58) #4 /var/www/clients/client2/web33/web/bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() #5 {main} []

and these are regular but not every minute in the cron.log:

[13-Sep-2020 22:52:08 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/clients/client2/web33/web/src/classes/Utils/Scrape.php on line 26
[13-Sep-2020 22:52:08 UTC] PHP Warning:  Illegal string offset 'tags' in /var/www/clients/client2/web33/web/src/classes/Utils/Scrape.php on line 33
[13-Sep-2020 22:52:08 UTC] PHP Warning:  Cannot assign an empty string to a string offset in /var/www/clients/client2/web33/web/src/classes/Utils/Scrape.php on line 33
[13-Sep-2020 22:52:08 UTC] PHP Warning:  Illegal string offset '_timings' in /var/www/clients/client2/web33/web/src/classes/Utils/Scrape.php on line 37
[13-Sep-2020 22:52:08 UTC] PHP Notice:  Array to string conversion in /var/www/clients/client2/web33/web/src/classes/Utils/Scrape.php on line 37
[13-Sep-2020 22:52:08 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/clients/client2/web33/web/src/classes/Pollers/Profile.php on line 144

Should I purge the rows in the profile_poll_queue? (And/or maybe the server_poll_queue, which has 792 rows in it)?

or... maybe there's something else to fix.

realkinetix commented 3 years ago

Let me ask this - is it better to just purge the DB and start re-populating it fresh, or to start digging in to things?

MrPetovan commented 3 years ago

Yes, you can do that. No data is irrecoverable in the directory database.

realkinetix commented 3 years ago

I think we can close this - after a DB refresh and things got back on track, this doesn't appear to be an issue any longer.