For issues related to the current stable release please use it's own Help forum.
IMPORTANT:Please read this before using an git or nightly build version: wiki.webtrees.net/en/GIT

Before asking for help please read "How to request help" by clicking on that tab above here.

TOPIC: [SOLVED] webtrees 2.0.0-alpha.5: SQL Error

webtrees 2.0.0-alpha.5: SQL Error 6 days 22 hours ago #1

  • Mithrandir
  • Mithrandir's Avatar
  • Offline
  • New
  • Posts: 3
Hello,

after uploading alpha.5 to my server I get the following error trying to open the site:

Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `wt_module_privacy` add constraint `wt_module_privacy_module_name_foreign` foreign key (`module_name`) references `wt_module` (`module_name`) on delete cascade) in file /vendor/illuminate/database/Connection.php on line 664
Stack trace:
  1. Illuminate\Database\QueryException->() /vendor/illuminate/database/Connection.php:664
  2. Doctrine\DBAL\Driver\PDOException->() /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119
  3. PDOException->() /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
  4. PDOStatement->execute() /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
  5. Doctrine\DBAL\Driver\PDOStatement->execute() /vendor/illuminate/database/Connection.php:458
  6. Illuminate\Database\Connection->Illuminate\Database\{closure}() /vendor/illuminate/database/Connection.php:657
  7. Illuminate\Database\Connection->runQueryCallback() /vendor/illuminate/database/Connection.php:624
  8. Illuminate\Database\Connection->run() /vendor/illuminate/database/Connection.php:459
  9. Illuminate\Database\Connection->statement() /vendor/illuminate/database/Schema/Blueprint.php:97
 10. Illuminate\Database\Schema\Blueprint->build() /vendor/illuminate/database/Schema/Builder.php:264
 11. Illuminate\Database\Schema\Builder->build() /vendor/illuminate/database/Schema/Builder.php:165
 12. Illuminate\Database\Schema\Builder->create() /app/Schema/Migration42.php:71
 13. Fisharebest\Webtrees\Schema\Migration42->upgrade() /app/Services/MigrationService.php:60
 14. Fisharebest\Webtrees\Services\MigrationService->updateSchema() /index.php:97

With alpha.4 everything worked fine.

System: CentOS Linux release 7.6.1810 (Core), PHP 7.2.16, MySQL 5.7.25-1, Apache 2.4.6-88
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: SQL Error 6 days 7 hours ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10825
Can you tell me the result of these two SQL queries:

SHOW CREATE TABLE wt_module;

SHOW CREATE TABLE wt_module_privacy;
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: SQL Error 5 days 23 hours ago #3

  • Mithrandir
  • Mithrandir's Avatar
  • Offline
  • New
  • Posts: 3
fisharebest wrote:
SHOW CREATE TABLE wt_module;
CREATE TABLE `wt_module` (
 `module_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
 `status` enum('enabled','disabled') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'enabled',
 `tab_order` int(11) DEFAULT NULL,
 `menu_order` int(11) DEFAULT NULL,
 `sidebar_order` int(11) DEFAULT NULL,
 `footer_order` int(11) DEFAULT NULL,
 PRIMARY KEY (`module_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

fisharebest wrote:
SHOW CREATE TABLE wt_module_privacy;
CREATE TABLE `wt_module_privacy` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `module_name` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
 `gedcom_id` int(11) NOT NULL,
 `interface` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `access_level` tinyint(4) NOT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `wt_module_privacy_gedcom_id_module_name_interface_unique` (`gedcom_id`,`module_name`,`interface`),
 UNIQUE KEY `wt_module_privacy_module_name_gedcom_id_interface_unique` (`module_name`,`gedcom_id`,`interface`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: SQL Error 5 days 22 hours ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10825
One table uses the MyISAM engine
One table uses the InnoDB engine

I guess you changed your database server configuration between the initial installation and the upgrade to alpha.5.

I recommend that you convert the table to InnoDB.
alter table wt_module engine=innodb;

If you have other tables with MyISAM, then I recommend that you also convert them to InnoDB.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

webtrees 2.0.0-alpha.5: SQL Error 5 days 19 hours ago #5

  • Mithrandir
  • Mithrandir's Avatar
  • Offline
  • New
  • Posts: 3
I changed the table to InnoDB and also the remaining 29 of 33 tables, I can login in now and the site works as it used to.

Thank you :)
The administrator has disabled public write access.

[SOLVED] webtrees 2.0.0-alpha.5: SQL Error 5 days 19 hours ago #6

  • Mithrandir
  • Mithrandir's Avatar
  • Offline
  • New
  • Posts: 3
Problem solved.
The administrator has disabled public write access.
Powered by Kunena Forum