How to debug Packer with debugger?

258 views
Skip to first unread message

Ilya Lesikov

unread,
May 15, 2018, 4:45:52 PM5/15/18
to Packer
Packer uses panicwrap (github.com/mitchellh/panicwrap), which, as I understand, spawns different process, so debugger like Delve doesn't work in this case.
Feels like I am encountering a bug and I want to investigate, but PACKER_LOG=1 does not give me enough info.
So I am curious, how guys at Hashicorp debug their product? Thanks.

Alvaro Miranda Aguilera

unread,
May 15, 2018, 5:40:58 PM5/15/18
to packe...@googlegroups.com
packer will try to run in parallel when multiple providers are present.

and then some task will be in parallel, like multiple post-processors

what do you want to debug?

Can you provide more context?

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a44f4551-8b5e-49cc-8712-58d7380ab8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
May 16, 2018, 3:06:42 AM5/16/18
to packe...@googlegroups.com
For debugging plugin code I run with PACKER_LOG=1 and try to understand the problem. Usuually that is enough to pinpoint the problem if not I at least get to know which step is failing and then I can just add some debug print outs and recompile the code. This works very well with packer since the code is so linear and each step have a very clear purpose.

Ilya Lesikov

unread,
May 16, 2018, 4:09:24 PM5/16/18
to Packer
Resolved the problem, though it was a pain to figure out what was happening.
The problem was that system wasn't ready for provisioners, though sleep before provisioning helped. For some reason packer reports no errors even if file is not actually copied into the image with file provisioner. I believe there are just no checks for that, same with the shell provisioner.
Thanks anyways.

Alvaro Miranda Aguilera

unread,
May 16, 2018, 4:16:06 PM5/16/18
to packe...@googlegroups.com
Packer is an Open Source project, pull request welcome.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
May 17, 2018, 3:01:38 AM5/17/18
to packe...@googlegroups.com
For some reason packer reports no errors even if file is not actually copied into the image with file provisioner. I believe there are just no checks for that, same with the shell provisioner.

This should definitely fail, either you misinterpreted the problem or this is a new bug. I would be very happy if you could provide a reasonable simple repo of the problem that we can look at. Also these kind of problems should be easily understod from the output, at least when running with PACKER_LOG.

Reply all
Reply to author
Forward
0 new messages