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

Latest Github throws error #3685

Closed
makitso opened this issue Jan 23, 2021 · 3 comments
Closed

Latest Github throws error #3685

makitso opened this issue Jan 23, 2021 · 3 comments

Comments

@makitso
Copy link
Collaborator

makitso commented Jan 23, 2021

Looks like this started with the location controller patch two days ago.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("webtrees_dev"."wt_place_location", CONSTRAINT "wt_place_location_parent_id_foreign" FOREIGN KEY ("parent_id") REFERENCES "wt_place_location" ("id") ON DELETE CASCADE ON UPDATE CASCADE) in /home/rob/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 Stack trace:
#0 /home/rob/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute()
#1 /home/rob/www/vendor/illuminate/database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /home/rob/www/vendor/illuminate/database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#3 /home/rob/www/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback()
#4 /home/rob/www/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run()
#5 /home/rob/www/vendor/illuminate/database/Connection.php(411): Illuminate\Database\Connection->statement()
#6 /home/rob/www/vendor/illuminate/database/Query/Builder.php(2706): Illuminate\Database\Connection->insert()
#7 /home/rob/www/app/Schema/Migration44.php(88): Illuminate\Database\Query\Builder->insertUsing()
#8 /home/rob/www/app/Services/MigrationService.php(69): Fisharebest\Webtrees\Schema\Migration44->upgrade()
#9 /home/rob/www/app/Http/Middleware/UpdateDatabaseSchema.php(56): Fisharebest\Webtrees\Services\MigrationService->updateSchema()
#10 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process()
#11 /home/rob/www/app/Http/Middleware/UseDebugbar.php(67): Middleland\Dispatcher->handle()
#12 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar->process()
#13 /home/rob/www/app/Http/Middleware/UseDatabase.php(117): Middleland\Dispatcher->handle()
#14 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process()
#15 /home/rob/www/app/Http/Middleware/BadBotBlocker.php(212): Middleland\Dispatcher->handle()
#16 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process()
#17 /home/rob/www/app/Http/Middleware/RegisterFactories.php(72): Middleland\Dispatcher->handle()
#18 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterFactories->process()
#19 /home/rob/www/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher->handle()
#20 /home/rob/www/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process()
#21 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process()
#22 /home/rob/www/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle()
#23 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process()
#24 /home/rob/www/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher->handle()
#25 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process()
#26 /home/rob/www/app/Http/Middleware/ReadConfigIni.php(69): Middleland\Dispatcher->handle()
#27 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process()
#28 /home/rob/www/app/Http/Middleware/SecurityHeaders.php(47): Middleland\Dispatcher->handle()
#29 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process()
#30 /home/rob/www/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle()
#31 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process()
#32 /home/rob/www/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher->handle()
#33 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process()
#34 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle()
#35 /home/rob/www/index.php(57): Middleland\Dispatcher->dispatch()
#36 {main} Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("webtrees_dev"."wt_place_location", CONSTRAINT "wt_place_location_parent_id_foreign" FOREIGN KEY ("parent_id") REFERENCES "wt_place_location" ("id") ON DELETE CASCADE ON UPDATE CASCADE) in /home/rob/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119 Stack trace:
#0 /home/rob/www/vendor/illuminate/database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute()
#1 /home/rob/www/vendor/illuminate/database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#2 /home/rob/www/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback()
#3 /home/rob/www/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run()
#4 /home/rob/www/vendor/illuminate/database/Connection.php(411): Illuminate\Database\Connection->statement()
#5 /home/rob/www/vendor/illuminate/database/Query/Builder.php(2706): Illuminate\Database\Connection->insert()
#6 /home/rob/www/app/Schema/Migration44.php(88): Illuminate\Database\Query\Builder->insertUsing()
#7 /home/rob/www/app/Services/MigrationService.php(69): Fisharebest\Webtrees\Schema\Migration44->upgrade()
#8 /home/rob/www/app/Http/Middleware/UpdateDatabaseSchema.php(56): Fisharebest\Webtrees\Services\MigrationService->updateSchema()
#9 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process()
#10 /home/rob/www/app/Http/Middleware/UseDebugbar.php(67): Middleland\Dispatcher->handle()
#11 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar->process()
#12 /home/rob/www/app/Http/Middleware/UseDatabase.php(117): Middleland\Dispatcher->handle()
#13 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process()
#14 /home/rob/www/app/Http/Middleware/BadBotBlocker.php(212): Middleland\Dispatcher->handle()
#15 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process()
#16 /home/rob/www/app/Http/Middleware/RegisterFactories.php(72): Middleland\Dispatcher->handle()
#17 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterFactories->process()
#18 /home/rob/www/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher->handle()
#19 /home/rob/www/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process()
#20 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process()
#21 /home/rob/www/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle()
#22 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process()
#23 /home/rob/www/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher->handle()
#24 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process()
#25 /home/rob/www/app/Http/Middleware/ReadConfigIni.php(69): Middleland\Dispatcher->handle()
#26 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process()
#27 /home/rob/www/app/Http/Middleware/SecurityHeaders.php(47): Middleland\Dispatcher->handle()
#28 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process()
#29 /home/rob/www/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle()
#30 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process()
#31 /home/rob/www/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher->handle()
#32 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process()
#33 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle()
#34 /home/rob/www/index.php(57): Middleland\Dispatcher->dispatch()
#35 {main} Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("webtrees_dev"."wt_place_location", CONSTRAINT "wt_place_location_parent_id_foreign" FOREIGN KEY ("parent_id") REFERENCES "wt_place_location" ("id") ON DELETE CASCADE ON UPDATE CASCADE) (SQL: insert into `wt_place_location` (`id`, `parent_id`, `place`, `latitude`, `longitude`) select `pl_id`, CASE pl_parent_id WHEN 0 THEN NULL ELSE pl_parent_id END, `pl_place`, REPLACE(REPLACE(pl_lati, 'S', '-'), 'N', ''), REPLACE(REPLACE(pl_long, 'W', '-'), 'E', '') from `wt_placelocation` left join `wt_place_location` on `id` = `pl_id` where `id` is null order by `pl_id` asc) in /home/rob/www/vendor/illuminate/database/Connection.php:664 Stack trace:
#0 /home/rob/www/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback()
#1 /home/rob/www/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run()
#2 /home/rob/www/vendor/illuminate/database/Connection.php(411): Illuminate\Database\Connection->statement()
#3 /home/rob/www/vendor/illuminate/database/Query/Builder.php(2706): Illuminate\Database\Connection->insert()
#4 /home/rob/www/app/Schema/Migration44.php(88): Illuminate\Database\Query\Builder->insertUsing()
#5 /home/rob/www/app/Services/MigrationService.php(69): Fisharebest\Webtrees\Schema\Migration44->upgrade()
#6 /home/rob/www/app/Http/Middleware/UpdateDatabaseSchema.php(56): Fisharebest\Webtrees\Services\MigrationService->updateSchema()
#7 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process()
#8 /home/rob/www/app/Http/Middleware/UseDebugbar.php(67): Middleland\Dispatcher->handle()
#9 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar->process()
#10 /home/rob/www/app/Http/Middleware/UseDatabase.php(117): Middleland\Dispatcher->handle()
#11 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process()
#12 /home/rob/www/app/Http/Middleware/BadBotBlocker.php(212): Middleland\Dispatcher->handle()
#13 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process()
#14 /home/rob/www/app/Http/Middleware/RegisterFactories.php(72): Middleland\Dispatcher->handle()
#15 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterFactories->process()
#16 /home/rob/www/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher->handle()
#17 /home/rob/www/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process()
#18 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process()
#19 /home/rob/www/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle()
#20 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process()
#21 /home/rob/www/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher->handle()
#22 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process()
#23 /home/rob/www/app/Http/Middleware/ReadConfigIni.php(69): Middleland\Dispatcher->handle()
#24 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process()
#25 /home/rob/www/app/Http/Middleware/SecurityHeaders.php(47): Middleland\Dispatcher->handle()
#26 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process()
#27 /home/rob/www/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle()
#28 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process()
#29 /home/rob/www/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher->handle()
#30 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process()
#31 /home/rob/www/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle()
#32 /home/rob/www/index.php(57): Middleland\Dispatcher->dispatch()
#33 {main}
@fisharebest
Copy link
Owner

OK - it looks like you have invalid (and hence unexpected) data in your wt_placelocation table.

I'll need to update the migration script.

Could you let me have a copy (e.g.mysqldump) of this one table so I can use it for testing?

@makitso
Copy link
Collaborator Author

makitso commented Jan 24, 2021

Sorry, still throws error after todays git update. Tried deleting wt_place_location but no difference

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ("webtrees_dev"."wt_place_location", CONSTRAINT "wt_place_location_parent_id_foreign" FOREIGN KEY ("parent_id") REFERENCES "wt_place_location" ("id") ON DELETE CASCADE ON UPDATE CASCADE) in /home/rob/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:

@makitso makitso reopened this Jan 24, 2021
@makitso
Copy link
Collaborator Author

makitso commented Jan 24, 2021

I did an export geoJSON of the places data and then did an import with options: Delete existing data and Add new and update existing records. Once complete I am then able to access the data.

@makitso makitso closed this as completed Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants