Skip to content

passing stdin to command for docker-based WP instances #4972

Open

Description

@drzraf

PR #4240 did not considered using the docker exec --interactive option.
That causes problem when it comes to passing stdin to wp-cli, for example wp db import

Activity

  1. changed the title [-]passing stdin to command docker-based WP instances[/-] [+]passing stdin to command for docker-based WP instances[/+] on Oct 12, 2018
  2. schlessera commented on Oct 24, 2018

    @schlessera
    Member

    Yes, indeed. Are you up for providing a PR for that?

  3. drzraf commented on Oct 24, 2018

    @drzraf
    Author

    Sorry, I currently can't do it. (@chriszarate maybe ? :))

  4. schlessera commented on Oct 24, 2018

    @schlessera
    Member

    No need to be sorry, pointing out the issue was already a win for the project! So, thanks for that! :)

  5. jserrao commented on Apr 8, 2019

    @jserrao

    I wonder if this has something to do with an error I'm seeing. I make use of Lando (https://github.com/lando/lando), which is a slick set of WP-centric containers that run through Docker. I upgraded to their latest release, which seems to have made wp-cli confused.

    I get DB connection errors just typing wp on the command line inside of any of my Lando/docker-based WP local machines. But...the machines work just fine, which indicates to me something deeper is going on and the error message info isn't accurate.

    Anything I can help to debug, like logs?

    Error establishing a database connection. This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `database`. This could mean your host’s database server is down.
    
  6. legoblokje commented on Aug 26, 2020

    @legoblokje

    I think I'm running into this issue while importing/exporting a database. I am getting the following message:the input device is not a TTY and the database dump fails to import.

    My situation:
    Local host (MacOS) with Docker container running Wordpress
    Remote host (Ubuntu Server) with Docker container running Wordpress

    My local wp-cli.yml:

    @local:
        ssh: docker-compose:wordpress-image
    
    @remote:
        ssh: remote
    

    My remote wp-cli.yml:
    ssh: docker-compose:wordpress-image

    My command:
    wp @remote db export - | wp @local db import -

    It will work when I run it in reverse:
    wp @local db export - | wp @remote db import -

  7. legoblokje commented on Aug 28, 2020

    @legoblokje

    Little update on this: I forced the command to run with -T and the import runs succesfully. The code in question is found at:
    https://github.com/wp-cli/wp-cli/blob/master/php/WP_CLI/Runner.php#L526

    The Docker Compose documentation describes the -T option as follows:

    Disable pseudo-tty allocation. By default docker-compose exec allocates a TTY.

    @schlessera I'm a bit out of my depth here and I'm not sure what's the best way to approach this, but I would like to help and maybe submit a PR. Should the pseudo-tty be disabled by default on wp db import? Or are there situations where TTY is desired on wp db import?

  8. ideag commented on Apr 12, 2021

    @ideag

    I ran into the input device is not a TTY as well.

    my wp-cli.yml

    @devdc:
      ssh: docker-compose:user@servicename
      path: /path/to/wp/
    @devdocker:
      ssh: docker:user@containername
      path: /path/to/wp/
    

    If I try to run a simple command, it will work, no problem:
    wp @devdc user list --field=ID
    But if I try to chain a couple of commands together, it will fail with the input device is not a TTY, for example, this:
    wp @devdc user list --field=ID | xargs -I %% wp @devdc post list --author=%% --status=publish

    This issue seems to only affect the docker-compose "protocol", if run them through docker protocol, it all works as expected:
    wp @devdocker user list --field=ID | xargs -I %% wp @devdocker post list --author=%% --status=publish

  9. Vilasamuni commented on Oct 29, 2024

    @Vilasamuni

    I think I'm running into this issue while importing/exporting a database. I am getting the following message:the input device is not a TTY and the database dump fails to import.

    My situation: Local host (MacOS) with Docker container running Wordpress Remote host (Ubuntu Server) with Docker container running Wordpress

    My local wp-cli.yml:

    @local:
        ssh: docker-compose:wordpress-image
    
    @remote:
        ssh: remote
    

    My remote wp-cli.yml: ssh: docker-compose:wordpress-image

    My command: wp @remote db export - | wp @local db import -

    It will work when I run it in reverse: wp @local db export - | wp @remote db import -

    This is affecting me too. When I try to import to @local as above, the database is not imported, and I end up with a prompt in the MariaDB CLI.

  10. marcelbusch commented on Jan 23, 2025

    @marcelbusch

    Also got the same problem, local docker setup and when trying to import sql from stdin I end up in a mariadb prompt and nothing is imported. No difference if passed from wp db export - or if I cat export.sql, wp @local db import export.sql does work though.

    Debug output

    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\DeclareAbstractBaseCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeFrameworkAutoloader (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\ConfigureRunner (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeRequestsAutoloader (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$version to v2 (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$source to wp-cli (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$class_name to \WpOrg\Requests\Requests (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeColorization (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeLogger (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\DefineProtectedCommands (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LoadExecCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LoadRequiredCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludePackageAutoloader (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeFallbackAutoloader (0.004s)
    Debug (bootstrap): Fallback autoloader paths: phar://wp-cli.phar/vendor/autoload.php (0.004s)
    Debug (bootstrap): Loading detected autoloader: phar://wp-cli.phar/vendor/autoload.php (0.004s)
    Debug (bootstrap): Attaching command 'config edit' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config path' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config list' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config get' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config is-true' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config set' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config delete' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config has' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'config shuffle-salts' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: config (0.007s)
    Debug (bootstrap): Attaching command 'core download' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'core version' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: core (0.007s)
    Debug (bootstrap): Attaching command 'eval' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: eval (0.007s)
    Debug (bootstrap): Attaching command 'eval-file' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: eval-file (0.007s)
    Debug (commands): Adding command: cache (0.008s)
    Debug (commands): Adding command: transient (0.008s)
    Debug (bootstrap): Attaching command 'core verify-checksums' to hook before_wp_load (0.008s)
    Debug (commands): Adding command: verify-checksums in core Namespace (0.008s)
    Debug (commands): Adding command: plugin (0.008s)
    Debug (commands): Adding command: verify-checksums in plugin Namespace (0.008s)
    Debug (commands): Adding command: cron (0.008s)
    Debug (commands): Adding command: event in cron Namespace (0.009s)
    Debug (commands): Adding command: schedule in cron Namespace (0.009s)
    Debug (bootstrap): Attaching command 'db' to hook after_wp_config_load (0.009s)
    Debug (bootstrap): Attaching command 'db clean' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db tables' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db size' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db prefix' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db search' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db columns' to hook after_wp_load (0.009s)
    Debug (commands): Adding command: db (0.009s)
    Debug (commands): Adding command: embed (0.009s)
    Debug (commands): Adding command: fetch in embed Namespace (0.01s)
    Debug (commands): Adding command: provider in embed Namespace (0.01s)
    Debug (commands): Adding command: handler in embed Namespace (0.01s)
    Debug (commands): Adding command: cache in embed Namespace (0.01s)
    Debug (commands): Adding command: comment (0.01s)
    Debug (commands): Adding command: meta in comment Namespace (0.011s)
    Debug (commands): Adding command: menu (0.011s)
    Debug (commands): Adding command: item in menu Namespace (0.011s)
    Debug (commands): Adding command: location in menu Namespace (0.011s)
    Debug (commands): Deferring command: network meta (0.011s)
    Debug (commands): Adding command: option (0.011s)
    Debug (commands): Adding command: post (0.012s)
    Debug (commands): Adding command: meta in post Namespace (0.012s)
    Debug (commands): Adding command: term in post Namespace (0.012s)
    Debug (commands): Adding command: post-type (0.012s)
    Debug (commands): Adding command: site (0.012s)
    Debug (commands): Adding command: meta in site Namespace (0.012s)
    Debug (commands): Adding command: option in site Namespace (0.013s)
    Debug (commands): Adding command: taxonomy (0.013s)
    Debug (commands): Adding command: term (0.013s)
    Debug (commands): Adding command: meta in term Namespace (0.013s)
    Debug (commands): Adding command: user (0.014s)
    Debug (commands): Adding command: application-password in user Namespace (0.014s)
    Debug (commands): Adding command: meta in user Namespace (0.014s)
    Debug (commands): Adding command: session in user Namespace (0.014s)
    Debug (commands): Adding command: term in user Namespace (0.014s)
    Debug (commands): Adding command: network (0.014s)
    Debug (hooks): Processing hook "after_add_command:network" with 1 callbacks (0.014s)
    Debug (hooks): On hook "after_add_command:network": Closure in file phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.014s)
    Debug (commands): Adding command: meta in network Namespace (0.014s)
    Debug (commands): Adding command: signup in user Namespace (0.014s)
    Debug (commands): Adding command: export (0.015s)
    Debug (commands): Adding command: plugin (0.016s)
    Debug (commands): Adding command: auto-updates in plugin Namespace (0.016s)
    Debug (commands): Adding command: theme (0.016s)
    Debug (commands): Adding command: auto-updates in theme Namespace (0.016s)
    Debug (commands): Adding command: mod in theme Namespace (0.016s)
    Debug (bootstrap): Attaching command 'i18n' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: i18n (0.017s)
    Debug (bootstrap): Attaching command 'i18n make-pot' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: make-pot in i18n Namespace (0.017s)
    Debug (bootstrap): Attaching command 'i18n make-json' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: make-json in i18n Namespace (0.017s)
    Debug (bootstrap): Attaching command 'i18n make-mo' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: make-mo in i18n Namespace (0.017s)
    Debug (bootstrap): Attaching command 'i18n make-php' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: make-php in i18n Namespace (0.017s)
    Debug (bootstrap): Attaching command 'i18n update-po' to hook before_wp_load (0.017s)
    Debug (commands): Adding command: update-po in i18n Namespace (0.017s)
    Debug (commands): Adding command: import (0.018s)
    Debug (commands): Deferring command: language core (0.018s)
    Debug (commands): Deferring command: language plugin (0.018s)
    Debug (commands): Deferring command: language theme (0.018s)
    Debug (hooks): Immediately invoking on passed hook "after_add_command:site": Closure in file phar:///usr/bin/wp/vendor/wp-cli/language-command/language-command.php at line 39 (0.018s)
    Debug (commands): Adding command: switch-language in site Namespace (0.018s)
    Debug (commands): Adding command: language (0.018s)
    Debug (hooks): Processing hook "after_add_command:language" with 3 callbacks (0.018s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.018s)
    Debug (commands): Adding command: core in language Namespace (0.018s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.018s)
    Debug (commands): Adding command: plugin in language Namespace (0.018s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.018s)
    Debug (commands): Adding command: theme in language Namespace (0.018s)
    Debug (bootstrap): Attaching command 'maintenance-mode' to hook after_wp_load (0.018s)
    Debug (commands): Adding command: maintenance-mode (0.019s)
    Debug (commands): Adding command: media (0.019s)
    Debug (bootstrap): Attaching command 'package' to hook before_wp_load (0.02s)
    Debug (commands): Adding command: package (0.02s)
    Debug (commands): Adding command: rewrite (0.02s)
    Debug (commands): Adding command: rewrite (0.02s)
    Debug (commands): Adding command: cap (0.02s)
    Debug (commands): Adding command: role (0.02s)
    Debug (commands): Adding command: scaffold (0.021s)
    Debug (commands): Adding command: search-replace (0.021s)
    Debug (bootstrap): Attaching command 'server' to hook before_wp_load (0.021s)
    Debug (commands): Adding command: server (0.021s)
    Debug (commands): Adding command: shell (0.021s)
    Debug (commands): Adding command: super-admin (0.021s)
    Debug (commands): Adding command: widget (0.022s)
    Debug (commands): Adding command: sidebar (0.022s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\RegisterFrameworkCommands (0.022s)
    Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/cli.php (0.022s)
    Debug (bootstrap): Attaching command 'cli' to hook before_wp_load (0.022s)
    Debug (bootstrap): Attaching command 'cli has-command' to hook after_wp_load (0.022s)
    Debug (commands): Adding command: cli (0.022s)
    Debug (bootstrap): Attaching command 'cli cache' to hook before_wp_load (0.022s)
    Debug (commands): Adding command: cache in cli Namespace (0.022s)
    Debug (bootstrap): Attaching command 'cli alias' to hook before_wp_load (0.022s)
    Debug (commands): Adding command: alias in cli Namespace (0.022s)
    Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/help.php (0.022s)
    Debug (commands): Adding command: help (0.023s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\RegisterDeferredCommands (0.023s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeContexts (0.023s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LaunchRunner (0.023s)
    Debug (bootstrap): No readable global config found (0.023s)
    Debug (bootstrap): Using project config: /mnt/data/home/sites/lama-familienberatung/wp-cli.yml (0.023s)
    Debug (bootstrap): argv: /usr/bin/wp @development db import --debug - (0.023s)
    Debug (bootstrap): SSH scheme: docker (0.023s)
    Debug (bootstrap): SSH user: www-data (0.023s)
    Debug (bootstrap): SSH host: lama_appserver_1 (0.023s)
    Debug (bootstrap): SSH port:  (0.023s)
    Debug (bootstrap): SSH path: /app (0.023s)
    Debug (bootstrap): SSH key:  (0.023s)
    Debug (bootstrap): SSH proxyjump:  (0.023s)
    Debug (bootstrap): Running SSH command: docker exec --user 'www-data' -t 'lama_appserver_1' sh -c 'cd '\''/app'\''; wp '\''db'\'' '\''import'\'' '\''--debug'\'' '\''-'\''' (0.063s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\DeclareAbstractBaseCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeFrameworkAutoloader (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\ConfigureRunner (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeRequestsAutoloader (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$version to v2 (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$source to wp-core (0.004s)
    Debug (bootstrap): Setting RequestsLibrary::$class_name to \WpOrg\Requests\Requests (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeColorization (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeLogger (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\DefineProtectedCommands (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LoadExecCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LoadRequiredCommand (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludePackageAutoloader (0.004s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\IncludeFallbackAutoloader (0.004s)
    Debug (bootstrap): Fallback autoloader paths: phar://wp-cli.phar/vendor/autoload.php (0.004s)
    Debug (bootstrap): Loading detected autoloader: phar://wp-cli.phar/vendor/autoload.php (0.004s)
    Debug (bootstrap): Attaching command 'config edit' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config path' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config list' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config get' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config is-true' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config set' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config delete' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config has' to hook before_wp_load (0.006s)
    Debug (bootstrap): Attaching command 'config shuffle-salts' to hook before_wp_load (0.006s)
    Debug (commands): Adding command: config (0.006s)
    Debug (bootstrap): Attaching command 'core download' to hook before_wp_load (0.007s)
    Debug (bootstrap): Attaching command 'core version' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: core (0.007s)
    Debug (bootstrap): Attaching command 'eval' to hook before_wp_load (0.007s)
    Debug (commands): Adding command: eval (0.007s)
    Debug (bootstrap): Attaching command 'eval-file' to hook before_wp_load (0.008s)
    Debug (commands): Adding command: eval-file (0.008s)
    Debug (commands): Adding command: cache (0.008s)
    Debug (commands): Adding command: transient (0.008s)
    Debug (bootstrap): Attaching command 'core verify-checksums' to hook before_wp_load (0.008s)
    Debug (commands): Adding command: verify-checksums in core Namespace (0.008s)
    Debug (commands): Adding command: plugin (0.008s)
    Debug (commands): Adding command: verify-checksums in plugin Namespace (0.008s)
    Debug (commands): Adding command: cron (0.008s)
    Debug (commands): Adding command: event in cron Namespace (0.009s)
    Debug (commands): Adding command: schedule in cron Namespace (0.009s)
    Debug (bootstrap): Attaching command 'db' to hook after_wp_config_load (0.009s)
    Debug (bootstrap): Attaching command 'db clean' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db tables' to hook after_wp_load (0.009s)
    Debug (bootstrap): Attaching command 'db size' to hook after_wp_load (0.01s)
    Debug (bootstrap): Attaching command 'db prefix' to hook after_wp_load (0.01s)
    Debug (bootstrap): Attaching command 'db search' to hook after_wp_load (0.01s)
    Debug (bootstrap): Attaching command 'db columns' to hook after_wp_load (0.01s)
    Debug (commands): Adding command: db (0.01s)
    Debug (commands): Adding command: embed (0.01s)
    Debug (commands): Adding command: fetch in embed Namespace (0.01s)
    Debug (commands): Adding command: provider in embed Namespace (0.01s)
    Debug (commands): Adding command: handler in embed Namespace (0.01s)
    Debug (commands): Adding command: cache in embed Namespace (0.01s)
    Debug (commands): Adding command: comment (0.011s)
    Debug (commands): Adding command: meta in comment Namespace (0.011s)
    Debug (commands): Adding command: menu (0.011s)
    Debug (commands): Adding command: item in menu Namespace (0.011s)
    Debug (commands): Adding command: location in menu Namespace (0.011s)
    Debug (commands): Deferring command: network meta (0.011s)
    Debug (commands): Adding command: option (0.012s)
    Debug (commands): Adding command: post (0.012s)
    Debug (commands): Adding command: meta in post Namespace (0.012s)
    Debug (commands): Adding command: term in post Namespace (0.012s)
    Debug (commands): Adding command: post-type (0.012s)
    Debug (commands): Adding command: site (0.013s)
    Debug (commands): Adding command: meta in site Namespace (0.013s)
    Debug (commands): Adding command: option in site Namespace (0.013s)
    Debug (commands): Adding command: taxonomy (0.013s)
    Debug (commands): Adding command: term (0.014s)
    Debug (commands): Adding command: meta in term Namespace (0.014s)
    Debug (commands): Adding command: user (0.014s)
    Debug (commands): Adding command: application-password in user Namespace (0.015s)
    Debug (commands): Adding command: meta in user Namespace (0.015s)
    Debug (commands): Adding command: session in user Namespace (0.015s)
    Debug (commands): Adding command: term in user Namespace (0.015s)
    Debug (commands): Adding command: network (0.015s)
    Debug (hooks): Processing hook "after_add_command:network" with 1 callbacks (0.015s)
    Debug (hooks): On hook "after_add_command:network": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.015s)
    Debug (commands): Adding command: meta in network Namespace (0.015s)
    Debug (commands): Adding command: signup in user Namespace (0.015s)
    Debug (commands): Adding command: export (0.015s)
    Debug (commands): Adding command: plugin (0.017s)
    Debug (commands): Adding command: auto-updates in plugin Namespace (0.017s)
    Debug (commands): Adding command: theme (0.017s)
    Debug (commands): Adding command: auto-updates in theme Namespace (0.018s)
    Debug (commands): Adding command: mod in theme Namespace (0.018s)
    Debug (bootstrap): Attaching command 'i18n' to hook before_wp_load (0.018s)
    Debug (commands): Adding command: i18n (0.018s)
    Debug (bootstrap): Attaching command 'i18n make-pot' to hook before_wp_load (0.018s)
    Debug (commands): Adding command: make-pot in i18n Namespace (0.018s)
    Debug (bootstrap): Attaching command 'i18n make-json' to hook before_wp_load (0.018s)
    Debug (commands): Adding command: make-json in i18n Namespace (0.018s)
    Debug (bootstrap): Attaching command 'i18n make-mo' to hook before_wp_load (0.018s)
    Debug (commands): Adding command: make-mo in i18n Namespace (0.018s)
    Debug (bootstrap): Attaching command 'i18n make-php' to hook before_wp_load (0.019s)
    Debug (commands): Adding command: make-php in i18n Namespace (0.019s)
    Debug (bootstrap): Attaching command 'i18n update-po' to hook before_wp_load (0.019s)
    Debug (commands): Adding command: update-po in i18n Namespace (0.019s)
    Debug (commands): Adding command: import (0.019s)
    Debug (commands): Deferring command: language core (0.019s)
    Debug (commands): Deferring command: language plugin (0.02s)
    Debug (commands): Deferring command: language theme (0.02s)
    Debug (hooks): Immediately invoking on passed hook "after_add_command:site": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/language-command/language-command.php at line 39 (0.02s)
    Debug (commands): Adding command: switch-language in site Namespace (0.02s)
    Debug (commands): Adding command: language (0.02s)
    Debug (hooks): Processing hook "after_add_command:language" with 3 callbacks (0.02s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.02s)
    Debug (commands): Adding command: core in language Namespace (0.02s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.02s)
    Debug (commands): Adding command: plugin in language Namespace (0.02s)
    Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 695 (0.02s)
    Debug (commands): Adding command: theme in language Namespace (0.02s)
    Debug (bootstrap): Attaching command 'maintenance-mode' to hook after_wp_load (0.02s)
    Debug (commands): Adding command: maintenance-mode (0.02s)
    Debug (commands): Adding command: media (0.021s)
    Debug (bootstrap): Attaching command 'package' to hook before_wp_load (0.021s)
    Debug (commands): Adding command: package (0.021s)
    Debug (commands): Adding command: rewrite (0.022s)
    Debug (commands): Adding command: rewrite (0.022s)
    Debug (commands): Adding command: cap (0.022s)
    Debug (commands): Adding command: role (0.022s)
    Debug (commands): Adding command: scaffold (0.023s)
    Debug (commands): Adding command: search-replace (0.023s)
    Debug (bootstrap): Attaching command 'server' to hook before_wp_load (0.023s)
    Debug (commands): Adding command: server (0.023s)
    Debug (commands): Adding command: shell (0.023s)
    Debug (commands): Adding command: super-admin (0.023s)
    Debug (commands): Adding command: widget (0.024s)
    Debug (commands): Adding command: sidebar (0.024s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\RegisterFrameworkCommands (0.024s)
    Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/cli.php (0.024s)
    Debug (bootstrap): Attaching command 'cli' to hook before_wp_load (0.024s)
    Debug (bootstrap): Attaching command 'cli has-command' to hook after_wp_load (0.024s)
    Debug (commands): Adding command: cli (0.024s)
    Debug (bootstrap): Attaching command 'cli cache' to hook before_wp_load (0.024s)
    Debug (commands): Adding command: cache in cli Namespace (0.024s)
    Debug (bootstrap): Attaching command 'cli alias' to hook before_wp_load (0.024s)
    Debug (commands): Adding command: alias in cli Namespace (0.024s)
    Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/help.php (0.024s)
    Debug (commands): Adding command: help (0.025s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\RegisterDeferredCommands (0.025s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\InitializeContexts (0.025s)
    Debug (bootstrap): Processing bootstrap step: WP_CLI\Bootstrap\LaunchRunner (0.025s)
    Debug (bootstrap): No readable global config found (0.025s)
    Debug (bootstrap): Using project config: /app/wp-cli.yml (0.025s)
    Debug (bootstrap): argv: /usr/local/bin/wp db import --debug - (0.025s)
    Debug (bootstrap): ABSPATH defined: /app/web/wp/ (0.025s)
    Debug (hooks): Executing hook: before_wp_load (0.025s)
    Debug (context): Using context 'cli' (0.025s)
    Debug (bootstrap): Begin WordPress load (0.025s)
    Debug (bootstrap): wp-config.php path: /app/web/wp-config.php (0.025s)
    Debug (bootstrap): Looking for UTF-8 BOM (0.025s)
    Debug (bootstrap): Looking for UTF-16 (BE) BOM (0.025s)
    Debug (bootstrap): Looking for UTF-16 (LE) BOM (0.025s)
    Debug (hooks): Executing hook: after_wp_config_load (0.028s)
    Debug (hooks): Processing hook "before_run_command" with 1 callbacks (0.028s)
    Debug (hooks): On hook "before_run_command": WP_CLI\Bootstrap\RegisterDeferredCommands->add_deferred_commands() (0.028s)
    Debug (bootstrap): Running command: db import (0.028s)
    Debug (db): Running shell command: /usr/bin/env mysql --no-defaults --no-auto-rehash (0.03s)
    Debug (db): Associative arguments: [] (0.03s)
    Debug (db): Final MySQL command: /usr/bin/env mysql --no-defaults --no-auto-rehash --host='database' --user='wordpress' --default-character-set='utf8mb4' --database='wordpress' (0.03s)
    

  11. Vilasamuni commented on Feb 5, 2025

    @Vilasamuni

    @marcelbusch I can't remember exactly what I changed but it's been working for me for a few months now.

    For a while I had to use a workaround for a MariaDB issue like so:
    wp @prod_alias db export - | tail +2 | wp @dev_alias db import -

    I waited for a while for fixes to be released, then updated the MariaDB packages on both hosts. Now it's fine without the workaround:
    wp @prod_alias db export - | wp @dev_alias db import -

    FYI, my prod_alias is connecting over SSH without docker, and my dev_alias is a local docker container with
    ssh: docker-compose:my-wp-cli-container in the wp-cli.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions