Open raffaelj opened 5 months ago
Another use case, when the archive:dump command stops with a false positive:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'drupaldb1',
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'host' => 'dbserver1',
);
Another workaround: Read the regexes of the source file and try to trick it.
$db = array (
'database' => '../db/db.sqlite',
'prefix' => '',
'driver' => 'sqlite',
'namespace' => 'Drupal\\sqlite\\Driver\\Database\\sqlite',
'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
);
$databases['default']['default'] = $db;
Possible solutions:
--skip-db-settings-check
validateSensitiveData()
method entirelyVariant 1 seems over complicated and it would be impossible to match every possible edge case. 2 would be a good option to keep everything as it is, but with a workaround to use the command at all when caring about password security in different ways or when using SQLite.
I would vote for 3 because the current check gives a false sense of security when using any non-default code patterns like the workaround above.
Describe the bug
I can't archive my
web/sites/default/settings.php
because it contains database settings (without any password) for SQLite.To Reproduce
generated db settings in
settings.php
:drush archive:dump
.Error message:
Expected behavior
Because I use SQLite,
settings.php
should be archived without a warning.Actual behavior
I can't archive
settings.php
.Workaround
I could create a
settings.db.php
file and include that fromsettings.php
. When doing so, the archive is created. But than I would have to rsyncsettings.db.php
to keep the correct database location, so I could use rsync in the first place.Because I immediatly ran into the next error (see below) after resolving this issue with a
settings.db.php
in an existing project with content and images, I'll probably switch to native tools like mysqldump and rsync instead of using drush for imports, exports and backups.So the workaround is to not use drush.
Error mentioned above because of default memory limit in php docker container:
System Configuration
Additional information
There is a typo in "Please move the database connection settings into a setting.*.php", which should be "...settings.*.php".