sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
409 stars 149 forks source link

Thruk 3.0 missing CSS after upgrade on CentOS 7 #1228

Closed JeromeTeam closed 1 year ago

JeromeTeam commented 1 year ago

Describe the bug Thruk is displaying without CSS after the upgrade to 3.0

Thruk Version Thruk 3.0 CentOS 7.9

To Reproduce Steps to reproduce the behavior: From Thruk 2.44.3 Upgrade to Thruk 3.0 with "yum update" command

Expected behavior We want thruk to be displayed with CSS

Screenshots Thruk_CSS_Error

Desktop (please complete the following information):

Thanks for your help

sni commented 1 year ago

this is even the old logo which is not shipped with thruk anymore. Could you double check you /etc/thruk/themes-enabed folder? It usually contains 2 symlinks, one for the Light and one for the Dark theme.

bjornfro commented 1 year ago

I have sort of the same issue on Rocky Linux 8.

Don't have /etc/thruk/themes-enabled, i have below. Deleting all themes but dark and light seems to have helped.

ls -l /etc/thruk/themes/themes-enabled/ total 0 lrwxrwxrwx 1 root root 27 Jan 26 2022 Classic -> ../themes-available/Classic lrwxrwxrwx 1 root root 24 Nov 15 09:30 Dark -> ../themes-available/Dark lrwxrwxrwx 1 root root 31 Jan 26 2022 Exfoliation -> ../themes-available/Exfoliation lrwxrwxrwx 1 root root 25 Nov 15 09:30 Light -> ../themes-available/Light lrwxrwxrwx 1 root root 26 Jan 26 2022 Nuvola -> ../themes-available/Nuvola lrwxrwxrwx 1 root root 25 Jan 26 2022 Thruk -> ../themes-available/Thruk lrwxrwxrwx 1 root root 26 Jan 26 2022 Thruk2 -> ../themes-available/Thruk2 lrwxrwxrwx 1 root root 27 Jan 26 2022 Vautour -> ../themes-available/Vautour lrwxrwxrwx 1 root root 29 Jan 26 2022 Wakizashi -> ../themes-available/Wakizashi

ls -l /etc/thruk/themes/themes-available/ total 0 lrwxrwxrwx 1 root root 48 Jul 1 22:27 Classic -> /usr/share/thruk/themes/themes-available/Classic lrwxrwxrwx 1 root root 45 Nov 15 09:30 Dark -> /usr/share/thruk/themes/themes-available/Dark lrwxrwxrwx 1 root root 52 Jul 1 22:27 Exfoliation -> /usr/share/thruk/themes/themes-available/Exfoliation lrwxrwxrwx 1 root root 46 Nov 15 09:30 Light -> /usr/share/thruk/themes/themes-available/Light lrwxrwxrwx 1 root root 45 Jul 1 22:27 Neat -> /usr/share/thruk/themes/themes-available/Neat lrwxrwxrwx 1 root root 47 Jul 1 22:27 Nuvola -> /usr/share/thruk/themes/themes-available/Nuvola lrwxrwxrwx 1 root root 46 Jul 1 22:27 Thruk -> /usr/share/thruk/themes/themes-available/Thruk lrwxrwxrwx 1 root root 47 Jul 1 22:27 Thruk2 -> /usr/share/thruk/themes/themes-available/Thruk2 lrwxrwxrwx 1 root root 48 Jul 1 22:27 Vautour -> /usr/share/thruk/themes/themes-available/Vautour lrwxrwxrwx 1 root root 50 Jul 1 22:27 Wakizashi -> /usr/share/thruk/themes/themes-available/Wakizashi

JeromeTeam commented 1 year ago

Hello,

Here is what I have on an old server with Thruk 2.44 and on the new one with Thruk 3.0 There are themes that are missing after installing the Thruk 3.0 patch Something has to be done ?

On the server before installing the Thruk patch

ls -al /etc/thruk/themes/themes-available/ lrwxrwxrwx 1 root root 48 Jun 23 2021 Classic -> /usr/share/thruk/themes/themes-available/Classic lrwxrwxrwx 1 root root 52 Jun 23 2021 Exfoliation -> /usr/share/thruk/themes/themes-available/Exfoliation lrwxrwxrwx. 1 root root 54 Jul 22 2020 EyesOfNetwork -> /usr/share/thruk/themes/themes-available/EyesOfNetwork lrwxrwxrwx 1 root root 45 Jun 23 2021 Neat -> /usr/share/thruk/themes/themes-available/Neat lrwxrwxrwx 1 root root 47 Jun 23 2021 Nuvola -> /usr/share/thruk/themes/themes-available/Nuvola lrwxrwxrwx 1 root root 46 Jun 23 2021 Thruk -> /usr/share/thruk/themes/themes-available/Thruk lrwxrwxrwx 1 root root 47 Jun 23 2021 Thruk2 -> /usr/share/thruk/themes/themes-available/Thruk2 lrwxrwxrwx 1 root root 48 Jun 23 2021 Vautour -> /usr/share/thruk/themes/themes-available/Vautour lrwxrwxrwx 1 root root 50 Jun 23 2021 Wakizashi -> /usr/share/thruk/themes/themes-available/Wakizashi

