github.com/ttysteale/packer@v0.8.2-0.20150708160520-e5f8ea386ed8/website/source/docs/other/debugging.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Debugging Packer" 4 description: |- 5 Packer strives to be stable and bug-free, but issues inevitably arise where certain things may not work entirely correctly, or may not appear to work correctly. In these cases, it is sometimes helpful to see more details about what Packer is actually doing. 6 --- 7 8 # Debugging Packer Builds 9 10 For remote builds with cloud providers like Amazon Web Services AMIs, debugging 11 a Packer build can be eased greatly with `packer build -debug`. This disables 12 parallelization and enables debug mode. 13 14 Debug mode informs the builders that they should output debugging information. 15 The exact behavior of debug mode is left to the builder. In general, builders 16 usually will stop between each step, waiting for keyboard input before 17 continuing. This will allow you to inspect state and so on. 18 19 In debug mode once the remote instance is instantiated, Packer will emit to the 20 current directory an emphemeral private ssh key as a .pem file. Using that you 21 can `ssh -i <key.pem>` into the remote build instance and see what is going on 22 for debugging. The emphemeral key will be deleted at the end of the packer run 23 during cleanup. 24 25 ### Windows 26 As of Packer 0.8.1 the default WinRM communicator will emit the password for a 27 Remote Desktop Connection into your instance. This happens following the several 28 minute pause as the instance is booted. Note a .pem key is still created for 29 securely transmitting the password. Packer automatically decrypts the password 30 for you in debug mode. 31 32 ## Debugging Packer 33 34 Issues occasionally arise where certain things may not work entirely correctly, 35 or may not appear to work correctly. In these cases, it is sometimes helpful to 36 see more details about what Packer is actually doing. 37 38 Packer has detailed logs which can be enabled by setting the `PACKER_LOG` 39 environmental variable to any value like this `PACKER_LOG=1 packer build 40 <config.json>`. This will cause detailed logs to appear on stderr. The logs 41 contain log messages from Packer as well as any plugins that are being used. Log 42 messages from plugins are prefixed by their application name. 43 44 Note that because Packer is highly parallelized, log messages sometimes 45 appear out of order, especially with respect to plugins. In this case, 46 it is important to pay attention to the timestamp of the log messages 47 to determine order. 48 49 In addition to simply enabling the log, you can set `PACKER_LOG_PATH` in order 50 to force the log to always go to a specific file when logging is enabled. 51 Note that even when `PACKER_LOG_PATH` is set, `PACKER_LOG` must be set in 52 order for any logging to be enabled. 53 54 If you find a bug with Packer, please include the detailed log by using 55 a service such as [gist](http://gist.github.com).