I'm having an issue with a puppet agent running on a pi. It's running the same modules as a lot of others, and just this one is showing this issue, so whatever it is, it must be damn specific.
My problem is, I don't know where to start looking for it. When running, puppet is throwing the following error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at <manifest>:75:6
The line it's refering to looks like this:
if $facts['os']['distro']['description'] =~ /^Ubuntu 20/ {
The column it points to is the $ at the beginning of $facts.
I am very unfamiliar with factor, this code was written by somebody else that is currently on vacation. But it seems to be working everywhere else...
There's a couple of questions that this raises that I cannot find an answer to:
- One, how is it even possible that a built-in variable is undefined? I could understand it if complained about a key not being found or something, but apparently the variable itself is undefined. How can that happen?
- Two, According to the error message, this is a server error. As mentioned, I'm not familiar with facter, and googling and reading have not answered this question conclusively. Does puppet send facts about nodes to the server, and evaluate them on the server? Because intuitively I'd expect that to happen on the node, where the facts are actually relevant. But it says the error is comming from the server. So apparently the server doesn't know the variable, but only for this node? I currently can't wrap my head around how this could work. If the facts are stored on the server, can somebody tell me where, and how I could resend them?
- Three, is there some way to force facter to regenerate the facts? I remember that there's some fact-generation going on when installing the puppet agent, or maybe I'm misinterpreting that. In any case, if that is what happens, how can I trigger that on demand without re-installing puppet?