evolution / wordpress

Rapidly create, develop, & deploy WordPress across multiple environments.
MIT License
200 stars 18 forks source link

Can't import existing wordpress due to wp cli Error: The site you have requested is not installed. #158

Closed jalevin closed 7 years ago

jalevin commented 7 years ago

When importing an existing site the import script halts due to a wp cli error

ambrian export file for your existing site: /Users/jefe/Downloads/cambrian-112711b22d--mysite-com.zip
Extracting /Users/jefe/Downloads/cambrian-112711b22d--mysite-com.zip to /var/folders/0v/vhhqtsh50y7f0jkfkzj735tw0000gn/T/cambrian-112711b22d--mysite-com
Extracted zip! files and 319 directories
domain cleanup: replacing mysite\.com with local.mysite.com
checking for (and removing) any existing known host: (ssh-keygen -F local.mysite.com && ssh-keygen -R local.mysite.com) || :
importing sql via: bundle exec cap local evolve:db:exec[/var/folders/0v/vhhqtsh50y7f0jkfkzj735tw0000gn/T/cambrian-112711b22d--mysite-com/wordpress.sql]
listing users via: bundle exec cap local wp:user:list:--fields=ID,user_login,roles:--format=json
/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/node_modules/deasync/index.js:46
                throw err;
                ^

Error: Command failed: bundle exec cap local wp:user:list:--fields=ID,user_login,roles:--format=json
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host local.mysite.com: wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" exit status: 1
wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" stdout: Nothing written
wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" stderr: Error: The site you have requested is not installed.
Run `wp core install`.
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in `exit_status='
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in `block (5 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in `block (3 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in `block (2 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/lib/capistrano/tasks/wp.rake:9:in `block (4 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/lib/capistrano/tasks/wp.rake:8:in `block (3 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
SSHKit::Command::Failed: wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" exit status: 1
wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" stdout: Nothing written
wp user list --fields=ID,user_login,roles --format=json --path="/vagrant/web/wp" --url="http://local.mysite.com/" stderr: Error: The site you have requested is not installed.
Run `wp core install`.
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in `exit_status='
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in `block (5 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in `block (3 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in `block (2 levels) in _execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/lib/capistrano/tasks/wp.rake:9:in `block (4 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/lib/capistrano/tasks/wp.rake:8:in `block (3 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => wp:user:list:--fields=ID,user_login,roles:--format=json
(See full trace by running task with --trace)

    at ChildProcess.exithandler (child_process.js:202:12)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
    at Function.module.exports.loopWhile (/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/node_modules/deasync/index.js:72:22)
    at /Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/node_modules/deasync/index.js:44:19
    at zipPostProcessing (/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/bin/import:180:16)
    at Timeout._onTimeout (/Users/jefe/projects/mysite.com/bower_components/evolution-wordpress/bin/import:80:7)
    at tryOnTimeout (timers.js:224:11)

I've tried debugging however, I can't get wp cli to see the installation directory

EvanK commented 7 years ago

It sounds like the previous step (importing from sql) may not have completed successfully.

importing sql via: bundle exec cap local evolve:db:exec[/var/folders/0v/vhhqtsh50y7f0jkfkzj735tw0000gn/T/cambrian-112711b22d--mysite-com/wordpress.sql]

Could you try running that command alone, or listing out existing tables in mysql, eg: SHOW ALL TABLES;

jalevin commented 7 years ago

Uploading /var/folders/0v/vhhqtsh50y7f0jkfkzj735tw0000gn/T/cambrian-112711b22d--mysite-com/wordpress.sql 100.0% DEBUG[5266d3c5] Running /usr/bin/env mysql -uroot -NBe "SELECT @@GLOBAL.max_allowed_packet" on local.mysite.com DEBUG[5266d3c5] Command: /usr/bin/env mysql -uroot -NBe "SELECT @@GLOBAL.max_allowed_packet" DEBUG[5266d3c5] 16777216 DEBUG[5266d3c5] Finished in 0.056 seconds with exit status 0 (successful). INFO[72ca8644] Running /usr/bin/env mysql -uroot -NBe "SET @@GLOBAL.max_allowed_packet=799031" on local.mysite.com DEBUG[72ca8644] Command: /usr/bin/env mysql -uroot -NBe "SET @@GLOBAL.max_allowed_packet=799031" INFO[72ca8644] Finished in 0.051 seconds with exit status 0 (successful). INFO[5c84139c] Running /usr/bin/env mysql -uroot -D "wordpress_local" < /tmp/wpe-exec.2017-01-05.164516.sql on local.mysite.com DEBUG[5c84139c] Command: /usr/bin/env mysql -uroot -D "wordpress_local" < /tmp/wpe-exec.2017-01-05.164516.sql INFO[5c84139c] Finished in 0.238 seconds with exit status 0 (successful). INFO[dcb3d0d9] Running /usr/bin/env rm /tmp/wpe-exec.2017-01-05.164516.sql on local.mysite.com DEBUG[dcb3d0d9] Command: /usr/bin/env rm /tmp/wpe-exec.2017-01-05.164516.sql INFO[dcb3d0d9] Finished in 0.031 seconds with exit status 0 (successful). INFO[4efbc327] Running /usr/bin/env mysql -uroot -NBe 'SET @@GLOBAL.max_allowed_packet=16777216' on local.mysite.com DEBUG[4efbc327] Command: /usr/bin/env mysql -uroot -NBe 'SET @@GLOBAL.max_allowed_packet=16777216' INFO[4efbc327] Finished in 0.050 seconds with exit status 0 (successful). DEBUG[d4a03b6f] Running /usr/bin/env [ -f /var/log/evolution/wordpress.log ] && [ $(stat -c %U /var/log/evolution/wordpress.log) == 'deploy' ] on local.mysite.com DEBUG[d4a03b6f] Command: [ -f /var/log/evolution/wordpress.log ] && [ $(stat -c %U /var/log/evolution/wordpress.log) == 'deploy' ] DEBUG[d4a03b6f] Finished in 0.039 seconds with exit status 0 (successful). INFO[58462ebe] Running /usr/bin/env echo Thu\ Jan\ \ 5\ 16:45:26\ 2017\ jefe@Jeffreys-laptop-Pro.local\ evolve:db:exec\ Success >> /var/log/evolution/wordpress.log on local.mysite.com DEBUG[58462ebe] Command: /usr/bin/env echo Thu\ Jan\ \ 5\ 16:45:26\ 2017\ jefe@Jeffreys-laptop-Pro.local\ evolve:db:exec\ Success >> /var/log/evolution/wordpress.log INFO[58462ebe] Finished in 0.040 seconds with exit status 0 (successful).

jalevin commented 7 years ago

Ahh. Thanks for the tip on showing tables. The site wasn't using the default wordpress table prefix. Fixed in the config and worked no problem.