Open dekimsey opened 2 years ago
I tried a v1 ticket and had more parsing errors. I don't know much about parsing keytabs or why this would fail. But the error handling had the same problem of using %s
instead of %v
or %q
. Specifically the functions readInt16, readInt8, readBytes.
I apologize for the quality of the information here but I hope the report helps, I'm digging pretty deep in my stack to get the root cause of my issue out. I think there are several issues at play and I've tried to identify them below.
Background:
I am attempting to use the terraform DNS provider to make DNS changes. It uses this library to perform some of that work. It's GRPC plugin handling is breaking because this library is emitting binary output in the error struct which it is then propagating up to the terraform client itself
As a user I am seeing:
Issue:
Recompiling terraform-provider-dns to attach a debugger and walking through it, I found keytab/keytab.go emits the raw binary keytab data as part of the error handling.
I believe the error handling here is in error. Emitting binary data as part of the error struct is likely to never be a good thing.
Changing the format string to use
%q
instead addresses the issue, error is propagated successfully up the stack.I went a bit further and change the error message entirely in hopes of providing some context for resolving Issue 2 below.
Emits:
Resolution
Root cause of this behavior was user error. I was passing the CCACHE file as the keytab file path. Those aren't the same files at all silly. I believe the error handling aspect of this is still valid however.