-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration of prometheus::server fails when looking up configname #254
Comments
Hi @madelaney, can you share your site.pp? At least the code around line 41. |
@bastelfreak Sure. This will be a two part, for full context: site.pp:41 is The classes array is ---
classes:
- prometheus
- prometheus::server |
I don't think that the error relates to this module. However I can add an acceptance test for this later. |
Um. I can play around with this, but I'm not sure I have enough configuration for |
There is a similar issue reported to the puppet-ntp (see MODULES-4103). This seems to point to an issue on my side, and to your point, not this module. Unlink the aforementioned issue, I'm on a newer version of Puppet/Facter
The root cause seems to come from the hiera lookup file. For what it's worth, I'm also using the NTP module (v7.2.0) but I don't see the error listed in MODULES-4103. |
After some digging, this is a facter bug where the variable |
@madAndroid which version of facter do you run? The bundled version in Puppet 4.10 already supports hashes. Can you do this on the cmdline please:
|
@bastelfreak , I think you're mention had the wrong user (maybe?). If so, here's the data you requested:
|
Sorry, I wanted to highlight you. Do you somewhere reference the |
I do not, I do have the following (which is similar) but I do not have {
'name' => 'per-os defaults',
'paths' => [
'osfamily/%{facts.os.name}/%{facts.os.distro.codename}/defaults.yaml',
'osfamily/%{facts.os.name}/%{facts.os.architecture}.yaml',
'osfamily/%{facts.os.name}/defaults.yaml'
]
}, |
this code references the |
Okay, I'll do some digging and try to get to the bottom of it. Sorry for the spam. |
I think, I have a similar issue:
the manifest at that line contains:
First, I assumed it has something to do with the lookup in Line 12 in 757a5b4
But even after replacing the hiera lookup with hardcoded values, I get the same error... but I can't find where else it it referenced in the module. |
@spali which version of the module do you use? Did you also test the master branch? Can you share the whole |
I used 6.4.0. I can reproduce it with master. Side note: found another bug on CentOS with sysv init system. |
Got my error... I had in the main hiera.yaml a reference of |
ah, interesting. Thanks for debugging! |
I'm a bit confused why this issue has been closed, because the problem still exists. When including prometheus::server from a profile that error pops up with puppet-agent 5.5.18. The issue seems to stem from the fact that the module defines a parameter $os which apparently conflicts with the facter-provided os-fact. Renaming the parameter to - say - os_ls makes puppet compile a catalog flawlessly. I really believe that this is related to a bug in facter (as @madelaney suggested in his comment: #254 (comment)) and/or hiera, but given that the module claims compatibility with the puppet-version mentioned above, wouldn't it anyway make sense to use a different name for the parameter? Regards, |
I closed this because our tests cannot reproduce this and people reported that they had an issue within their own codebase :) Renaming the variable might help, but that would be a breaking change and we still cannot reproduce the error.
|
Doing this (without any other calls to prometheus) - breaks it for us - on latest puppet 6. class {'prometheus::node_exporter': |
Was actually caused by same bug - as previous poster.. we had one place in a hiera.yaml referring to %{os.family} instead of %{facts.os.family} - so great bug to get flushed out, in our own code :) |
always happy to help :D |
Having same issue as originally reported (Got string when hash-like object was expected...). Determined that it seems to be a conflict with the module's use of $os conflicting with the $os fact. I've resolved in my environment by forking the module and refactoring the $os variable as $os_type. Once the variable name was changed, the errors went away. I'm happy to submit a PR if the team will consider this solution. My environment is prometheus server: |
Puppet 7 EOL is 2 month away. With Puppet 8 this should not be an issue since So can we close this? Or are there other reasons to rename the variable everywhere? |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The puppet catalog fails to compile.
What behaviour did you expect instead
I'd expect the catalog to compile and run.
Output log
Any additional information you'd like to impart
I also tried to follow the example to see if that would help but it was all for not.
The text was updated successfully, but these errors were encountered: