Skip to content
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

[HTML Error] HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR! #610

Closed
AIXMeister opened this issue Dec 28, 2015 · 16 comments

Comments

@AIXMeister
Copy link

Version

munin 2.0.25

Prerequisites

On a fresh installation set the following parameters in munin.conf:

graph_strategy cgi
html_strategy cgi

Incorrect behaviour

Browse the munin installation and load the same page multiple times. The following happens:

  1. The page loads and displays normally
  2. The page does not load. Instead this error is shown:
HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR! at /usr/share/perl5/vendor_perl/Munin/Master/HTMLOld.pm line 695.

This alternating behaviour - display normal, then display error - happens for any page on every reload of the page.

Analysis

Line 55 in munin/cgi/munin-cgi-html loads the configuration:

$config = get_config(1);

The given parameter 1 tries to load the configuration from the cache.
With html_strategy cgi and graph_strategy cgi this cache does not exist/cannot be created.

Workaround

Change the parameter to zero in line 55 in munin/cgi/munin-cgi-html:

$config = get_config(0);

Any page loads display normally if this workaround is in place.

@AIXMeister AIXMeister changed the title [HTML Error] HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR! when using html_strategy cgi and graph_strategy cgi on a fresh installation [HTML Error] HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR! Dec 28, 2015
@Nukesor
Copy link

Nukesor commented Nov 22, 2017

This is actually still an open issue on 2.0.26 on arch linux.
Would love to see a bug fix in the next version!

HTML error:

Status: 500 Content-type: text/html
Software error:

HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR! at /usr/share/perl5/vendor_perl/Munin/Master/HTMLOld.pm line 695.

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.

@jorti
Copy link

jorti commented Dec 13, 2017

I've this problem in Fedora with munin 2.0.33. The proposed workaround does not work for me.

@pbda
Copy link

pbda commented Jan 30, 2018

I have the same problem with munin 2.0.33.1 on Raspbian 9 "stretch". It works every other time: once I get error message and once I get correct output. Change proposed by AIXMeister works for me if I restart fastcgi processes.

@sumpfralle
Copy link
Collaborator

I just did the following:

  1. apt install munin apache2 libapache2-mod-fcgid on a Debian Stretch host
  2. set graph_strategy cgi and html_strategy cgi in /etc/munin/munin.conf
  3. configure apache according to the example
  4. repeatedly request the start page (or other pages)

I did not notice any errors.

Do you still encounter this issue? If yes: do the *.storable files exist on your system (e.g. /var/lib/munin)? Who is the owner and which permissions are set?

@pbda
Copy link

pbda commented Mar 5, 2018

@sumpfralle
I tried to revert back munin/cgi/munin-cgi-html to original file and it seems to work now !
I didn't use apache but nginx

# ls -l *.storable
-rw-r--r-- 1 munin munin    21085 mars   5 15:35 datafile.storable
-rw-r--r-- 1 munin www-data 81674 mars   5 15:28 htmlconf.storable
-rw-r--r-- 1 munin munin       11 nov.   9 22:40 limits.storable
-rw-r--r-- 1 munin munin     6997 mars   5 15:35 state-picon-picon.storable
-rw-r--r-- 1 munin munin     5552 mars   5 15:35 state-pitit-pitit.storable

@sumpfralle
Copy link
Collaborator

@pbda: thank you for taking a look again!

@AIXMeister, @Nukesor, @jorti: do you still experience this issue?
If yes: could you help me reproducing it?

@Nukesor
Copy link

Nukesor commented Jul 24, 2018

@sumpfralle
I just set up a new server and encountered the same problem again.
The proposed workaround in the original post works and is only required for the first request.
Afterwards it can be changed to get_config(1) again and everything works fine.

I created a gist with my current nginx and munin/node config.

The server is running ArchLinux and uses version 2.0.26-4:

Name            : munin
Version         : 2.0.26-4
Description     : A distributed monitoring/graphing tool
URL             : http://munin-monitoring.org/
Licenses        : GPL
Depends On      : perl  rrdtool  perl-html-template  perl-date-manip  perl-log-log4perl
                  perl-io-socket-inet6  perl-file-copy-recursive  perl-fcgi  perl-uri  munin-node
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : Tue 06 Jun 2017 12:56:45 PM UTC
Install Date    : Mon 09 Jul 2018 10:04:05 PM UTC

@sumpfralle
Copy link
Collaborator

@Nukesor: thank you for the example configuration. Hopefully it helps me reproducing this behaviour.

Is there any chance that you could (without too much of a hassle) try it with a newer version of munin? 2.0.39 was just released a few minutes ago :)
(but I am not aware of any specific changes in this regard)

@trucheromayor
Copy link

Dear collegues,
I´ve the same issue. I´ve tried the get_config(1) solution... but it dosen´t work.
OS: Ubuntu 16.04
Munin version 2.0.25
Runing under apache2.

Server is running but web frontend is not working....:(

Any updates on this issue since the first post??

Thanks in advance

Jon Garrido,

@sumpfralle
Copy link
Collaborator

@trucheromayor: just for making sure, that we are talking about the same issue ...

  • Did you notice the same symptoms as the original submitter?
  • Did you restart your webserver / your fastcgi daemon?
  • Can you verify, whether it works for you in a newer version of munin? (we just reached 2.0.47)

@trucheromayor
Copy link

Thank you Lars for your response.

About your indications:

  • Not exactly having the same symptoms. In my case, the same response all the times.
  • Yes I did restart the webserver...
  • The version 2.0.25 is the latest in my stable ubuntu repository. As I can see it´s just the same version as AIXMeister... .You´re right, may be we should add a backport repository, we will try to avoid this at this momment.

I´m doing a deeper research. I´ll feedback you...

Thanks again.

@artjomsimon
Copy link

Can confirm the issue, exactly as described by the original submitter, still exists in 2.0.47.
Fresh installation on Arch Linux led me here.

However, changing the suggested line in munin/cgi/munin-cgi-html to $config = get_config(0); does not resolve the issue for me.

@artjomsimon
Copy link

After reading through http://munin-monitoring.org/ticket/739 I checked my munin-node config.
It turns out I had configured a node that the master could not connect to.
Fixing that brought my munin instance to life.

@sumpfralle
Copy link
Collaborator

@artjomsimon: just for clarification - your problem was not related to the one described by the creator of this issue?

@kjetilho
Copy link
Contributor

You get this error if the configuration contains no data. It is not sufficient that a node is defined, there will also have to be collected data for at least one graph.

A strategic test for defined $config and an error message to somewhere would be nice.

sumpfralle added a commit that referenced this issue Oct 21, 2020
The template engine emits the following error, if no host entries are
configured for data collection (on the master):

  [HTML Error] HTML::Template::param() : attempt to set parameter 'groups' with a scalar - parameter is not a TMPL_VAR

The following steps are taken to fix this issue:

* ensure that the proper data type is handed over to the template
  (i.e. an array)
* a helpful hint is displayed on the master overview page, if no hosts
  were configured

Closes: #610
@sumpfralle
Copy link
Collaborator

Thank you all for your thoughts and comments!

I fixed the issue in 48e1e0a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

9 participants