ls -al /etc/thruk/themes/themes-enabled/ lrwxrwxrwx 1 root root 27 Jul 22 2020 Classic -> ../themes-available/Classic lrwxrwxrwx 1 root root 62 Jul 27 2020 EONFlatDark -> /srv/eyesofnetwork/eonweb/themes/EONFlatDark/thruk/EONFlatDark lrwxrwxrwx 1 root root 64 Jul 27 2020 EONFlatLight -> /srv/eyesofnetwork/eonweb/themes/EONFlatLight/thruk/EONFlatLight lrwxrwxrwx 1 root root 31 Jul 22 2020 Exfoliation -> ../themes-available/Exfoliation lrwxrwxrwx 1 root root 33 Jul 22 2020 EyesOfNetwork -> ../themes-available/EyesOfNetwork lrwxrwxrwx 1 root root 24 Jul 22 2020 Neat -> ../themes-available/Neat lrwxrwxrwx 1 root root 26 Jul 22 2020 Nuvola -> ../themes-available/Nuvola lrwxrwxrwx 1 root root 25 Jul 22 2020 Thruk -> ../themes-available/Thruk lrwxrwxrwx 1 root root 26 Jul 22 2020 Thruk2 -> ../themes-available/Thruk2 lrwxrwxrwx 1 root root 27 Jul 22 2020 Vautour -> ../themes-available/Vautour lrwxrwxrwx 1 root root 29 Jul 22 2020 Wakizashi -> ../themes-available/Wakizashi

On the server after installing the Thruk 3.0 patch

ls -al /etc/thruk/themes/themes-available/ lrwxrwxrwx 1 root root 45 Dec 8 11:56 Dark -> /usr/share/thruk/themes/themes-available/Dark lrwxrwxrwx. 1 root root 54 Jul 22 2020 EyesOfNetwork -> /usr/share/thruk/themes/themes-available/EyesOfNetwork lrwxrwxrwx 1 root root 46 Dec 8 11:56 Light -> /usr/share/thruk/themes/themes-available/Light

ls -al /etc/thruk/themes/themes-enabled/ lrwxrwxrwx 1 root root 24 Dec 8 11:56 Dark -> ../themes-available/Dark lrwxrwxrwx 1 root root 62 Jul 27 2020 EONFlatDark -> /srv/eyesofnetwork/eonweb/themes/EONFlatDark/thruk/EONFlatDark lrwxrwxrwx 1 root root 64 Jul 27 2020 EONFlatLight -> /srv/eyesofnetwork/eonweb/themes/EONFlatLight/thruk/EONFlatLight lrwxrwxrwx 1 root root 33 Jul 22 2020 EyesOfNetwork -> ../themes-available/EyesOfNetwork lrwxrwxrwx 1 root root 25 Dec 8 11:56 Light -> ../themes-available/Light

Thanks for your help

sni commented 1 year ago

i guess those themes have to be adopted to Thruk 3. Remove all symlinks from non-standard themes in your themes-enabled folder and it should work. See http://thruk.org/documentation/themes.html#_write-your-own-themes for an example.

ovidiulixandru commented 1 year ago

@sni The thruk-base-3.02-12116.1.x86_64 package now contains only the Light and Dark themes. Yet the naemon interface still shows all the themes, the old themes as well as Light and Dark. When you load thruk after upgrading, the selected theme is still Classic which can't load. Did the older themes get removed from thruk? If not, it seems they somehow vanished from the package and should be readded. If yes, the old themes should be removed from the dropdown and update with a new default theme which should replace the old one after upgrading.

If you manually select Dark or Light from the theme dropdown, the interface loads correctly, but only those two.

Screenshot 2022-12-27 at 12 29 22
sni commented 1 year ago

yes, the old themes no longer work. The only (official) themes are Light and Dark now. I will have a look at the upgrade process. The old links should be removed during the update.

ovidiulixandru commented 1 year ago

Can the obsolete ones be removed manually? /etc/thruk/themes/themes-available and /etc/thruk/themes/themes-enabled have symlinks only for Light and Dark so they must be pulled from somewhere else.

sni commented 1 year ago

Thruk only looks in /etc/thruk/themes/themes-enabled for available themes. So there should be only Light and Dark in there.

you can check manually by:

