valentinocossar / trellis-database-uploads-migration

Ansible playbook for Trellis that manages database and uploads migration.
MIT License
94 stars 13 forks source link

Checksum Mismatch #5

Closed ljsherlock closed 6 years ago

ljsherlock commented 7 years ago

Really like the tool, but I'm stuck pushing to production.

TASK [Pull exported database from production to development (backup)] ***** System info: Ansible 2.3.1.0; Linux Trellis at "Option to install WP-CLI packages"

checksum mismatch fatal: [production_host]: FAILED! => {"changed": false, "checksum": null, "dest": "/home/homesick/www/mysite.com/site/database_backup", "failed": true, "file": "/srv/www/mysite.com/current/mysite_com_production_2017_08_04_13_53_01.sql.gz", "md5sum": null, "remote_checksum": "15f981b00102f9be019082fb0e07168931f2ff95", "remote_md5sum": null}

davidyv commented 7 years ago

Hello,

I'm having exactly the same problem when pushing database to production:

...
TASK [Export production database before importing dump (backup)] ***************************************************************
changed: [production_host]

TASK [Pull exported database from production to development (backup)] **********************************************************
System info:
  Ansible 2.3.1.0; Darwin
  Trellis at "Option to install WP-CLI packages"
---------------------------------------------------
checksum mismatch
fatal: [production_host]: FAILED! => {"changed": false, "checksum": null, "dest": "/Users/MYNAME/projects/wordpress/sites/DOMAIN/SUBDOMAIN/database_backup", "failed": true, "file": "/srv/www/SUBDOMAIN/current/SUBDOMAIN_production_2017_08_09_10_21_39.sql.gz", "md5sum": null, "remote_checksum": "711dced49c84f1abbb30a22b56b627c63c28f45a", "remote_md5sum": null}
    to retry, use: --limit @/Users/MYNAME/projects/wordpress/sites/DOMAIN/trellis/database-push.retry

PLAY RECAP *********************************************************************************************************************
production_host            : ok=7    changed=4    unreachable=0    failed=1
valentinocossar commented 7 years ago

Hi, sorry for the delay, this is a known issue, I've provided a solution here. I'm quite sure that this issue is related to this Ansible fix and maybe setting validate_checksum to false fixes the problem. But I want to understand why checksum validation fails.

Thank you for your feedback! 👍

seeReadCode commented 7 years ago

Ok I think I found what's going on here: https://github.com/ansible/ansible/issues/27312

So if you add /{{backup_file}} to the destination path, this problem goes away.

valentinocossar commented 7 years ago

Seems that the problem was caused by a combination of this two issues: ansible/ansible#23900 and ansible/ansible#27312.

This new fix resolves the problem for me, tell me if there are other issues related to this thread or if this fix doesn't work for you. Thank you for the help.

ljsherlock commented 7 years ago

Thanks for fixing this. As someone new to Ansible, I was pulling my hair out trying to diagnose the problem.

I will try the fix later on.