How to handle "UserData" in errors
Martin Packman
martin.packman at canonical.com
Tue Feb 19 11:00:47 UTC 2013
On 19/02/2013, John Arbash Meinel <john at arbash-meinel.com> wrote:
>
> Right now when we generate error messages, we include the context of
> the request that we sent. Which is often quite helpful. However one of
> those values is a "UserData []byte" which contains a fair sized data
> array (2kb?) of compressed data.
Kapil and I mildly disagreed on this. The python openstack provider
deliberately doesn't log the outgoing userdata, mostly because it
contains secrets for the zookeeper instance, but also because a big
blob isn't generally helpful to users. However, there have definitely
been bugs in the cloud config generation where inspecting the userdata
was needed for diagnosis.
> When Go reports on that array, it turns it into [0x64, 0xf6, 0x1f,
> ...]. So every byte of the array becomes ~5 bytes in the terminal.
If kept, this should just be fixed to use a better escaping format.
The actual base64 bytes sent would be good, though as we discovered
that's done inside the json encoding so might not be convenient to
log.
Martin
More information about the Juju-dev
mailing list