%> thruk -l -vvv
[12:00:03,225][D][lib/Thruk/Config.pm:1011      ] screen logging initialized with loglevel 3
[12:00:03,226][D][lib/Thruk/Config.pm:1011      ] reading config file: /omd/sites/test/etc/thruk/thruk.conf
[12:00:03,236][D][lib/Thruk/Config.pm:1011      ] reading config file: /omd/sites/test/etc/thruk/thruk_local.d/lmd.conf
[12:00:03,236][D][lib/Thruk/Config.pm:1011      ] reading config file: /omd/sites/test/etc/thruk/thruk_local.conf
[12:00:03,239][D][lib/Thruk/Config.pm:535       ] using plugins: /omd/sites/test/etc/thruk/plugins-enabled/*/
[12:00:03,240][D][lib/Thruk/Config.pm:576       ] using themes: /omd/sites/test/etc/thruk/themes-enabled/*/
...

Your path will vary, but Thruk should tell you where it gets its themes from. Is it the default folder and how does it look like in your case? Are there old dangling symlinks in there?

ovidiulixandru commented 1 year ago

There must be some bug then:

[13:03:51,530][D][...uk/lib/Thruk/Config.pm:1011] screen logging initialized with loglevel 3
[13:03:51,530][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk.conf
[13:03:51,534][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk_local.d/naemon.conf
[13:03:51,534][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk_local.conf
[13:03:51,536][D][...uk/lib/Thruk/Config.pm:1136] switching to uid: 48
[13:03:51,536][D][...uk/lib/Thruk/Config.pm:1138] re-exec: "/usr/bin/perl" "/usr/bin/thruk" "-l" "-vvv"
[13:03:51,643][D][...uk/lib/Thruk/Config.pm:1011] screen logging initialized with loglevel 3
[13:03:51,643][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk.conf
[13:03:51,648][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk_local.d/naemon.conf
[13:03:51,648][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/thruk_local.conf
[13:03:51,649][D][...ruk/lib/Thruk/Config.pm:535] using plugins: /etc/thruk/plugins//plugins-enabled/*/
[13:03:51,649][D][...ruk/lib/Thruk/Config.pm:576] using themes: /etc/thruk/themes//themes-enabled/*/
[13:03:51,658][D][.../lib/Thruk/Utils/CLI.pm:440] _dummy_c()

[13:03:51,658][D][.../lib/Thruk/Utils/CLI.pm:452] _internal_request('/thruk/cgi-bin/remote.cgi', 'GET')
mem:  25.72 MB without pool
[13:03:51,731][D][...uk/lib/Thruk/Config.pm:1194] reading /etc/thruk/cgi.cfg
[13:03:51,731][D][...uk/lib/Thruk/Config.pm:1011] reading config file: /etc/thruk/cgi.cfg
# ls -al /etc/thruk/themes/themes-enabled/
total 8
drwxr-xr-x 2 root root 4096 Dec 27 12:05 .
drwxr-xr-x 4 root root 4096 Dec 15 23:30 ..
lrwxrwxrwx 1 root root   24 Dec 27 12:03 Dark -> ../themes-available/Dark
lrwxrwxrwx 1 root root   25 Dec 27 12:03 Light -> ../themes-available/Light
# ls -al /etc/thruk/themes/themes-available/
total 8
drwxr-xr-x 2 root root 4096 Dec 27 12:04 .
drwxr-xr-x 4 root root 4096 Dec 15 23:30 ..
lrwxrwxrwx 1 root root   45 Dec 27 12:03 Dark -> /usr/share/thruk/themes/themes-available/Dark
lrwxrwxrwx 1 root root   46 Dec 27 12:03 Light -> /usr/share/thruk/themes/themes-available/Light
sni commented 1 year ago

looks fine, have you restarted the apache?

ovidiulixandru commented 1 year ago

What do you know, the issue was solved after a manual apache restart. Maybe a postinstall script in the package which takes care of this automatically would be useful.

sni commented 1 year ago

There is a restart in the post update script already: https://github.com/sni/Thruk/blob/master/support/thruk.spec#L196-L215 I'll investigate why it didn't work.

luxzg commented 4 months ago

I am adding this comment just in case someone else is having the same issue.

I was upgrading OMD Labs from working version 5.30 on Ubuntu 20.04 to 5.40 and experienced similar issue as described in this thread. By default most people logged into a broken site without CSS, and hand picking theme (using cog button/icon for user settings) to Dark or Light (or Consol) worked, but selecting default theme was broken.

In the end, I found that in file: /omd/sites/monitoring/etc/thruk/thruk_local.conf I still had the line: default_theme = Nuvola Changed that to: default_theme = Light Restarted the site with omd, and everything is fine for all users using default theme.

Interesting enough, while default theme was selected, going to view source said that "Light" files were being loaded (in HTML HEAD), but somehow this didn't actually happen.

Hopefully if someone else experiences this they'll be able to find this comment to help them.

sni commented 4 months ago

thanks for bringing this to my attention. I added a validation of the default theme.