Skip to content

Cannot install it(DB error) #3710

Open
Open

Description

@opt1mi

Describe the issue

I get a very large box of text on the migration step
Phinx by CakePHP - https://phinx.org. using config file core/migrations/phinx.php using config parser php using migration paths - /var/www/nameless/core/migrations warning no environment specified, defaulting to: nameless using adapter mysql using database nameless ordering by creation time == 20220517030607 CreateLanguagesTable: migrating == 20220517030607 CreateLanguagesTable: migrated 0.0193s == 20220517030609 CreateTemplatesTable: migrating == 20220517030609 CreateTemplatesTable: migrated 0.0164s == 20220517030611 CreateUsersTable: migrating == 20220517030611 CreateUsersTable: migrated 0.0990s == 20220517030657 CreateReactionsTable: migrating == 20220517030657 CreateReactionsTable: migrated 0.0160s == 20220518024302 CreatePanelTemplatesTable: migrating == 20220518024302 CreatePanelTemplatesTable: migrated 0.0187s == 20220518024945 CreateBlockedUsersTable: migrating == 20220518024945 CreateBlockedUsersTable: migrated 0.0741s == 20220518025652 CreateGroupsTable: migrating == 20220518025652 CreateGroupsTable: migrated 0.0191s == 20220518025817 CreateUsersGroupsTable: migrating == 20220518025817 CreateUsersGroupsTable: migrated 0.0748s == 20220518031216 CreateAlertsTable: migrating == 20220518031216 CreateAlertsTable: migrated 0.0633s == 20220518032305 CreateCustomAnnouncementsTable: migrating == 20220518032305 CreateCustomAnnouncementsTable: migrated 0.0243s == 20220518032919 CreateCustomPagesTable: migrating == 20220518032919 CreateCustomPagesTable: migrated 0.0199s == 20220518033833 CreateCustomPagesPermissionsTable: migrating == 20220518033833 CreateCustomPagesPermissionsTable: migrated 0.0665s == 20220518034729 CreateEmailErrorsTable: migrating == 20220518034729 CreateEmailErrorsTable: migrated 0.0560s == 20220518035532 CreateGroupsTemplatesTable: migrating == 20220518035532 CreateGroupsTemplatesTable: migrated 0.0557s == 20220518040058 CreateGroupSyncTable: migrating == 20220518040058 CreateGroupSyncTable: migrated 0.0601s == 20220518040456 CreateHooksTable: migrating == 20220518040456 CreateHooksTable: migrated 0.0191s == 20220518040806 CreateIpBansTable: migrating == 20220518040806 CreateIpBansTable: migrated 0.0638s == 20220519020719 CreateInfractionsTable: migrating == 20220519020719 CreateInfractionsTable: migrated 0.0941s == 20220519021237 CreateLogsTable: migrating == 20220519021237 CreateLogsTable: migrated 0.0219s == 20220519021711 CreateMcServersTable: migrating == 20220519021711 CreateMcServersTable: migrated 0.0196s == 20220519022400 CreateModulesTable: migrating == 20220519022400 CreateModulesTable: migrated 0.0265s == 20220519022945 CreateWidgetsTable: migrating == 20220519022945 CreateWidgetsTable: migrated 0.0172s == 20220519023439 CreatePrivacyTermsTable: migrating == 20220519023439 CreatePrivacyTermsTable: migrated 0.0190s == 20220519023748 CreateOauthTable: migrating == 20220519023748 CreateOauthTable: migrated 0.0172s == 20220519024247 CreateOauthUsersTable: migrating == 20220519024247 CreateOauthUsersTable: migrated 0.0815s == 20220519024833 CreateOnlineGuestsTable: migrating == 20220519024833 CreateOnlineGuestsTable: migrated 0.0250s == 20220519025351 CreatePageDescriptionsTable: migrating == 20220519025351 CreatePageDescriptionsTable: migrated 0.0209s == 20220519025851 CreatePrivateMessagesTable: migrating == 20220519025851 CreatePrivateMessagesTable: migrated 0.0814s == 20220519030416 CreatePrivateMessagesRepliesTable: migrating == 20220519030416 CreatePrivateMessagesRepliesTable: migrated 0.0695s == 20220519030902 CreatePrivateMessagesUsersTable: migrating == 20220519030902 CreatePrivateMessagesUsersTable: migrated 0.0941s == 20220519031223 CreateProfileFieldsTable: migrating == 20220519031223 CreateProfileFieldsTable: migrated 0.0200s == 20220519031732 CreateUsersProfileFieldsTable: migrating == 20220519031732 CreateUsersProfileFieldsTable: migrated 0.0736s == 20220519032328 CreateUsersSessionTable: migrating == 20220519032328 CreateUsersSessionTable: migrated 0.0600s == 20220519034124 CreateUsersIpsTable: migrating == 20220519034124 CreateUsersIpsTable: migrated 0.0588s == 20220519040344 CreateUsersAdminSessionTable: migrating == 20220519040344 CreateUsersAdminSessionTable: migrated 0.0623s == 20220519040925 CreateIntegrationsTable: migrating == 20220519040925 CreateIntegrationsTable: migrated 0.0186s == 20220519041811 CreateUsersIntegrationsTable: migrating == 20220519041811 CreateUsersIntegrationsTable: migrated 0.0783s == 20220519150540 CreatePlaceholdersSettingsTable: migrating == 20220519150540 CreatePlaceholdersSettingsTable: migrated 0.0624s == 20220519151124 CreateUsersPlaceholdersTable: migrating == 20220519151124 CreateUsersPlaceholdersTable: migrated 0.0566s == 20220519152021 CreateUserProfileWallPostsTable: migrating == 20220519152021 CreateUserProfileWallPostsTable: migrated 0.1027s == 20220519152346 CreateUserProfileWallPostsReactionsTable: migrating == 20220519152346 CreateUserProfileWallPostsReactionsTable: migrated 0.0771s == 20220519152544 CreateUserProfileWallPostsRepliesTable: migrating == 20220519152544 CreateUserProfileWallPostsRepliesTable: migrated 0.0544s == 20220519153135 CreateForumsTable: migrating == 20220519153135 CreateForumsTable: migrated 0.0481s == 20220519153136 CreateTopicsTable: migrating == 20220519153136 CreateTopicsTable: migrated 0.0959s == 20220519153137 CreatePostsTable: migrating == 20220519153137 CreatePostsTable: migrated 0.0673s == 20220519153139 CreateReportsTable: migrating == 20220519153139 CreateReportsTable: migrated 0.0739s == 20220519153651 CreateReportsCommentsTable: migrating == 20220519153651 CreateReportsCommentsTable: migrated 0.0622s == 20220519154102 CreateSettingsTable: migrating == 20220519154102 CreateSettingsTable: migrated 0.0199s == 20220519154314 CreateQueryErrorsTable: migrating == 20220519154314 CreateQueryErrorsTable: migrated 0.0190s == 20220519154440 CreateQueryResultsTable: migrating == 20220519154440 CreateQueryResultsTable: migrated 0.0612s == 20220519154832 CreateForumsLabelsTable: migrating == 20220519154832 CreateForumsLabelsTable: migrated 0.0186s == 20220519161304 CreateTopicsFollowingTable: migrating == 20220519161304 CreateTopicsFollowingTable: migrated 0.0720s == 20220519161539 CreateForumsPermissionsTable: migrating == 20220519161539 CreateForumsPermissionsTable: migrated 0.0608s == 20220519161812 CreateForumsReactionsTable: migrating == 20220519161812 CreateForumsReactionsTable: migrated 0.0833s == 20220519161954 CreateForumsTopicLabelsTable: migrating == 20220519161954 CreateForumsTopicLabelsTable: migrated 0.0160s == 20220525051321 CreateUuidCacheTable: migrating == 20220525051321 CreateUuidCacheTable: migrated 0.0185s == 20220525051337 CreateUsersUsernameHistoryTable: migrating == 20220525051337 CreateUsersUsernameHistoryTable: migrated 0.0608s == 20220602132634 NullablePostDate: migrating == 20220602132634 NullablePostDate: migrated 0.0591s == 20220609184529 MakeUsernameColumnNullableOnUserIntegrationsTable: migrating == 20220609184529 MakeUsernameColumnNullableOnUserIntegrationsTable: migrated 0.0508s == 20220612041555 DropGroupHtmlLgColumnOnGroupsTable: migrating == 20220612041555 DropGroupHtmlLgColumnOnGroupsTable: migrated 0.0042s == 20220620183016 AddModuleSettingsColumn: migrating == 20220620183016 AddModuleSettingsColumn: migrated 0.0561s == 20220620190645 MoveEmailSettingsToConfig: migrating == 20220620190645 MoveEmailSettingsToConfig: migrated 0.0023s == 20220805152044 ForumPostMediumText: migrating == 20220805152044 ForumPostMediumText: migrated 0.0624s == 20220805152052 PrivateMessageMediumText: migrating == 20220805152052 PrivateMessageMediumText: migrated 0.0844s == 20220805152101 CustomPageMediumText: migrating == 20220805152101 CustomPageMediumText: migrated 0.0413s == 20220805153842 LogInfoMediumText: migrating == 20220805153842 LogInfoMediumText: migrated 0.0403s == 20220805174255 SettingsValueText: migrating == 20220805174255 SettingsValueText: migrated 0.0454s == 20220807142446 AddUserSessionActivityColumns: migrating == 20220807142446 AddUserSessionActivityColumns: migrated 0.0835s == 20220807153708 DeleteAdminSessionTable: migrating == 20220807153708 DeleteAdminSessionTable: migrated 0.0174s == 20220921014904 CreateMemberListsTable: migrating == 20220921014904 CreateMemberListsTable: migrated 0.0233s == 20221010152624 AddIpToUserSessions: migrating == 20221010152624 AddIpToUserSessions: migrated 0.0294s == 20221230144555 ReportsReportedIdNullable: migrating == 20221230144555 ReportsReportedIdNullable: migrated 0.0286s == 20230114124352 UsersNightModeNullable: migrating == 20230114124352 UsersNightModeNullable: migrated 0.0702s == 20230121015140 AddAuthMeColumnsToUserTable: migrating == 20230121015140 AddAuthMeColumnsToUserTable: migrated 0.0289s == 20230206192726 CreateQueueTable: migrating == 20230206192726 CreateQueueTable: migrated 0.0721s == 20230301084250 AddOrderColumnToReactionsTable: migrating == 20230301084250 AddOrderColumnToReactionsTable: migrated 0.0239s == 20230302090631 AddImageColumnToPageDescriptionsTable: migrating == 20230302090631 AddImageColumnToPageDescriptionsTable: migrated 0.0251s == 20230304231334 DeleteUsersReputationColumn: migrating == 20230304231334 DeleteUsersReputationColumn: migrated 0.0360s == 20230611003455 AddCustomScoreColumnToReactionsTable: migrating == 20230611003455 AddCustomScoreColumnToReactionsTable: migrated 0.0257s == 20230613054745 RenameHighestReactionScoresMemberListProvider: migrating == 20230613054745 RenameHighestReactionScoresMemberListProvider: migrated 0.0045s == 20230908180037 CreateUsersNotificationPreferencesTable: migrating == 20230908180037 CreateUsersNotificationPreferencesTable: migrated 0.0627s == 20231121184810 AddContentRichToAlertsTable: migrating == 20231121184810 AddContentRichToAlertsTable: migrated 0.0259s == 20240309204948 AddPurifyBypassColumToAlertsTable: migrating == 20240309204948 AddPurifyBypassColumToAlertsTable: migrated 0.0241s == 20240616113453 AddSessionExpiryColumnToUsersSessionTable: migrating == 20240616113453 AddSessionExpiryColumnToUsersSessionTable: migrated 0.0263s == 20240714105154 RenameDeviceNameColumnUsersSessionTable: migrating == 20240714105154 RenameDeviceNameColumnUsersSessionTable: migrated 0.0278s == 20240714105702 AddServerIdColumnToReportsTable: migrating == 20240714105702 AddServerIdColumnToReportsTable: migrated 0.0939s == 20240720110121 ChangeWidgetsLocationLength: migrating == 20240720110121 ChangeWidgetsLocationLength: migrated 0.0239s == 20241201113419 AddPlaceholderOrderToPlaceholderSettingsTable: migrating == 20241201113419 AddPlaceholderOrderToPlaceholderSettingsTable: migrated 0.0262s == 20250319185504 UpdateForumTopicKeyCascades: migrating PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '3' at line 1 in /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:192 Stack trace: #0 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(192): PDO->exec() #1 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php(108): Phinx\Db\Adapter\PdoAdapter->execute() #2 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(626): Phinx\Db\Util\AlterInstructions->execute() #3 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(1001): Phinx\Db\Adapter\PdoAdapter->executeAlterSteps() #4 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(477): Phinx\Db\Adapter\PdoAdapter->executeActions() #5 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(420): Phinx\Db\Adapter\AdapterWrapper->executeActions() #6 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(151): Phinx\Db\Adapter\TimedOutputAdapter->executeActions() #7 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(719): Phinx\Db\Plan\Plan->execute() #8 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(627): Phinx\Db\Table->executeActions() #9 /var/www/nameless/core/migrations/20250319185504_update_forum_topic_key_cascades.php(16): Phinx\Db\Table->update() #10 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(108): UpdateForumTopicKeyCascades->change() #11 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(388): Phinx\Migration\Manager\Environment->executeMigration() #12 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(359): Phinx\Migration\Manager->executeMigration() #13 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate() #14 /var/www/nameless/vendor/symfony/console/Command/Command.php(298): Phinx\Console\Command\Migrate->execute() #15 /var/www/nameless/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run() #16 /var/www/nameless/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand() #17 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php(70): Symfony\Component\Console\Application->doRun() #18 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php(240): Phinx\Console\PhinxApplication->doRun() #19 /var/www/nameless/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php(124): Phinx\Wrapper\TextWrapper->executeRun() #20 /var/www/nameless/core/classes/Database/PhinxAdapter.php(118): Phinx\Wrapper\TextWrapper->getMigrate() #21 /var/www/nameless/core/installation/steps/ajax_initialise.php(6): PhinxAdapter::migrate() #22 /var/www/nameless/core/installation/installer.php(22): require('...') #23 /var/www/nameless/install.php(71): require('...') #24 {main}

NamelessMC Version

Development version

To Reproduce

  1. Get to the migration step on the installer

Expected Behaviour

For it to work

Screenshots

Image

Additional Information

Activity

  1. Derkades commented on Feb 13, 2026

    @Derkades
    Member

    The relevant part of the daunting huge wall of text:

    PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version

    Are you using a relatively modern version of MariaDB?

  2. opt1mi commented on Feb 13, 2026

    @opt1mi
    Author

    The relevant part of the daunting huge wall of text:

    PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version

    Are you using a relatively modern version of MariaDB?

    Yeah, just installed it today on my Debian Trixie server

  3. Hayzee55 commented on Feb 21, 2026

    @Hayzee55

    I also got the same error. I had to edit the update_forum_topic_key_cascades.php file slightly to make it compatible with the latest version of MariaDB, and I also edit the database slightly due to partial migration but dont remember the steps I took for that.

  4. Timeox2k commented on Mar 1, 2026

    @Timeox2k

    I got it running by replacing the content of this file:

    with:

    <?php
    
    declare(strict_types=1);
    
    use Phinx\Migration\AbstractMigration;
    
    final class UpdateForumTopicKeyCascades extends AbstractMigration
    {
        public function up(): void
        {
            $table = $this->table('nl2_topics');
    
            // 1. Manually find and drop the foreign key to bypass the Phinx MariaDB parser bug
            $row = $this->fetchRow("
                SELECT CONSTRAINT_NAME
                FROM information_schema.KEY_COLUMN_USAGE
                WHERE TABLE_SCHEMA = DATABASE()
                  AND TABLE_NAME = 'nl2_topics'
                  AND COLUMN_NAME = 'topic_last_user'
                  AND REFERENCED_TABLE_NAME IS NOT NULL
                LIMIT 1
            ");
    
            if ($row && !empty($row['CONSTRAINT_NAME'])) {
                $constraint = $row['CONSTRAINT_NAME'];
                // Forcing backticks prevents the syntax error near '3'
                $this->execute("ALTER TABLE `nl2_topics` DROP FOREIGN KEY `$constraint`");
            }
    
            // 2. Modify the column type/properties
            $table->changeColumn('topic_last_user', 'integer', ['length' => 11, 'null' => true, 'default' => null]);
            $table->update();
    
            // 3. Add the new cascading foreign key
            $table->addForeignKey('topic_last_user', 'nl2_users', 'id', ['delete' => 'SET_NULL', 'update' => 'CASCADE']);
            $table->update();
        }
    
        public function down(): void
        {
        }
    }
  5. opt1mi commented on Mar 20, 2026

    @opt1mi
    Author

    I got it running by replacing the content of this file:

    with:

    <?php
    
    declare(strict_types=1);
    
    use Phinx\Migration\AbstractMigration;
    
    final class UpdateForumTopicKeyCascades extends AbstractMigration
    {
        public function up(): void
        {
            $table = $this->table('nl2_topics');
    
            // 1. Manually find and drop the foreign key to bypass the Phinx MariaDB parser bug
            $row = $this->fetchRow("
                SELECT CONSTRAINT_NAME
                FROM information_schema.KEY_COLUMN_USAGE
                WHERE TABLE_SCHEMA = DATABASE()
                  AND TABLE_NAME = 'nl2_topics'
                  AND COLUMN_NAME = 'topic_last_user'
                  AND REFERENCED_TABLE_NAME IS NOT NULL
                LIMIT 1
            ");
    
            if ($row && !empty($row['CONSTRAINT_NAME'])) {
                $constraint = $row['CONSTRAINT_NAME'];
                // Forcing backticks prevents the syntax error near '3'
                $this->execute("ALTER TABLE `nl2_topics` DROP FOREIGN KEY `$constraint`");
            }
    
            // 2. Modify the column type/properties
            $table->changeColumn('topic_last_user', 'integer', ['length' => 11, 'null' => true, 'default' => null]);
            $table->update();
    
            // 3. Add the new cascading foreign key
            $table->addForeignKey('topic_last_user', 'nl2_users', 'id', ['delete' => 'SET_NULL', 'update' => 'CASCADE']);
            $table->update();
        }
    
        public function down(): void
        {
        }
    }

    Maybe try doing a PR with this, I think everyone would be happy with this update :p

  6. Timeox2k commented on Mar 21, 2026

    @Timeox2k

    Feel free doing so. I dont have the time to fully fork it, set it up, test it properly. I have not yet found any sideeffects but I dont want to confirm anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions