Solved

/centreon/monitoring/resources HTTP ERROR 404 - Centreon 20.10

  • 11 February 2022
  • 8 replies
  • 1602 views

Badge +2

Hi !

 

 our Centreon 20.10.1 suddenly stop working on this error page :

http://xxx.xx.xx.xx/centreon/monitoring/resources

 

...with that message :

“Cette page xxx.xx.xx.xx est introuvable

Aucune page web n'a été trouvée pour l'adresse web : http://xxx.xx.xx.xx/centreon/monitoring/resources

HTTP ERROR 404”

 

It used to works for many months before.

 

Note:

Our problem is exactly the same as “adonix-dev” mentioned in this page :

https://github.com/centreon/centreon/issues/9268

or this one :

https://github.com/centreon/centreon/issues/9177
 

But our 10-centreon.conf file is already well patched as said in these threads.

 

This happen just after logging with good credentials …

Also, the first page (http://xxx.xx.xx.xx/centreon/) simply print normally.

 

Is anyone to help us ?

 

Thanks,

Alex.

 

icon

Best answer by Kriko 17 February 2022, 13:26

View original

8 replies

Badge +2

Again, I just want to add more details about my issue :

 

1/ Same as this page https://forum.centreon.com/forum/centreon-collect/centreon-broker/152788-file-does-not-exist-usr-share-centreon-www :

My error_log file contains :

 

[Fri Feb 11 10:37:35.850065 2022] [authz_core:error] [pid 2211] [client 10.1.239.165:24253] AH01630: client denied by server configuration: /usr/share/centreon/monitoring

 

In fact, this path really doesn’t exists :

# cd /usr/share/centreon/monitoring
-bash: cd: /usr/share/centreon/monitoring: No such file or directory
#

 

Sadly, this link had no answers.

 

2/ Also, like this other page https://github.com/centreon/centreon/issues/9177 :

My access_log file contains :

10.1.239.165 - - [11/Feb/2022:16:31:51 +0100] "GET /centreon/monitoring/resources HTTP/1.1" 404 - "http://172.17.160.77/centreon/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43"

 

and httpd returned :

 

# ./usr/sbin/httpd --help
httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 40 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-base.conf: Cannot load modules/mod_http2.so into server: libnghttp2-httpd24.so.14: cannot open shared object file: No such file or directory
 

So, there is no http2 for me (this doesn’t seems to be a big issue...).

Alex.

Userlevel 5
Badge +16

Hello @amontaro

Can you share us your 10-centreon.conf file just to do a quick review?

And also, could you try to comment the line 40 in the file /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-base.conf just like this to test:

#LoadModule http2_module modules/mod_http2.so

And then try to restart again httpd24-httpd ?

Badge +2

First, thanks for your answer @Kriko !

Of course, I already tried that but again :

With “#LoadModule httpd...” commented in 00-base.conf and httpd24-httpd restarted I got the same error page but httpd now run without any complaints :

<root@xxx:/opt/rh/httpd24/root># ./usr/sbin/httpd --help
httpd (pid 16259) already running
<root@xxx:/opt/rh/httpd24/root># systemctl status httpd24-httpd
* httpd24-httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd24-httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-02-17 10:22:25 CET; 25s ago
  Process: 16228 ExecStop=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
  Process: 1651 ExecReload=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 16259 (httpd)
   Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec:   0 B/sec"
   CGroup: /system.slice/httpd24-httpd.service
           |-16259 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
           |-16260 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
           |-16261 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
           |-16262 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
           |-16264 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
           `-16265 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND

Feb 17 10:22:25 btvl1602620.cs.dev.euw1.nbyt.fr systemd[1]: Stopped The Apache HTTP Server.
Feb 17 10:22:25 btvl1602620.cs.dev.euw1.nbyt.fr systemd[1]: Starting The Apache HTTP Server...
Feb 17 10:22:25 btvl1602620.cs.dev.euw1.nbyt.fr systemd[1]: Started The Apache HTTP Server.
<root@xxx:/opt/rh/httpd24/root>#

 

Also, here is my 10-centreon.conf file in whole :

#

# Section added by Centreon Install Setup

#

Header set X-Frame-Options: "sameorigin"

ServerSignature Off

ServerTokens Prod

Alias /centreon/api /usr/share/centreon

Alias /centreon /usr/share/centreon/www/

<LocationMatch ^/centreon/(?!api/latest/|api/beta/|api/v[0-9]+/|api/v[0-9]+\.[0-9]+/)(.*\.php(/.*)?)$>

  ProxyPassMatch fcgi://127.0.0.1:9042/usr/share/centreon/www/$1

</LocationMatch>

<LocationMatch ^/centreon/api/(latest/|beta/|v[0-9]+/|v[0-9]+\.[0-9]+/)(.*)$>

  ProxyPassMatch fcgi://127.0.0.1:9042/usr/share/centreon/api/index.php/$1

</LocationMatch>

ProxyTimeout 300

<Directory "/usr/share/centreon/www">

    DirectoryIndex index.php

    Options Indexes

    AllowOverride all

    Order allow,deny

    Allow from all

    Require all granted

    <IfModule mod_php5.c>

        php_admin_value engine Off

    </IfModule>

    RewriteRule ^index\.html$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.html [L]

    ErrorDocument 404 /centreon/index.html

    AddType text/plain hbs

</Directory>

<Directory "/usr/share/centreon/api">

    Options Indexes

    AllowOverride all

    Order allow,deny

    Allow from all

    Require all granted

    <IfModule mod_php5.c>

        php_admin_value engine Off

    </IfModule>

 

    AddType text/plain hbs

</Directory>

RedirectMatch ^/$ /centreon

 

RewriteConditions and RewriteRules lines were already present in that file. I didn’t add them by myself. Also, notice that 404 error never reached /centreon/index.html file (it exists but is empty).

 

Alex.

Badge +2

@Kriko : As I want to be sure that no files has disappears.

Please, can you confirm me that this directory is empty for you too ?

# ls -la /usr/share/centreon/monitoring
ls: cannot access /usr/share/centreon/monitoring: No such file or directory

Thanks,

Alex.

Userlevel 5
Badge +16

Alex,

Do not worry about this directory, it’s doesn’t exit at the root of centreon folder.

Could you try the following actions:

  1. Could you check if php-fpm is running which the commande:
    systemctl status rh-php72-php-fpm
  2. Could you check to reset the apache root using the following command:
    sudo -u apache /usr/share/centreon/bin/console cache:clear

    And then try again?

  3. Could send me the logs /var/opt/rh/rh-php72/log/php-fpm/centreon-error.log ?

Badge +2

Sure.

  1. PHP seems to be running fine :

# systemctl status rh-php72-php-fpm
* rh-php72-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/rh-php72-php-fpm.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/rh-php72-php-fpm.service.d
           `-centreon.conf
   Active: active (running) since Thu 2022-02-10 17:39:41 CET; 6 days ago
 Main PID: 1326 (php-fpm)
   Status: "Processes active: 0, idle: 6, Requests: 10048, slow: 0, Traffic: 0.1req/sec"
   CGroup: /system.slice/rh-php72-php-fpm.service
           |- 1326 php-fpm: master process (/etc/opt/rh/rh-php72/php-fpm.conf)
           |- 1939 php-fpm: pool www
           |- 1940 php-fpm: pool www
           |- 1941 php-fpm: pool www
           |- 1942 php-fpm: pool www
           |- 1943 php-fpm: pool www
           `-32651 php-fpm: pool centreon

 

  1. Step 2 seems to have clear something but I still got a 404 not found error page :

# sudo -u apache /usr/share/centreon/bin/console cache:clear

 // Clearing the cache for the prod environment with debug false


 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.


#

  1. The logs you’re talking about is still empty and hasn’t been touched :

# more /var/opt/rh/rh-php72/log/php-fpm/centreon-error.log
# ls -la /var/opt/rh/rh-php72/log/php-fpm/centreon-error.log
-rwxrwxrwx 1 apache apache 0 Feb 12 03:36 /var/opt/rh/rh-php72/log/php-fpm/centreon-error.log
#

Remember that in issues/9177 page above, it was reported that no PHP errors appears in log files.

 

Perhaps are you interested by the previous centreon-error.log file ?

 

# more /var/opt/rh/rh-php72/log/php-fpm/centreon-error.log-20220212
[11-Feb-2022 10:37:24 Europe/Paris] [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "
No route found for "GET /centreon/api/beta/monitoring/resources/undefineds/133"" at /usr/share/centreon/vendor/symfony/http-kernel
/EventListener/RouterListener.php line 136

[11-Feb-2022 13:40:14 Europe/Paris] [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpExce
ption: "No route found for "GET /centreon/api/beta/login": Method Not Allowed (Allow: POST)" at /usr/share/centreon/vendor/symfony
/http-kernel/EventListener/RouterListener.php line 140

#

 

Alex.

Badge +2

Finally, the reason why my Centreon was not functionnal is because my /usr/share/centreon/www/index.html file was empty and everything works now fine with the content you gave me :

 

<!doctype html><html lang="en" style="margin:0;padding:0;width:100%;height:100%;"><head><meta charset="utf-8"><link rel="shortcut icon" href="./img/favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><base href="/centreon/"><title>Centreon - IT & Network Monitoring</title><link href="./static/vendor.e7f5e355.chunk.css" rel="stylesheet"><link href="./static/main.63dc8264.chunk.css" rel="stylesheet"></head><body style="margin:0;padding:0;width:100%;height:100%;"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="./static/runtime~main.8ea6ce4e.js"></script><script src="./static/vendor.86e00385.js"></script><script src="./static/main.d22bec88.chunk.js"></script></body></html>

 

Thanks for all your help, @Kriko.

Alex.

Userlevel 5
Badge +16

To complete: old bug of the 20.10 version.
Normaly a yum reinstall centreon-web do the trick for us.

Reply