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

zikula:install:finish fails, missing table 'groups' #4762

Closed
tacman opened this issue Oct 13, 2021 · 4 comments · Fixed by #4805
Closed

zikula:install:finish fails, missing table 'groups' #4762

tacman opened this issue Oct 13, 2021 · 4 comments · Fixed by #4805
Labels
Milestone

Comments

@tacman
Copy link

tacman commented Oct 13, 2021

Expected behaviour - What did you expect to happen?

Fails during zikula:install:finish

Current behavior - What happened instead?

error-free installation

Possible solution

Confirm that the 'groups' table is created during :start.

Steps to reproduce

run install:start, then run install:finish
                                                                                                   

 Zikula Users Module
 Installing Zikula Users Module

In ToolsException.php line 34:
                                                                                                                                                                                                                                                     
  [Doctrine\ORM\Tools\ToolsException]                                                                                                                                                                                                                
  Schema-Tool failed with Error 'An exception occurred while executing 'ALTER TABLE group_membership ADD CONSTRAINT FK_5132B3374C397118 FOREIGN KEY (gid) REFERENCES "groups" (gid) NOT DEFERRABLE INITIALLY IMMEDIATE':                             
                                                                                                                                                                                                                                                     
  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "groups" does not exist' while executing DDL: ALTER TABLE group_membership ADD CONSTRAINT FK_5132B3374C397118 FOREIGN KEY (gid) REFERENCES "groups" (gid) NOT DEFERRABLE INITIALLY IMMEDIATE  
                                                                                                                                                                                                                                                     

Exception trace:
  at /home/tac/survos/demos/core/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php:34
 Doctrine\ORM\Tools\ToolsException::schemaToolFailure() at /home/tac/survos/demos/core/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:99
 Doctrine\ORM\Tools\SchemaTool->createSchema() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/Doctrine/Helper/SchemaHelper.php:49
 Zikula\Bundle\CoreBundle\Doctrine\Helper\SchemaHelper->create() at /home/tac/survos/demos/core/src/system/UsersModule/UsersModuleInstaller.php:34
 Zikula\UsersModule\UsersModuleInstaller->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/CoreInstallerExtensionHelper.php:109
 Zikula\Bundle\CoreInstallerBundle\Helper\CoreInstallerExtensionHelper->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:138
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->executeStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:189
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->handleAjaxStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Command/Install/FinishCommand.php:89
 Zikula\Bundle\CoreInstallerBundle\Command\Install\FinishCommand->execute() at /home/tac/survos/demos/core/vendor/symfony/console/Command/Command.php:299
 Symfony\Component\Console\Command\Command->run() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:996
 Symfony\Component\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:295
 Symfony\Component\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at /home/tac/survos/demos/core/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:56
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /home/tac/survos/demos/core/vendor/autoload_runtime.php:35
 require_once() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/bin/console:17

In AbstractPostgreSQLDriver.php line 82:
                                                                                                                                                                                           
  [Doctrine\DBAL\Exception\TableNotFoundException]                                                                                                                                         
  An exception occurred while executing 'ALTER TABLE group_membership ADD CONSTRAINT FK_5132B3374C397118 FOREIGN KEY (gid) REFERENCES "groups" (gid) NOT DEFERRABLE INITIALLY IMMEDIATE':  
                                                                                                                                                                                           
  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "groups" does not exist                                                                                                             
                                                                                                                                                                                           

Exception trace:
  at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php:82
 Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182
 Doctrine\DBAL\DBALException::wrapException() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:159
 Doctrine\DBAL\DBALException::driverExceptionDuringQuery() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:2225
 Doctrine\DBAL\Connection->handleExceptionDuringQuery() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1312
 Doctrine\DBAL\Connection->executeQuery() at /home/tac/survos/demos/core/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:97
 Doctrine\ORM\Tools\SchemaTool->createSchema() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/Doctrine/Helper/SchemaHelper.php:49
 Zikula\Bundle\CoreBundle\Doctrine\Helper\SchemaHelper->create() at /home/tac/survos/demos/core/src/system/UsersModule/UsersModuleInstaller.php:34
 Zikula\UsersModule\UsersModuleInstaller->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/CoreInstallerExtensionHelper.php:109
 Zikula\Bundle\CoreInstallerBundle\Helper\CoreInstallerExtensionHelper->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:138
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->executeStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:189
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->handleAjaxStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Command/Install/FinishCommand.php:89
 Zikula\Bundle\CoreInstallerBundle\Command\Install\FinishCommand->execute() at /home/tac/survos/demos/core/vendor/symfony/console/Command/Command.php:299
 Symfony\Component\Console\Command\Command->run() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:996
 Symfony\Component\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:295
 Symfony\Component\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at /home/tac/survos/demos/core/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:56
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /home/tac/survos/demos/core/vendor/autoload_runtime.php:35
 require_once() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/bin/console:17

In Exception.php line 18:
                                                                                
  [Doctrine\DBAL\Driver\PDO\Exception (42P01)]                                  
  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "groups" does not exist  
                                                                                

Exception trace:
  at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
 Doctrine\DBAL\Driver\PDO\Exception::new() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:139
 Doctrine\DBAL\Driver\PDOConnection->doQuery() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOQueryImplementation.php:24
 Doctrine\DBAL\Driver\PDOConnection->query() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1308
 Doctrine\DBAL\Connection->executeQuery() at /home/tac/survos/demos/core/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:97
 Doctrine\ORM\Tools\SchemaTool->createSchema() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/Doctrine/Helper/SchemaHelper.php:49
 Zikula\Bundle\CoreBundle\Doctrine\Helper\SchemaHelper->create() at /home/tac/survos/demos/core/src/system/UsersModule/UsersModuleInstaller.php:34
 Zikula\UsersModule\UsersModuleInstaller->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/CoreInstallerExtensionHelper.php:109
 Zikula\Bundle\CoreInstallerBundle\Helper\CoreInstallerExtensionHelper->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:138
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->executeStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:189
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->handleAjaxStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Command/Install/FinishCommand.php:89
 Zikula\Bundle\CoreInstallerBundle\Command\Install\FinishCommand->execute() at /home/tac/survos/demos/core/vendor/symfony/console/Command/Command.php:299
 Symfony\Component\Console\Command\Command->run() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:996
 Symfony\Component\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:295
 Symfony\Component\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at /home/tac/survos/demos/core/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:56
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /home/tac/survos/demos/core/vendor/autoload_runtime.php:35
 require_once() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/bin/console:17

In PDOConnection.php line 137:
                                                                                
  [PDOException (42P01)]                                                        
  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "groups" does not exist  
                                                                                

Exception trace:
  at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:137
 PDO->query() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:137
 Doctrine\DBAL\Driver\PDOConnection->doQuery() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOQueryImplementation.php:24
 Doctrine\DBAL\Driver\PDOConnection->query() at /home/tac/survos/demos/core/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1308
 Doctrine\DBAL\Connection->executeQuery() at /home/tac/survos/demos/core/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:97
 Doctrine\ORM\Tools\SchemaTool->createSchema() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/Doctrine/Helper/SchemaHelper.php:49
 Zikula\Bundle\CoreBundle\Doctrine\Helper\SchemaHelper->create() at /home/tac/survos/demos/core/src/system/UsersModule/UsersModuleInstaller.php:34
 Zikula\UsersModule\UsersModuleInstaller->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/CoreInstallerExtensionHelper.php:109
 Zikula\Bundle\CoreInstallerBundle\Helper\CoreInstallerExtensionHelper->install() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:138
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->executeStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Helper/StageHelper.php:189
 Zikula\Bundle\CoreInstallerBundle\Helper\StageHelper->handleAjaxStage() at /home/tac/survos/demos/core/src/Zikula/CoreInstallerBundle/Command/Install/FinishCommand.php:89
 Zikula\Bundle\CoreInstallerBundle\Command\Install\FinishCommand->execute() at /home/tac/survos/demos/core/vendor/symfony/console/Command/Command.php:299
 Symfony\Component\Console\Command\Command->run() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:996
 Symfony\Component\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:295
 Symfony\Component\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/tac/survos/demos/core/vendor/symfony/console/Application.php:167
 Symfony\Component\Console\Application->run() at /home/tac/survos/demos/core/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:56
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /home/tac/survos/demos/core/vendor/autoload_runtime.php:35
 require_once() at /home/tac/survos/demos/core/src/Zikula/CoreBundle/bin/console:17

zikula:install:finish

Context

Using postgres 13

Zikula version

3.x-git

PHP version

8.0.x

@tacman tacman added the Bug label Oct 13, 2021
@Guite Guite added this to the 3.1.0 milestone Oct 14, 2021
@Guite
Copy link
Member

Guite commented Dec 5, 2021

Hello @tacman

I suspect the issue is a result from this change.
Could you maybe try reverting this and see if this fixes the issue?

Not sure yet about what a better alternative would be, but I can think/research about it after we confirmed this is causing the Postgres problem.

@tacman
Copy link
Author

tacman commented Dec 5, 2021 via email

@Guite
Copy link
Member

Guite commented Dec 5, 2021

How about renaming the table instead?

Yes, this would be a possible solution indeed.
In our 3rd party extension generator we use a scheme <vendor>_<module>_<entity> for the table names, too.
So for example: zikula_groups_group.

Guite added a commit that referenced this issue Dec 6, 2021
@Guite Guite mentioned this issue Dec 6, 2021
@Guite
Copy link
Member

Guite commented Dec 6, 2021

Hey @tacman,

I've proposed a patch at #4805 - fancy to give it a try?

@Guite Guite linked a pull request Dec 6, 2021 that will close this issue
Guite added a commit that referenced this issue Dec 14, 2021
* fix #4762

* update table names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants