welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 167 forks source link

Failing to pull -d "private method `load' called for Psych:Module (NoMethodError)" #216

Closed kobrix closed 8 years ago

kobrix commented 9 years ago
`fetch_movefile': private method `load' called for Psych:Module (NoMethodError)

it's my first day with wordmove so this is probably a configuration error on my part, but I can’t see what. Here's the full output:

▬▬ ✓ Using Movefile: ./Movefile ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
/usr/local/lib/ruby/gems/2.2.0/gems/wordmove-1.3.1/lib/wordmove/deployer/base.rb:47:in `fetch_movefile': private method `load' called for Psych:Module (NoMethodError)
    from /usr/local/lib/ruby/gems/2.2.0/gems/wordmove-1.3.1/lib/wordmove/deployer/base.rb:11:in `deployer_for'
    from /usr/local/lib/ruby/gems/2.2.0/gems/wordmove-1.3.1/lib/wordmove/cli.rb:47:in `pull'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/lib/ruby/gems/2.2.0/gems/wordmove-1.3.1/exe/wordmove:6:in `<top (required)>'
    from /usr/local/bin/wordmove:23:in `load'
    from /usr/local/bin/wordmove:23:in `<main>'
kobrix commented 9 years ago

updated ruby to 2.2.3 and now have different problem, seems to be similar issue to #73 with pull:

open-uri.rb:358:in `open_http': 404 Not Found (OpenURI::HTTPError)

also a lot of bigdecimal-1.2.7/bigdecimal.bundle: warning: already initialized constant BigDecimal:: (bigdecimal problem solved by advice in #129, thanks)

this is all way above my head! I just wanted to get the advantage of wordmove but instead I've spent the day trying to understand these problems.

kobrix commented 9 years ago

The dump.sql and local-backup-[n].sql files are downloaded properly. Going the other way, push -d fails with the same error but the dump.php file is uploaded and the remote-backup is downloaded. But in either case the process fails.

kobrix commented 9 years ago

Okay, so I've got push working (don't ask me how), but still can't get it to pull -d successfully. The backup database is created and dump.php flashes in the folder so something is happening, but it's not uploaded to mysql.

Please let me know what info I should supply to get this diagnosed. It's frustrating because I can see what a useful program this can be and I was really looking forward to it making my life easier, but so far it’s been hours of struggling to get it to work.

▬▬ ✓ Pulling Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
mysqldump --host=localhost --user=root --password=password testdb --result-file=/Library/WebServer/Documents/testsite/wp-content/local-backup-1442282314.sql
    local | mysqldump --host=localhost --user=root --password=password testdb --result-file=/Library/WebServer/Documents/testsite/wp-content/local-backup-1442282314.sql
Warning: Using a password on the command line interface can be insecure.
   remote | write /public_html/wp-content/dump.php
    local | download http://dev.mydomain.uk/wp-content/dump.php?shared_key=3939... > /Library/WebServer/Documents/testsite/wp-content/dump.sql
   remote | delete: /public_html/wp-content/dump.php
    local | adapt dump
mysql --host=localhost --user=root --password=mypassword --database=testdb --execute=SOURCE\ /Library/WebServer/Documents/testsite/wp-content/dump.sql
    local | mysql --host=localhost --user=root --password=mypassword --database=testdb --execute=SOURCE\ /Library/WebServer/Documents/testsite/wp-content/dump.sql
Warning: Using a password on the command line interface can be insecure.
    local | rm /Library/WebServer/Documents/testsite/wp-content/dump.sql

the above looks like it has been successful, but the data does not appear in the local database.

phillcoxon commented 9 years ago

Yes, I've been experiencing similar issues.

Some additional debugging options would be a big help.

The first thing to check is that your wp-config.php table prefix is the same on both local and remote servers. I noticed this morning that there's no error message / warning when the table prefixes don't match - mysql isn't able to import the database.

Another issue I've found is wordmove not successfully converting all of the url's between the remote and local dev site. This works for me on some sites, breaks every time on others. It's quite strange.

I've ended up using wp-cli's search-replace function to search for urls and replace. Even then I've had to use the --all-tables and --recurse-objects flags to get wp-cli to pick up all the urls that need replacing.

It would be great if WordMove displayed or logged additional error messages. Mystery issues I've had to debug manually so far have include the table prefix being different, rysnc missing on the remote server and not all URL's being replaced.

Hope that helps.

kobrix commented 9 years ago

Thanks for the hint about table prefix, I had the same thought but they are the same. I'll have another look at the whole setup later but I lost a lot of time to this yesterday and I'm reluctant to sink more time into it just now unless there's a definite process to debug.

edit: Okay, so I couldn’t leave it alone, deleted local database, completely remade under a different name, new config file, and still it doesn't work. There's something I'm missing, obviously, but it's beyond my experience to know where to look now. Advice from developer would be much appreciated.

phillcoxon commented 9 years ago

So what I've had to do to debug this sort of thing is have CTRL-C ready and interrupt wordmove from running once it has transferred and the adapted sql file and before it deletes it from the local (or remote) server.

Then you can manually try importing the database using mysqladmin and see what errors are thrown up.

On one occasion the difference in table prefixes was the issue. On another occasion it was the UTF8 issue - almost always caused by WordFence running.

Right now this seems to be the only way (that I'm aware of) to debug mysql import issues.

alessandro-fazzi commented 9 years ago

Ok @kobrix ,

we know well how struggling is wasting tons of time troubleshooting software which should just work. As far as we know also that wordmove is not a completely integrated solution, but just a smart wrapper around you local and remote programs, with a bit o spicy here and there.

Moreover people's setup are so much different we cannot imagine ^^''' and so ... we're here trying to give you some help.

I'd like to ask you some specs before all:

which mysql
which mysqldump
wordmove --version

Drop us a copy of your Movefile. If is possible due to data present in your site put on a pastebin the dump of your local mysql database; then make a wordmove push -d and put on a pastebin your wp-content/remote-backup-xxxxx.sql or whatever is it named.

The last questions: has your WP a dedicated database or is it polluted by tables from other sites? Is your WP a multisite enabled installation?

Thanks for your patience

Cheers

kobrix commented 9 years ago

Thank you again @getresults; with an almost empty db I would have to be very fast to catch that! I can load more dummy data and see if that gives me enough time.

@pioneerskies thanks for replying. I fully expect this to be a problem with my setup rather than with your software but I will have to come back to this later or tomorrow, no time today.

alessandro-fazzi commented 9 years ago

@getresults as a general advise, I'd like your smart suggestions to be translated into feature request issues :) Almost because this way they'll be lost forever inside an help issue :o

kobrix commented 9 years ago

Apologies for not coming back with my config etc. Will do soon as I focus on problem again.

mukkoo commented 8 years ago

@kobrix can you retry with wordmove 2.0 ?

alessandro-fazzi commented 8 years ago

Aged so closing. Feel free to reopen :)

hutch78 commented 8 years ago

I am also experiencing this issue:

which mysql -> /usr/local/bin/mysql which mysqldump -> /usr/local/bin/mysqldump

wordmove version: 2.0.0

Trace:

▬▬ ✓ Using Movefile: ./Movefile ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/wordmove-2.0.0/lib/wordmove/deployer/base.rb:42:in fetch_movefile': private methodload' called for Psych:Module (NoMethodError) from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/wordmove-2.0.0/lib/wordmove/deployer/base.rb:10:in deployer_for' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/wordmove-2.0.0/lib/wordmove/cli.rb:63:inpull' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/gems/wordmove-2.0.0/exe/wordmove:6:in <top (required)>' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/bin/wordmove:23:inload' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/bin/wordmove:23:in <main>' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:ineval' from /Users/jhutchcraft/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `

'

vhaas commented 7 years ago

Wordfence writes cryptic data to the database. The easiest way is to ignore those tables via mysql_options in Movefile. If there is a wordfence update was done the plugin has to be deactivated an activated again, since wordfence adds tables occasionally.

mysqldump_options: "--ignore-table=<schema>.<wp_prefix>_wfBadLeechers --ignore-table=<schema>.<wp_prefix>_wfBlockedIPLog --ignore-table=<schema>.<wp_prefix>_wfBlocks --ignore-table=<schema>.<wp_prefix>_wfBlocksAdv --ignore-table=<schema>.<wp_prefix>_wfConfig --ignore-table=<schema>.<wp_prefix>_wfCrawlers --ignore-table=<schema>.<wp_prefix>_wfFileMods --ignore-table=<schema>.<wp_prefix>_wfHits --ignore-table=<schema>.<wp_prefix>_wfHoover --ignore-table=<schema>.<wp_prefix>_wfIssues --ignore-table=<schema>.<wp_prefix>_wfKnownFileList --ignore-table=<schema>.<wp_prefix>_wfLeechers --ignore-table=<schema>.<wp_prefix>_wfLockedOut --ignore-table=<schema>.<wp_prefix>_wfLocs --ignore-table=<schema>.<wp_prefix>_wfLogins --ignore-table=<schema>.<wp_prefix>_wfNet404s --ignore-table=<schema>.<wp_prefix>_wfNotifications --ignore-table=<schema>.<wp_prefix>_wfReverseCache --ignore-table=<schema>.<wp_prefix>_wfScanners --ignore-table=<schema>.<wp_prefix>_wfSNIPCache --ignore-table=<schema>.<wp_prefix>_wfStatus --ignore-table=<schema>.<wp_prefix>_wfThrottleLog --ignore-table=<schema>.<wp_prefix>_wfVulnScanners"