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

DB error: 1364 Field 'path' doesn't have a default value #47

Closed AlfredSK closed 3 years ago

AlfredSK commented 4 years ago

I had a look at the log of my directory instance and found a lot of DB errors because the field 'path' doesn't have a default value.

ERROR {"uid":"4b22814"}: SQLSTATE[HY000]: General error: 1364 Field 'path' doesn't have a default value: 
#0 .../vendor/atlas/pdo/src/Connection.php(138): PDOStatement->execute() 
#1 .../src/classes/Pollers/Server.php(106): Atlas\Pdo\Connection->perform('INSERT INTO `se...', Array) 
#2 .../src/classes/Controllers/Cron.php(148): Friendica\Directory\Pollers\Server->__invoke('https://sendero...') 
#3 .../src/classes/Controllers/Cron.php(77): Friendica\Directory\Controllers\Cron->pollServers(24) 
#4 .../bin/cron.php(22): Friendica\Directory\Controllers\Cron->execute() 
#5 {main} []

Directory 2.3.1 (but showing 2.3.0 at the page footer) PHP 7.3 MariaDB 10.3 Database schema migrated to version 5

realkinetix commented 3 years ago

After a bit of grepping and trying to figure out if/when/how/why there should be data in the path column, I've removed the column. That's got me on to the next issue, I think. I will likely have to file a bug for the next bit.

I have the feeling something's off with the db schema presently?

MrPetovan commented 3 years ago

It's entirely possible, what's the bug you are talking about?

realkinetix commented 3 years ago

Oh, heh! Perhaps I should have followed up on this one. The other issue is #48 - and I'm not sure that one has anything to do with the schema at all.

MrPetovan commented 3 years ago

The solution is to add a default value to the field. I'm preparing a new database migration version that drops this field and it will fail if the field doesn't exist anymore.