This is the error at the end of vagrant up --provision --debug. It does not work only for me, on other machines everything is ok. Environment: latest versions of xubuntu, vagrant, virtualbox, ansible.

DEBUG subprocess: stdout: failed: [default] => (item = {'invocation': {'module_name': u'stat ', u'module_args': {u'checksum_algorithm': u'sha1 ', u'get_md5' : True, u'follow ': False, u'get_checksum': True, u'path ': u' / vagrant / my_project / dump.sql '}},' item ': {u'virtualhost': {u'root ': u' / vagrant / my_project ', u'name': u'shop.instoit.local '}, u'config': {u'dest ': u' / vagrant / my_project / apps / config / config.ini ', u'src': u '/ vagrant / my_project / apps / config / config.sample.ini'}, u'database ': u'shop'}, u'stat ': {u'uid': 777, u'exists': True, u'woth ': True, u'mtime': 1459422099.0, u'inode ': 8785711, u'isgid': False, u'size ': 62333675, u'roth': True, u 'isuid': False, u'isreg ': True, u'gid': 0, u'ischr ': False, u'wusr': True, u'xoth ': True, u'islnk': False, u ' nlink ': 1, u'issock': False, u'rgrp ': True, u'path': u '/ vagrant / my_project / dump.sql', u'xusr ': True, u'atime': 1460829940.8107455, u'md5 ': u'5e30e503bd8299ae 510894ded5486674', u'isdir ': False, u'ctime': 1460723296.6047752, u'isblk ': False, u'xgrp': T rue, u'dev ': 25, u'wgrp': True, u'isfifo ': False, u'mode': u'0777 ', u'checksum': u'cfd8f723aac16e9cf830d28a5d13ebd6c26f3755 ', u'rusr': True} , u'changed ': False,' _ansible_no_log ': False}) => {"failed": true, "item": {"_ansible_no_log": false, "changed": false, "invocation": {"module_args":: {"checksum_algorithm": "sha1", "follow": false, "get_checksum": true, "get_md5": true, "path": "/vagrant/my_project/dump.sql"}, "module_name": "stat" }, "item": {"config": {"dest": "/vagrant/my_project/apps/config/config.ini", "src": "/vagrant/my_project/apps/config/config.sample.ini "}," database ":" shop "," virtualhost ": {" name ":" myproject.local "," root ":" / vagrant / my_project "}}," stat ": {" atime ": 1460829940.8107455, "checksum": "cfd8f723aac16e9cf830d28a5d13ebd6c26f3755", "ctime": 1460723296.6047752, "dev": 25, "exists": true, "gid": 0, "inode": 8785711, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": false, "md 5 ":" 5e30e503bd8299ae510894ded5486674 "," mode ":" 0777 "," mtime ": 1459422099.0," nlink ": 1," path ":" /vagrant/my_project/dump.sql "," rgrp ": true," roth ": true," rusr ": true," size ": 62333675," uid ": 777," wgrp ": true," woth ": true," wusr ": true," xgrp ": true," xoth ": true, "xusr": true}}, "msg": "ERROR 2013 (HY000) at line 698528: Lost connection to MySQL server during query \ n"} INFO interface: info: failed: [default] => (item = {'invocation': {'module_name': u'stat ', u'module_args': {u'checksum_algorithm': u'sha1 ', u'get_md5': True, u'follow ': False, u'get_checksum': True, u'path ': u' / vagrant / my_project / dump.sql '}},' item ': {u'virtualhost': {u'root ': u' / vagrant / my_project ', u'name': u'myproject.local '}, u'config': {u'dest ': u' / vagrant / my_project / apps / config / config.ini ', u'src': u '/ vagrant / my_project / apps / config /config.sample.ini '}, u'database': u'shop '}, u'stat': {u'uid ': 777, u'exists': True, u'woth': True, u'mtime ': 1459422099.0, u'inode': 8785711, u'isgid ': False, u'size': 62333675, u 'roth': True, u'isuid ': False, u'isreg': True, u'gid ': 0, u'ischr': False, u'wusr ': True, u'xoth': True, u ' islnk ': False, u'nlink': 1, u'issock ': False, u'rgrp': True, u'path ': u' / vagrant / my_project / dump.sql ', u'xusr': True, u'atime ': 1460829940.8107455, u'md5': u'e30e503bd8299ae510894ded5486674 ', u'isdir': False, u'ctime ': 1460723296.6047752, u'isblk': False, u'xgrp ': True,: 25, u'wgrp ': True, u'isfifo': ​​False, u'mode ': u'0777', u'checksum ': u'cfd8f723aac16e9cf830d28a5d13ebd6c26f3755', u'rusr ': True}, u'changed': False , '_ansible_no_log': False}) => {"failed": true, "item": {"_ansible_no_log": false, "changed": false, "invocation": {"module_args": {"checksum_algorithm": "sha1 "," follow ": false," get_checksum ": true," get_md5 ": true," path ":" /vagrant/my_project/dump.sql "}," module_name ":" stat "}," item ": { "config": {"dest": "/vagrant/my_project/apps/config/config.ini", "src": "/vagrant/my_project/apps/config/config.sample.ini"}, "database": "shop", "virtualhost": {"name": "myp roject.local, "root": "/ vagrant / my_project"}}, "stat": {"atime": 1460829940.8107455, "checksum": "cfd8f723aac16e9cf830d28a5d13ebd6c26f3755", "ctime": 146072326325285a5d13ebd6c26f3755 "," ctime ": 146072326285a5d13ebd6c26f3755", "cum": 146072323285a5d13ebd6c26f3755 exists ": true," gid ": 0," inode ": 8785711," isblk ": false," ischr ": false," isdir ": false," isfifo ": false," isgid ": false," islnk " : false, "isreg": true, "issock": false, "isuid": false, "md5": "5e30e503bd8299ae510894ded5486674", "mode": "0777", "mtime": 1459422099.0, "nlink": 1, " path ":" /vagrant/my_project/dump.sql "," rgrp ": true," roth ": true," rusr ": true," size ": 62333675," uid ": 777," wgrp ": true, "woth": true, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}}, "msg": "ERROR 2013 (HY000) at line 698528: Lost connection to MySQL server during query \ n "}

failed: [default] => (item = {'invocation': {'module_name': u'stat ', u'module_args': {u'checksum_algorithm ': u'sha1', u'get_md5 ': True, u' follow ': False, u'get_checksum': True, u'path ': u' / vagrant / my_project / dump.sql '}},' item ': {u'virtualhost': {u'root ': u' / vagrant / my_project ', u'name': u'myproject.local '}, u'config': {u'dest ': u' / vagrant / my_project / apps / config / config.ini ', u'src': u '/ vagrant / my_project / apps / config / config.sample.ini'}, u'database ': u'shop'}, u'stat ': {u'uid': 777, u'exists': True, u'woth ': True, u'mtime': 1459422099.0, u'inode ': 8785711, u'isgid': False, u'size ': 62333675, u'roth': True, u'isuid ': False, u 'isreg': True, u'gid ': 0, u'ischr': False, u'wusr ': True, u'xoth': True, u'islnk ': False, u'nlink': 1, u ' issock ': False, u'rgrp': True, u'path ': u' / vagrant / my_project / dump.sql ', u'xusr': True, u'atime ': 1460829940.8107455, u'md5': u ' 5e30e503bd8299ae510894ded5486674 ', u'isdir': False, u'ctime ': 1460723296.6047752, u'isblk': False, u'xgrp ': True, u'dev': 25, u'wgrp ': Tru e, u'isfifo ': False, u'mode': u'0777 ', u'checksum': u'cfd8f723aac16e9cf830d28a5d13ebd6c26f3755 ', u'rusr': True}, u'changed ': False,' _ansible_no_log ': lie: True: ) => {"failed": true, "item": {"_ansible_no_log": false, "changed": false, "invocation": {"module_args": {"checksum_algorithm": "sha1", "follow": false , "get_checksum": true, "get_md5": true, "path": "/vagrant/my_project/dump.sql"}, "module_name": "stat"}, "item": {"config": {"dest ":" /vagrant/my_project/apps/config/config.ini "," src ":" /vagrant/my_project/apps/config/config.sample.ini "}," database ":" shop "," virtualhost " : {"name": "myproject.local", "root": "/ vagrant / my_project"}}, "stat": {"atime": 1460829940.8107455, "checksum": "cfd8f723aac16e9cf830d28a5d13ebd6c26f3755", by the use of the system, by the definition of the programmer, by the use of the general manager of the project. "dev": 25, "exists": true, "gid": 0, "inode": 8785711, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid ": false," islnk ": false," isreg ": true," issock ": false," isuid ": false," md5 ":" 5e30e503bd8299ae510894de d5486674 "," mode ":" 0777 "," mtime ": 1459422099.0," nlink ": 1," path ":" /vagrant/my_project/dump.sql "," rgrp ": true," roth ": true, "rusr": true, "size": 62333675, "uid": 777, "wgrp": true, "woth": true, "wusr": true, "xgrp": true, "xoth": true, "xusr ": true}}," msg ":" ERROR 2013 (HY000) at line 698528: Lost connection to MySQL server during query \ n "} ........

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31575 DEBUG subprocess: Exit status: 2 ERROR warden: Error occurred: Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

... INFO interface: error: Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again. Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again. INFO interface: Machine: error-exit ["Vagrant :: Errors :: AnsibleFailed", "Ansible failed to complete successfully. Any error output should be \ nvisible above. Please fix these errors and try again."]

    1 answer 1

    Your MySQL apparently does not have time to process the dump, and closes the connection by timeout. Check if you exactly match the settings in my.cnf with neighboring machines, perhaps in addition to the provisioning settings, additional ones are used (longer timeout, buffer size).

    In order to overcome the error, you need to speed up the deployment, disable interfering factors (recording transactions directly to the hard disk, indexing, and if possible, insert data with multi-line INSERT queries). In order to make more specific recommendations, you need to look at your my.cnf file and dump structure.

    As an option, for a start it would be good to create a trimmed version of MySQL dump (with less data) and deploy it.