Four days to fix a simple configuration bug
Phew!
Today, after four days of combing through code I am unfamiliar with, I was finally able to change my expression.
I’m finally at the part of my PhD work where I am tasked with implementing the protocol I claim improves from the current situation. I wrote a script to deploy the infrastructure I need for the experiment, and was not expecting any issues — I am not (yet) familiar with the Go language (in which the Hockeypuck key server is developed), but I have managed to install it several times, and it holds no terrible surprises anymore for me. Or so I think.
So, how come it’s possible the five servers in my laboratory network don’t gossip to each other? The logs don’t show anything clear… Only a sucession of this:
hockeypuck[5295]: time="2023-03-24T00:00:28-06:00" level=error msg="recon with :0 failed" error="[{/srv/hockeypuck/packaging/src/gopkg.in/hockeypuck/conflux.v2/recon/gossip.go:109: } {dial tcp :0: connect: connection refused}]" label="gossip :11370"
hockeypuck[5295]: time="2023-03-24T00:00:28-06:00" level=info msg="waiting 27s for next gossip attempt" label="gossip :11370"
And while tcp :0: connect: connection refused
sounds fishy… It
took me too long to find the reasons.
But, at least, along the way I decided to find my errors by debugging the code, rather than by rebuilding the laboratory and random-stabbing at the configuration.
And yes, finally… I came to my senses, and found out my silly mistake was to have my configuration read:
[hockeypuck.conflux.recon.partner.10.0.3.13]
httpAddr="10.0.3.13:11371"
reconAddr="10.0.3.13:11370"
where it should have read:
[hockeypuck.conflux.recon.partner.10-0-3-13]
httpAddr="10.0.3.13:11371"
reconAddr="10.0.3.13:11370"
…Because, of course, TOML would find no child declarations for
hockeypuck.conflux.recon.partner.10
(as the following period makes
the rest of the entry an entirely distinct one from what I thought I
specified).
Anyway, this made me at least:
- Lose my fear of trying to understand the logic of a Go program (and of the Go language)
- Understand the logging framework for Go
- Learning how to use the (great!) format strings infrastructure it has
- Do some minor logic modifications, trying to find the issue
- Dig into how TOML parsing is done, idiomatically
Now… Why am I posting this? Not only because I feel very happy and wanted to share my a-ha moment, but also because I’m sure this time that seems that I mindlessly spent poking at Go without knowing the basics will be somehow rewarded — I have to learn bits of the language anyway, so it’s time well spent.
Or so I hope.
(oh, and the funny spectacles? I am not sure, but I believe them to have been property of my grandfather or great-grandfather when they came from Europe, in 1947 or in 1928 respectively. One glasspiece is sadly lost, but other than that, I love them!)