uyuni-project / uyuni

Source code for Uyuni
https://www.uyuni-project.org/
GNU General Public License v2.0
414 stars 173 forks source link

Enabling monitoring is not possible in Uyuni 2021.01 #3236

Closed stdevel closed 2 months ago

stdevel commented 3 years ago

Additional Information

Enabling the integrated monitoring in accordance with the documentation is not working. When clicking the "Enable" button, the following error is written to the Tomcat log:

2021-02-06 15:01:22,254 [main] WARN  org.hibernate.cfg.AnnotationBinder - HHH000457: Joined inheritance hierarchy [com.redhat.rhn.domain.image.ImageProfile] defined explicit @DiscriminatorColumn.  Legacy Hibernate behavior was to ignore the @DiscriminatorColumn.  However, as part of issue HHH-6911 we now apply the explicit @DiscriminatorColumn.  If you would prefer the legacy behavior, enable the `hibernate.discriminator.ignore_explicit_for_joined` setting (hibernate.discriminator.ignore_explicit_for_joined=true)
2021-02-06 15:02:41,234 [main] WARN  org.hibernate.cfg.AnnotationBinder - HHH000457: Joined inheritance hierarchy [com.redhat.rhn.domain.image.ImageProfile] defined explicit @DiscriminatorColumn.  Legacy Hibernate behavior was to ignore the @DiscriminatorColumn.  However, as part of issue HHH-6911 we now apply the explicit @DiscriminatorColumn.  If you would prefer the legacy behavior, enable the `hibernate.discriminator.ignore_explicit_for_joined` setting (hibernate.discriminator.ignore_explicit_for_joined=true)
2021-02-06 16:06:48,088 [ajp-nio-127.0.0.1-8009-exec-3] ERROR com.suse.manager.webui.services.impl.MonitoringService - Error parsing JSON: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 3 column 10 path $.local[0]

Also enabling monitoring using mgr-monitoring-ctl is not working:

# mgr-monitoring-ctl enable
[ERROR   ] Rendering exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/utils/templates.py", line 394, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/usr/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 54, in top-level template code
jinja2.exceptions.UndefinedError: list object has no element 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/salt/utils/templates.py", line 169, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/usr/lib/python3.6/site-packages/salt/utils/templates.py", line 404, in render_jinja_tmpl
    buf=tmplstr)
salt.exceptions.SaltRenderError: Jinja variable list object has no element 0
[CRITICAL] Rendering SLS 'base:srvmonitoring.enable' failed: Jinja variable list object has no element 0
{
    "local": [
        "Rendering SLS 'base:srvmonitoring.enable' failed: Jinja variable list object has no element 0"
    ]
}

Version of Uyuni Server and Proxy (if used)

# zypper info Uyuni-Server-release
...
Information for package Uyuni-Server-release:
---------------------------------------------
Repository     : uyuni-server-stable
Name           : Uyuni-Server-release
Version        : 2021.01-107.1.uyuni
Arch           : x86_64
Vendor         : obs://build.opensuse.org/systemsmanagement:Uyuni
Support Level  : Level 3
Installed Size : 1.4 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : Uyuni-Server-release-2021.01-107.1.uyuni.src
Summary        : Uyuni Server
Description    : 
    Uyuni lets you efficiently manage physical, virtual,
    and cloud-based Linux systems. It provides automated and cost-effective
    configuration and software management, asset management, and system
    provisioning.

Details about issue

See log above.

The command used to install the required modules is:

# zypper in golang-github-prometheus-node_exporter golang-github-wrouesnel-postgres_exporter prometheus-jmx_exporter golang-github-lusitaniae-apache_exporter prometheus-jmx_exporter-tomcat grafana-formula prometheus-formula prometheus-exporters-formula

I had this issue before with Uyuni 2020.11 - see also issue #2973.

Here is also a list of installed packages for debugging: packages.txt

witekest commented 3 years ago

I cannot reproduce this error in my fresh deployed sumaform environment.

Please share the journal of Tomcat service: journalctl -u tomcat

Then, please add the following line at the end of /srv/tomcat/webapps/rhn/WEB-INF/classes/log4j.properties:

log4j.logger.com.suse.manager.webui.services=DEBUG

and share the DEBUG log /var/log/rhn/rhn_web_ui.log.

stdevel commented 3 years ago

Hi @witekest, thanks for reaching out!

I set the configuration and restarted Uyuni.

Here you'll find the logs:

witekest commented 2 months ago

I think it has been resolved, right?

stdevel commented 2 months ago

Yes, I will close this issue.