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

Cannot install new chamilo 1.11.4 on server because of create db expression. #2172

Closed
Morepizza1 opened this Issue Oct 4, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@Morepizza1
Copy link

Morepizza1 commented Oct 4, 2017

Current behavior / Resultado actual / Résultat actuel

Cannot install new chamilo 1.11.4 on server because of create db expression. Only upgrade is possible. This behaviour was not present in older versions (1.9.10.4).

This is because the create expression is in the install procedure. If the installation sees that there is already a database, then instead of the create expression, the use expression should be used.

See error:
Stap 7 – Installation process execution
Please wait. This could take a while...
100% Complete Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1007 Can't create database 'example_site_be_t1'; database exists' in /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:57 Stack trace: #0 /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(57): PDO->exec('CREATE DATABASE...') #1 /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1012): Doctrine\DBAL\Driver\PDOConnection->exec('CREATE DATABASE...') #2 /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(1017): Doctrine\DBAL\Connection->executeUpdate('CREATE DATABASE...') #3 /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php(430): Doctrine\DBAL\Schema\AbstractSchemaManager->_execSql('CREATE DATABASE...') #4 /c in /customers/c/8/8/example_site.be/httpd.www/elo-test1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

Expected behavior / Resultado esperado / Résultat attendu

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire

Chamilo Version / Versión de Chamilo / Version de Chamilo

1.11.4

@ywarnier ywarnier added this to the 1.11.6 milestone Oct 4, 2017

@ywarnier

This comment has been minimized.

Copy link
Member

ywarnier commented Oct 4, 2017

We will test this to see what happened. What you describe should indeed be the default behaviour (it used to be like that).

@jmontoyaa

This comment has been minimized.

Copy link
Member

jmontoyaa commented Dec 5, 2017

I cannot reproduce the error.

I created a database called "example_site_be_t1" using directly mysql.

Then I installed Chamilo and I have this in step 4:

selection_003

I follow the instructions and chamilo is installed without a problem. Maybe your user doesn't have permissions to create a database?

@jmontoyaa jmontoyaa removed their assignment Dec 5, 2017

@ywarnier

This comment has been minimized.

Copy link
Member

ywarnier commented Dec 5, 2017

I think what @Morepizza1 means is that he has already a database but has no right to drop it and recreate it (which is a common scenario on shared hosting services).
In this case, Chamilo might generate an error because in the next page (after step 4), it will try to drop-recreate the database.

@Morepizza1, the issue with not doing this is we might get stuck with remnants of a previous database (for example tables that are deleted by the update procedure and would otherwise remain if you install a new portal on an existing database). So we are not going to change that (because mostly this generates a whole array of new issues in terms of support, which we cannot handle as a free project).

Based on this experience, I will update the installation guide a bit to explain that and avoid confusion. Changing the software to show that in the interface is too much effort in comparison to the number of such cases that may appear.

The code related to this drop+recreate is located here: https://github.com/chamilo/chamilo-lms/blob/1.11.x/main/install/index.php#L760

ywarnier added a commit that referenced this issue Dec 5, 2017

@ywarnier ywarnier closed this Dec 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.