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

Running setup:config:set doesn't just update, but also deletes values, running it a second time fixes it (kind of) #2852

Closed
hostep opened this issue Dec 31, 2015 · 6 comments
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@hostep
Copy link
Contributor

hostep commented Dec 31, 2015

Hi

When I run:

php bin/magento setup:config:set --db-user=username --db-password=password --db-name=new-database-name
Overwrite the existing configuration for db-name?[Y/n]Y
Overwrite the existing configuration for db-user?[Y/n]Y
Overwrite the existing configuration for db-password?[Y/n]Y
You saved the new configuration.

I would expect to see that the env.php file got updated with those 3 new values. And the file is updated correctly, but a bunch of other values have disappeared from the file:

  • db/table_prefix
  • db/connection/default/host
  • db/connection/default/model
  • db/connection/default/engine
  • db/connection/default/initStatement
  • db/connection/default/active

When running the exact same command again, just after the previous run, the missing values are back but we get some errors:

Overwrite the existing configuration for db-name?[Y/n]Y
Overwrite the existing configuration for db-user?[Y/n]Y
Overwrite the existing configuration for db-password?[Y/n]Y
We saved default values for these options: db-host, db-engine, db-prefix, db-model, db-init-statements.
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

  [InvalidArgumentException]
  MySQL adapter: Missing required configuration option 'host'

Looks like some kind of bug?

Might be related to #2623

@mazhalai
Copy link
Contributor

@hostep can you please give more details, is this in the git version or deployed via composer create-project? If you are using git, which branch? #2623 has been fixed in the develop branch.

@mazhalai mazhalai added the PS label Dec 31, 2015
@hostep
Copy link
Contributor Author

hostep commented Dec 31, 2015

I use Magento 2.0.0, installed using composer.
If you can't reproduce it anymore on the develop branch, then it might be fixed indeed.
If the develop branch is stable enough to be usable, I could give it a shot to test it, unless you guys want to test it yourselves?

@mazhalai
Copy link
Contributor

Thank you for your input. We have created MAGETWO-47531 to investigate.

@mazhalai mazhalai added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Dec 31, 2015
@sshrewz
Copy link

sshrewz commented Feb 26, 2016

We'd like to inform you that this has been resolved. In case you have any questions, please don't hesitate to submit a new issue.

@sshrewz sshrewz closed this as completed Feb 26, 2016
@ddattee
Copy link

ddattee commented Sep 13, 2016

where can we find the fix for this ?

I've updated the admin uri using this command bin/magento setup:config:set --backend-frontname=admin_123 and since then I have the error MySQL adapter: Missing required configuration option 'host' showing up on all front (admin and frontend).

I'm on a Magento EE 2.0.9 installed via composer.

magento-engcom-team pushed a commit that referenced this issue Aug 1, 2018
[honey] MAGETWO-90971: Error is returned when customer checks out with multiple addresses
@coresh
Copy link

coresh commented Mar 6, 2019

where can we find the fix for this ?

I've updated the admin uri using this command bin/magento setup:config:set --backend-frontname=admin_123 and since then I have the error MySQL adapter: Missing required configuration option 'host' showing up on all front (admin and frontend).

I'm on a Magento EE 2.0.9 installed via composer.

To me helped:

app/etc/env.php

'db' field -> if field 'indexer': exists => required appending creditenials:

    'db' => [
        'table_prefix' => '',
        'connection' => [
            'default' => [
                'host' => '127.0.0.1',
                'dbname' => '',
                'username' => '',
                'password' => '',
                'active' => '1',
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;'
            ],
            'indexer' => [
                'host' => '127.0.0.1',
                'dbname' => '',
                'username' => '',
                'password' => '',
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;',
                'active' => '1',
                'persistent' => NULL
            ]
        ]
    ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

5 participants