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

Failed to send shutdown command: handshake failed EOF #1029

Closed
SephVelut opened this issue Apr 11, 2014 · 5 comments
Closed

Failed to send shutdown command: handshake failed EOF #1029

SephVelut opened this issue Apr 11, 2014 · 5 comments

Comments

@SephVelut
Copy link

Issue is possibly related to: #921

virtualbox-iso: Failed to send shutdown command: handshake failed: EOF

Packer.json: https://gist.github.com/10507611
Provision Scripts: https://gist.github.com/10507453
Packer Log: https://gist.github.com/10507491
CentOS Kickstart file: https://gist.github.com/10508015

Removing reboot from the centos_start.sh provision script dissolves the problem. Does packer support bash script reboot?

It appears that packer attempts to re-establish an ssh session the second the vm shuts down but doesn't continue to retry as it normally would. This happens everytime I run packer build.

@itsjohncs
Copy link

I'm also seeing this problem now (this has worked with a previous version of packer). Trying to debug it now.

@itsjohncs
Copy link

Some relevant logs:

2014/04/21 20:41:50 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:41:50 opening new ssh session
2014/04/21 20:41:50 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:41:50 ssh session open error: 'client not available', attempting reconnect
2014/04/21 20:41:50 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:41:50 reconnecting to TCP connection for SSH
2014/04/21 20:41:50 [INFO] 67 bytes written for 'uploadData'
2014/04/21 20:41:50 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:41:50 handshaking with SSH
2014/04/21 20:43:05 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:43:05 handshake error: handshake failed: EOF
2014/04/21 20:43:05 /usr/local/bin/packer-provisioner-shell: 2014/04/21 20:43:05 Retryable error: Error uploading script: handshake failed: EOF
2014/04/21 20:43:07 /usr/local/bin/packer-provisioner-shell: 2014/04/21 20:43:07 [INFO] 67 bytes written for 'uploadData'
2014/04/21 20:43:07 [INFO] 67 bytes written for 'uploadData'
2014/04/21 20:43:07 /usr/local/bin/packer-command-build: 2014/04/21 20:43:07 [INFO] 67 bytes written for 'uploadData'
2014/04/21 20:43:07 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:43:07 opening new ssh session
2014/04/21 20:43:07 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:43:07 ssh session open error: 'client not available', attempting reconnect
2014/04/21 20:43:07 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:43:07 reconnecting to TCP connection for SSH
2014/04/21 20:43:07 [INFO] 67 bytes written for 'uploadData'
2014/04/21 20:43:07 /usr/local/bin/packer-builder-virtualbox-ovf: 2014/04/21 20:43:07 handshaking with SSH

Hanging after the last message.

@itsjohncs
Copy link

I've created a patch that fixes this. Will send a pull request soon.

Basically we just need to add a timeout for the handshake, otherwise it just waits for it forever. This can happen if the TCP connection succeeds but SSH isn't at the other end (at least that's my guess as to what's happening, didn't dig too deeply into the why).

@itsjohncs
Copy link

@SephVelut I think I may have jumped the gun in declaring that we're experiencing the same problem (haven't completely ruled it out though). Sorry about that. Does your problem disappear if you split your scripts into two separate provisioning blocks? I think packer will only gracefully handle restarts in between separate shell provisioners.

I believe my problem is due to some odd interactions between openvz's installer and my firewall configuration.

@SephVelut
Copy link
Author

@brownhead Thanks for the tip! I can confirm that separating scripts into two shell provision blocks was a solution to my particular problem. I'll close this issue now.

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

No branches or pull requests

2 participants