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

problems about system reboot #7002

Closed
junsionzhang opened this issue Nov 15, 2018 · 2 comments
Closed

problems about system reboot #7002

junsionzhang opened this issue Nov 15, 2018 · 2 comments

Comments

@junsionzhang
Copy link

junsionzhang commented Nov 15, 2018

my script is here:

{
      "type":"shell",
      "script": "script/init-os.sh",
      "start_retry_timeout": "600s",
      "pause_before": "2s",
      "skip_clean": "true",
      "expect_disconnect": "true"
    },
    {
      "type": "shell",
      "inline": ["sudo reboot", "sleep 60"] ,
      "expect_disconnect": "true"
    },
    {
      "type":"shell",
      "script": "script/update-kernel.sh",
      "start_retry_timeout": "600s",
      "pause_before": "2s",
      "skip_clean": "true",
      "expect_disconnect": "true"
    }

after executing reboot, error say :
virtualbox-iso: Retryable error: Error removing temporary script at /tmp/script_4018.sh: Timeout during SSH handshake
but if I replace the init-os.sh with a simple script echo.sh( only echo something) , it will be fine. he init-os.sh script takes a long time, it seems to be related with the running time, but I do not think it make sense.
the debug info is here

==> virtualbox-iso: Provisioning with shell script: script/update-kernel.sh
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 Opening script/update-kernel.sh for reading
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 [DEBUG] Opening new ssh session
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 [ERROR] ssh session open error: 'EOF', attempting reconnect
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 [DEBUG] reconnecting to TCP connection for SSH
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 [DEBUG] handshaking with SSH
2018/11/15 21:59:28 packer: 2018/11/15 21:59:28 [INFO] 164 bytes written for 'uploadData'
2018/11/15 21:59:28 [INFO] 164 bytes written for 'uploadData'
2018/11/15 22:00:28 packer: 2018/11/15 22:00:28 Retryable error: Error uploading script: Timeout during SSH handshake
2018/11/15 22:00:30 packer: 2018/11/15 22:00:30 [DEBUG] Opening new ssh session
2018/11/15 22:00:30 packer: 2018/11/15 22:00:30 [ERROR] ssh session open error: 'client not available', attempting reconnect
2018/11/15 22:00:30 packer: 2018/11/15 22:00:30 [DEBUG] reconnecting to TCP connection for SSH
2018/11/15 22:00:30 packer: 2018/11/15 22:00:30 [DEBUG] handshaking with SSH
2018/11/15 22:00:30 packer: 2018/11/15 22:00:30 [INFO] 164 bytes written for 'uploadData'
2018/11/15 22:00:30 [INFO] 164 bytes written for 'uploadData'
2018/11/15 22:01:30 packer: 2018/11/15 22:01:30 Retryable error: Error uploading script: Timeout during SSH handshake
2018/11/15 22:01:32 packer: 2018/11/15 22:01:32 [DEBUG] Opening new ssh session
@SwampDragons
Copy link
Contributor

Hey there, thanks for reaching out!

It sounds like you may be just getting started with using Packer. Questions like this where you're having trouble figuring out why new builds are failing are probably best directed to the mailing list, as we try to save Packer's GitHub issue tracker for bugs and feature requests. The mailing list has some really nice and helpful people who have a lot of experience helping new users debug these kinds of issues.

If you do believe this is a bug and not just a rocky getting-started process, I really do need full steps to reproduce -- including the contents of script/init-os.sh and full debug logs (not just an excerpt) in a gist in order to help you.

Here's a refresher of the information I need from you:

  • Packer version from packer version
  • Host platform
  • Full debug log output from PACKER_LOG=1 packer build template.json, pasted in a gist
  • The simplest complete example template and scripts needed to reproduce the bug, also included in your gist

Thanks!

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants