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

feat: clear message on why snapshot creation failed #165

Closed
kranurag7 opened this issue Apr 18, 2024 · 4 comments · Fixed by #167 or #169
Closed

feat: clear message on why snapshot creation failed #165

kranurag7 opened this issue Apr 18, 2024 · 4 comments · Fixed by #167 or #169
Assignees

Comments

@kranurag7
Copy link

I build a lot snapshots with packer-plugin-hcloud for quick iterations and lately I'm experiencing the following error.

Build 'hcloud' errored after 13 minutes 2 seconds: Could not create snapshot: Creating image failed because of an unknown error. (unknown_error)

The only solution we have for now is to trigger the build again. This issue requests having a clear message on why the snapshot was not created. Was it timed out or something else happened?

Happy to provider more inputs here if required.

@apricote
Copy link
Member

unknown_error is an error code from the API. The only thing the API returned was Creating image failed because of an unknown error. (unknown_error), so we can not add any additional details in the Packer provider.

If we had the Correlation ID of the request, we could check in our internal tracing system what exactly went wrong, but it looks like the Packer Plugin has no way to to enable those yet. I will open a PR for this.

I have also opened hetznercloud/hcloud-go#411 to make sure we print the trace id for any server errors.

@apricote apricote self-assigned this Apr 19, 2024
apricote added a commit that referenced this issue Apr 22, 2024
Packer automatically redirects the output from go `log` to wherever it
needs to be. If users set `PACKER_LOG=1`, the logs will be printed to
`stderr`.


https://developer.hashicorp.com/packer/docs/plugins/creation#logging-and-debugging

Closes #165
apricote pushed a commit that referenced this issue May 6, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](v1.3.0...v1.4.0)
(2024-05-06)


### Features

* enable hcloud-go debug logging
([#167](#167))
([1ab544e](1ab544e)),
closes
[#165](#165)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@apricote
Copy link
Member

apricote commented May 6, 2024

Both improvements were released in 1.4.0, so if this ever happens again, please open a new ticket with the improved error message :)

@kranurag7
Copy link
Author

We are still facing this issue and this happened to me 5-6 times during the weekend. In most cases it's going well but sometimes it's existing with unknown_error too.

==> hcloud: This can take some time
==> hcloud: Could not create snapshot: Creating image failed because of an unknown error. (unknown_error)
==> hcloud: Provisioning step had errors: Running the cleanup provisioner, if present...
==> hcloud: Destroying server...
==> hcloud: Deleting temporary SSH key...
Build 'hcloud' errored after 11 minutes 15 seconds: Could not create snapshot: Creating image failed because of an unknown error. (unknown_error)

==> Wait completed after 11 minutes 15 seconds

==> Some builds didn't complete successfully and had errors:
--> hcloud: Could not create snapshot: Creating image failed because of an unknown error. (unknown_error)

==> Builds finished but no artifacts were created.
  • packer and plugin versions are:
$ packer version
Packer v1.9.5

Your version of Packer is out of date! The latest version
is 1.10.3. You can update by downloading from www.packer.io/downloads
$ packer plugins installed
/home/k7/.config/packer/plugins/github.com/hetznercloud/hcloud/packer-plugin-hcloud_v1.4.0_x5.0_linux_amd64

@jooola
Copy link
Member

jooola commented May 24, 2024

Weird that the correlation IDs are not in the error messages, I just tested myself, and the correlation IDs are present in the API response headers for this endpoint.

Could you please double-check the version of the hcloud packer plugin that you are using?

To fix your issue, I suggest that you open a support ticket so we can share more data, and debug this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants