• It appears I’ve somehow broken wp-env, and I can’t figure out how, but I think I’ve narrowed it down to however it gets its username and password for logging into the database:

    % pwd
    /Users/cwr/src/cwra/foo
    % wp-env clean all
    ? Cleaned all environments. (in 12s 176ms)
    % wp-env destroy
    ? WARNING! This will remove Docker containers, volumes, and networks associated with the WordPress instance.
    ? Are you sure you want to continue? Yes
    ? Removed WordPress environment. (in 9s 379ms)
    % ls ~/.wp-env
    % wp-env start --update --debug
    ? Stopping WordPress.Removing network e6bc9159b910bda3d9b0dae2e230eabd_default
    Network e6bc9159b910bda3d9b0dae2e230eabd_default not found.
    ? Removing the WordPress volumes: e6bc9159b910bda3d9b0dae2e230eabd_wordpress e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpressPulling mysql           ...
    [snip]
    Pulling phpunit         ... status: image is up to date for w...
    [snip]
    Pulling cli             ... status: image is up to date for w...
    [snip]
    Pulling composer        ... status: image is up to date for c...
    [snip]
    Pulling mysql           ... status: image is up to date for m...
    [snip]
    Pulling tests-cli       ... status: image is up to date for w...
    [snip]
    Pulling wordpress       ... status: downloaded newer image fo...
    Pulling tests-wordpress ... status: image is up to date for w...
    Pulling wordpress       ... done
    ? Downloading sources.Creating network "e6bc9159b910bda3d9b0dae2e230eabd_default" with the default driver
    ? Downloading sources.Creating volume "e6bc9159b910bda3d9b0dae2e230eabd_wordpress" with default driver
    Creating volume "e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpress" with default driver
    Creating volume "e6bc9159b910bda3d9b0dae2e230eabd_mysql" with default driver
    ? Downloading sources.Creating volume "e6bc9159b910bda3d9b0dae2e230eabd_phpunit-uploads" with default driver
    ? Downloading sources.Creating e6bc9159b910bda3d9b0dae2e230eabd_mysql_1 ... 
    ? Downloading sources.Creating e6bc9159b910bda3d9b0dae2e230eabd_mysql_1 ... done
    [snip]
    #10 exporting to image
    #10 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
    #10 exporting layers done
    #10 writing image sha256:6c2c086d9173ce1eaa2de497d344b26c68ff2386c73ae2c9bc0559c1c9019868 done
    #10 naming to docker.io/library/wordpress done
    #10 DONE 0.1s
    Successfully built 6c2c086d9173ce1eaa2de497d344b26c68ff2386c73ae2c9bc0559c1c9019868
    ? Starting WordPress.Recreating e6bc9159b910bda3d9b0dae2e230eabd_mysql_1 ... 
    ? Starting WordPress.Recreating e6bc9159b910bda3d9b0dae2e230eabd_mysql_1 ... done
    [snip]
    ? Starting WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpress_1 ... 
    Creating e6bc9159b910bda3d9b0dae2e230eabd_wordpress_1       ... 
    ? Starting WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_tests-wordpress_1 ... done
    Creating e6bc9159b910bda3d9b0dae2e230eabd_wordpress_1       ... done
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... 
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... done
    ? Configuring WordPress.Error: 'wp-config.php' not found.
    Either create one manually or use <code>wp config create</code>.
    ? Configuring WordPress.1
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... 
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... done
    ? Configuring WordPress.mysqlcheck: Got error: 1045: Access denied for user 'username_here'@'172.20.0.5' (using password: YES) when trying to connect
    ? Configuring WordPress.2
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... 
    ? Configuring WordPress.Creating e6bc9159b910bda3d9b0dae2e230eabd_cli_run ... done
    ? Configuring WordPress.mysqlcheck: Got error: 1045: Access denied for user 'username_here'@'172.20.0.5' (using password: YES) when trying to connect

    Those last four lines repeat many times, and it ultimately stops. When it does, wordpress_1, tests-wordpress_1, and mysql_1 containers are all up and running, but the database hasn’t been configured. I presume wp-env is supposed to be trying to connect as user root with no password, but it’s failing to grab that configuration from … somewhere. So, where is that somewhere supposed to be?

    • This topic was modified 3 years, 11 months ago by cwrichardson.
    • This topic was modified 3 years, 11 months ago by cwrichardson.
  • The topic ‘Where does wp-env get its configuration parameters’ is closed to new replies.