Command-line option --config is not applied when creating database connections in standalone mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
Research direction
Start at the throw site named in the report, StandaloneDatabaseSessionRegistry.php line 40, and read what populates the registry before it is consulted. Then find the standalone anonymizer:run command class: check in which order it parses --config, loads the configuration and builds the session registry, since the connection is created too early. Done means running the command with --config pointing outside the project root reaches the anonymizer instead of raising "No connections were configured", with a test covering that ordering; the proposed --connection option is a follow-up decision, not part of the fix.
Written by the indexing model from the issue text.
Description
When running the standalone anonymizer:run command, the database connection is created before the configuration file specified via --config=... is loaded.
As a result, the --config command-line option is not taken into account when the database connection is initialized.
The command works when the configuration file is located in the project root, which is one of the default configuration locations. However, we would like to store configuration files alongside our anonymizer definitions in a custom location and provide the path using --config.
This results in the following error:
In StandaloneDatabaseSessionRegistry.php line 40:
No connections were configured.
A useful addition would be a --connection option that accepts a database connection string directly from the command line.
Besides being more flexible for standalone usage, this would avoid the dependency on loading a configuration file before creating the database connection. It would also make it easier to run the anonymizer in automated environments where connection details are provided through environment variables or deployment configuration rather than configuration files.
- Dominant language
- PHP
- Stars
- 235
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from makinacorpus/DbToolsBundle
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
makinacorpus/DbToolsBundle#259 ·
-
Laravel 12.0 & 13.0 supportMay be free again @Lonnytunes claimed this 169 days ago, and no pull request is open. Openenhancement good first issue
makinacorpus/DbToolsBundle#254 · 6 comments · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
makinacorpus/DbToolsBundle#252 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
makinacorpus/DbToolsBundle#237 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
makinacorpus/DbToolsBundle#236 ·
All issues in makinacorpus/DbToolsBundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day