0

So I've been trying to set up Wp-Deploy for about 3 weeks now :(

I have a digitalocean droplet that I am using for staging and was able to finally get my local environment to deploy the files to the server, however, I cannot get the database commands to work. When I try and backup the database I get the following output

    dixon@Sphinx /var/www/html $ bundle exec cap staging db:backup
00:00 db:backup_name
      01 mkdir -p /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups
    ✔ 01 root@<ip address> 1.748s
      02 wp db export - | gzip > /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210165609.sql.gz
      02 /usr/bin/env:
      02 ‘wp’
      02 : No such file or directory
      02
    ✔ 02 root@<ip address> 0.244s
      Downloading db_backups/20190210165609.sql.gz 100.0%
      03 rm /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210165609.sql.gz
    ✔ 03 root@<ip address> 0.228s

and when I try and run the db:push

00:00 db:backup_name
      01 mkdir -p /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups
    ✔ 01 root@<ip address> 1.399s
      02 mkdir -p db_backups
    ✔ 02 dixon@localhost 0.003s
      03 wp db export - | gzip > db_backups/20190210170146.sql.gz
    ✔ 03 dixon@localhost 0.271s
      Uploading db_backups/20190210170146.sql.gz 100.0%
      04 gzip -c -d /var/www/vhosts/thedixonbuilds.com/httpdocs/shared/db_backups/20190210170146.sql.gz | wp db import -
      04 bash: wp: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as root@138.68.14.196: gzip exit status: 127
gzip stdout: Nothing written
gzip stderr: bash: wp: command not found


Caused by:
SSHKit::Command::Failed: gzip exit status: 127
gzip stdout: Nothing written
gzip stderr: bash: wp: command not found
/var/www/html/lib/capistrano/tasks/db.rake:148:in `block (4 levels) in <top (required)>'
/var/www/html/lib/capistrano/tasks/db.rake:147:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:push
(See full trace by running task with --trace)

I'm not sure how capistrano achieves the database manipulation or what usr/bin/env is supposed to contain. Can anyone help me with some leads?

Thanks!

1 Answers1

0

Both of those failed for the same reason. Did you not see the errors?

Here they are:

      02 /usr/bin/env:
      02 ‘wp’
      02 : No such file or directory

And:

gzip stderr: bash: wp: command not found

Both times, your script is trying to run the wp command, but it is not installed or not in your PATH. You need to install it first, and second make sure your PATH is set correctly.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • I saw the error it just makes no sense to me since I am new to all of the underlying technologies. I assumed the wp command was built into the same package that all of the other commands that work are. I'll do some more digging and see if I can get it to make sense, thank you. – Jeremy Dixon Feb 11 '19 at 23:09
  • @JeremyDixon Eh? The wp-deploy README does say you have to install it first. Go click on the link, install it and then try again. – Michael Hampton Feb 12 '19 at 00:49
  • Oh wait wp as in wp-cli ? That IS installed and wp:setup worked so I thought everything was okay with that install but I must be wrong. It is probably the PATH like you said – Jeremy Dixon Feb 12 '19 at 14:45