-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
No database selected during /contao/install when using download archive #736
Comments
|
I cannot reproduce the issue and it has not occurred at my presentation on the Contao Nordtag, either. |
|
Yeah haven't seen any other reports yet either. May be it is Windows specific, I'll try to debug. |
|
The error happens here: /**
* Checks whether the controller can be run.
*
* @return bool
*/
private function canRunController()
{
/** @var Config $config */
$config = $this->framework->getAdapter(Config::class);
return $config->isComplete()
&& !$config->get('disableCron')
&& $this->connection->getSchemaManager()->tablesExist(['tl_cron'])
;
}https://github.com/contao/core-bundle/blob/4.3.7/src/EventListener/CommandSchedulerListener.php#L73 The @leofeyer how did you test? This problem only occurs if you download Contao from contao.org (and it needs to be a fresh installation). It won't occur with |
|
This has been fixed in e5527fb already. |
$this->connection->isConnected()returns |
|
/**
* Whether an actual connection to the database is established.
*
* @return boolean
*/
public function isConnected()
{
return $this->_isConnected;
}https://github.com/doctrine/dbal/blob/v2.5.12/lib/Doctrine/DBAL/Connection.php#L551 and this variable will be set to true here: https://github.com/doctrine/dbal/blob/v2.5.12/lib/Doctrine/DBAL/Connection.php#L361 I am guessing that a connection can already be established with these default parameters: parameters:
database_host: localhost
database_port: ~
database_user: ~
database_password: ~
database_name: ~
# Doctrine configuration
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
user: "%database_user%"
password: "%database_password%"
dbname: "%database_name%"
charset: UTF8https://github.com/contao/manager-bundle/blob/4.3.8/src/Resources/contao-manager/doctrine.yml However, you are of course not able to do anything with that connection (due to the missing, username, password and database name). |
|
I am guessing this happens under the following circumstances:
|
|
That's a server misconfiguration IMHO. |
|
Yeah, I am assuming it's just something XAMPP does by default, I am not sure though. |
|
According to the MySQL documentation these anonymous accounts are created by default - but it advises you to remove them: https://dev.mysql.com/doc/refman/5.7/en/default-privileges.html |
|
A related problem happens when you install an extension that has at the bottom of the install tool for example, before the database is updated. May be the front end cron should not be integrated into the install tool at all. |
|
The command scheduler checks if there is a database connection and if the tables have been created: https://github.com/contao/core-bundle/blob/release/4.4.0/src/EventListener/CommandSchedulerListener.php#L71-L75 |
It only checks for Imho the command scheduler should net get executed at all by the install tool. |
|
Then those extensions are not set up correctly, because they don't check if their tables exist. |
Hm, is an extension supposed to check for their tables and fields in every hook? |
|
Of course. The install tool triggers a bunch of hooks and if you subscribe to one of it and want to access the database, you should check if it exists. |
Yes, though in the past the command scheduler was not executed within the install tool, thus it was safe to register |
|
This change was introduced in Contao |
|
Changed in fd36131. |
Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes #736 | Docs PR or issue | - <!-- Bugfixes should be based on the 4.4 or 4.9 branch and features on the master branch. Select the correct branch in the "base:" drop-down menu above. Replace this notice with a short README for your feature/bugfix. This will help people to understand your PR and can be used as a start for the documentation. --> Commits ------- 5eca1512 Add a "rawValue" property to the TextArea class 69e58704 Also remove the str_replace() when returning the raw value

4.3.7from contao.org/contao/install.On the subsequent screens (entering the install tool password plus entering the database details) the following error message will be displayed at the bottom of the page:
Testing environment:
Not sure if this ticket belongs to the core-bundle, the installation-bundle or the managed-edition. The error only seems to happen with the managed edition during installation and the error is genereated within the EventListener of the core-bundle.
The error message is appended after the
</html>from the install tool.The text was updated successfully, but these errors were encountered: