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

Database push failing #110

Closed
CraftyDevon opened this issue Nov 17, 2014 · 23 comments
Closed

Database push failing #110

CraftyDevon opened this issue Nov 17, 2014 · 23 comments

Comments

@CraftyDevon
Copy link

Hey there,
I'm currently encountering the following issue when I try and push my database. I know the paramaters in my movefile are correct, as they match wp-config and the site installer ran fine with them. Any thoughts? Thanks! I'm running this with wordmove push -d -e staging

remote | mysqldump --host=localhost --user=USERNAME '--password=PASSWORD' NAME > /var/www/html/wp-content/dump.sql
   remote | get: /var/www/html/wp-content/dump.sql /Users/DevonHicks/Desktop/myBox/VVV/www/SITENAME/htdocs/wp-content/staging-backup-1416253878.sql
   remote | delete: /var/www/html/wp-content/dump.sql
    local | mysqldump --host=localhost --user=wp --password=wp SITENAME > /Users/DevonHicks/Desktop/myBox/VVV/www/SITENAME/htdocs/wp-content/dump.sql
sh: mysqldump: command not found
/Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:147:in `run': Return code reports an error (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:210:in `save_local_db'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/ssh.rb:20:in `push_db'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:58:in `block in push'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:34:in `block in handle_options'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `handle_options'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:57:in `push'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
    from /usr/bin/wordmove:23:in `load'
    from /usr/bin/wordmove:23:in `<main>'
@alessandro-fazzi
Copy link
Member

Hi @CraftyDevon :)

It seems you lacks mysqldump on your local environment

mysqldump: command not found

What is the output of which mysqldump in your terminal? Usually mysqldump is shipped with mysql, so sounds a bit weird the lack of it...

@alessandro-fazzi
Copy link
Member

Mh...is it possible you're using Vagrant, w/ mysqldump in it, but invoking wordmove within your bare machine? Wordmove expects to be invoked from inside the Vagrant box. If it's not your case ignore this comment, please.

Cheers

@CraftyDevon
Copy link
Author

I'm using Vagrant in combo with the VVV site wizard script by aliso. So my vagrant box sits in a folder on my desktop, and each site I have is in a subfolder within that. Currently my movefile is inside the htdocs file.

I'm currently not sshing into the box.

@alessandro-fazzi
Copy link
Member

Please, could you answer to my previous questions, please?

Morevoer: «my movefile is inside the htdocs file» I can't understand where or what is your "htdocs file", I'm sorry. Could you explain a bit deeper?

Cheers

@CraftyDevon
Copy link
Author

Currently which mysql returns mysqldump not found.

I am running wordmove inside of vagrant. File wise, Desktop/mybox/vvv/www/sitename/htdocs.

Thanks!

@alessandro-fazzi
Copy link
Member

Mmmhhh...if I understand you're doing something like:

  • cd Desktop/mybox/vvv/www/sitename/htdocs
  • you are inside the directory htdocs on your bare machine
  • your vagrant setup is configured to read websites from that htdocs dir
  • you never really enter the vagrant box with vagrant ssh
  • finally, on your machine mysql is not installed; or at least w/o mysqldump

You actually said «I'm running wordmove inside of vagrant», but what's your procedure? Your problem isn't really wordmove-releated, so we need as much info as possible about your environment, or we can't help as much as we'd like.

Thank you

@CraftyDevon
Copy link
Author

You guys are always great with lending a hand.

Your assumptions are correct. So once I cd into that htdocs folder, I run my Wordmove command. It works for everything other than the database.

I wonder if the upgrade to yosemite caused an issue, I did successfully push a database in the past.

When I attempt to ssh into that htdocs folder and run wordmove, it tells me the command isn't found. Should I install worldmove inside vagrant?

@alessandro-fazzi
Copy link
Member

Imho, yes! In most of the cases, when using Vagrant, the way to go is to use wordmove inside the Vagrant box, because it has all the tools you need.
Moreover there are plenty of different setups and the troubleshooting is always a bit painful. E.g.: where your mysql DB is? Inside the box? Outside the box?

We in weLaika do not use Vagrant, so, in the end, we have not all the know how at our fingertips ^^''

I'd anyway try to install wordmove inside the box. Than you can call from the outside, using for example vagrant ssh -- wordmove --config=/path/to/your/Movefile or something similar.

Please drop here some good news when you'll have someone 👍

@CraftyDevon
Copy link
Author

Attempting to install wordmove inside vagrant leaves me with this..

agrant@vvv:~$ sudo gem install wordmove
Building native extensions. This could take a while...
ERROR: Error installing wordmove:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:1:in `

'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out

@alessandro-fazzi
Copy link
Member

Ouch. We're going too far from our territory... here we are into the wild...I don't know even what's the OS of your box :( I think installing a gem should be resolved somewhere else...

Just one question: how do you manage and how do you connect to your database? What's the configuration inside wp-config.php? Have you got sequelPro / phpMyAdmin / hellSQLsomethingElse installed? How does it connect to your db?

@joeguilmette
Copy link

https://github.com/joeguilmette/auto-site-setup/blob/master/provision/provision-pre.sh

Dump that into your provision folder and run vagrant reload ---provision. It has done other stuff you might want to comment out.

Or you can manually run

apt-get install -y ruby-dev
gem install rubygems-update
update_rubygems
gem install wordmove

Have fun!
On Tue, Nov 18, 2014 at 11:07 PM Alessandro Fazzi notifications@github.com
wrote:

Ouch. We're going too far from our territory... here we are into the
wild...I don't know even what's the OS of your box :( I think installing a
gem should be resolved somewhere else...

Just one question: how do you manage and how do you connect to your
database? What's the configuration inside wp-config.php? Have you got
sequelPro / phpMyAdmin / hellSQLsomethingElse installed? How does it
connect to your db?


Reply to this email directly or view it on GitHub
#110 (comment).

@alessandro-fazzi
Copy link
Member

Hey @joeguilmette I was secretly hoping that you were reading this issue :p

Guys...probably could be a good idea to write something on the wiki about wordmove and vagrant and VVV and all the stuff used by a lot of us :)

@CraftyDevon drop here some feedback if you can.

Bye

@CraftyDevon
Copy link
Author

Thanks again guys, sadly i'm still struggling with that. Attempting to install anything inside my vvv box yields in failure. @joeguilmette Is there a specific directory I should run that command in, or should the box root be fine?

@CraftyDevon
Copy link
Author

I've made some progress in general, mainly through blind luck sadly. If I can get past this error I do believe I'll be golden. I've insured my db password doesn't have any special characters.

/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/buffer.rb:284:in `block in write': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/buffer.rb:284:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/buffer.rb:284:in `write'
    from /Library/Ruby/Gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/buffer.rb:322:in `block in write_string'
    from /Library/Ruby/Gems/2.0.0/gems/net-ssh-2.8.0/lib/net/ssh/buffer.rb:319:in `each'

@joeguilmette
Copy link

Hah! Well, @pioneerskies, I watch a couple repos, and as it's my most favorite in the whole world, I pay special attention to Wordmove.

In any case- @CraftyDevon I'm not sure what the problem is, but the good news is Vagrant is Vagrant so you can just vagrant destroy and start over.

So let's do this:

  1. Start with a clean slate and run vagrant destroy
  2. Find the provision folder in your VVV root folder. Create a file called provision-pre.sh and fill it with:
# Rubygems update

if [ $(gem -v|grep '^2.') ]; then
    echo "gem installed"
else
    apt-get install -y ruby-dev
    echo "ruby-dev installed"
    echo "gem not installed"
    gem install rubygems-update
    update_rubygems
fi

# wordmove install
wordmove_install="$(gem list wordmove -i)"
if [ "$wordmove_install" = true ]; then
  echo "wordmove installed"
else
  echo "wordmove not installed"
  gem install wordmove

  wordmove_path="$(gem which wordmove | sed -s 's/.rb/\/deployer\/base.rb/')"
  if [  "$(grep yaml $wordmove_path)" ]; then


    echo "can require yaml"
  else
    echo "can't require yaml"
    echo "set require yaml"

    sed -i "7i require\ \'yaml\'" $wordmove_path

    echo "can require yaml"

  fi
fi
  • Run vagrant up
  • Once Vagrant is back in action, run vagrant ssh. Now, navigate to your site folder cd /srv/www/myproject and run your Wordmove magic. Pay special attention: all of the paths in your Movefile must be the absolute path in Vagrant, because that's where you're running Wordmove from. so ~/CraftyDevonsMacBook/Desktop/VVV isn't going to work. In the future you won't have to worry if you simply run wordmove init from Vagrant. I actually got rid of Wordmove on my laptop for this exact reason.

Since this is a VVV issue rather than a Wordmove issue, you can contact me directly in the future if you run in to any more problems!

@alessandro-fazzi
Copy link
Member

Ohoho!

@joeguilmette I'll dream of a wiki section copy-pasted from you last comment <3

@CraftyDevon speaking about encoding problems, please take a look at the pull requests. We're trying our best to review and accept/implement those in order to ship another tagged release of Wordmove; in the meantime lurk inside pull requests and older issues.

Please, give us feedback in order to let us follow the troubleshooting.

@Arkham
Copy link
Contributor

Arkham commented Nov 20, 2014

@joeguilmette you're a star! Ping me whenever you're in London so I can buy you a pint 🍻

@joeguilmette
Copy link

Aww shucks, thanks guys...

@delphaber
Copy link
Contributor

@joeguilmette could you please write down a wiki page about this? Thank you very much for your work!

@joeguilmette
Copy link

Done! And funny enough, I saw your request here after I just went ahead and did it.

#twilightzone

@delphaber
Copy link
Contributor

Hi! Thank you very much!

@delphaber
Copy link
Contributor

Link to wiki page

@dezinerdudes
Copy link

I found this method does not work anymore. The easiest way to install wordmove in a VVV machine now is to:

  1. SSH into the machine: vagrant ssh
  2. Change to root account: sudo su -
  3. Run: gem install wordmove

Now your database and files should push & pull / sync seamlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants