Question

23.04 : No route found for "GET /api/latest/auto-discovery/scheduling/jobs" after upgrade

  • 28 April 2023
  • 21 replies
  • 1390 views

Userlevel 2
Badge +7

Hi,

During my migration from 22.10 to 23.04, I had some issues with host auto discovery.

The following error is visible in the gorgone log

[autodiscovery] -class- host discovery - cannot get host discovery jobs - request error [code: '404'] [message: 'No route found for "GET https://<centreon>/centreon/api/latest/auto-discovery/scheduling/jobs"']

The API seams to be good because I am able to check the current version of the api:

curl https://<url>/centreon/api/latest/platform/versions
{"web":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"modules":{"centreon-pp-manager":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"centreon-license-manager":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"centreon-autodiscovery-server":{"version":"23.04.0","major":"23","minor":"04","fix":"0"}},"widgets":{"Service Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Grid-map":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Global Health":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 Memory Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"HTTP Loader":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Graph Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Hostgroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Host Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 CPU Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Servicegroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Engine-status":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Tactical Overview":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Single Metric":{"version":"23.04.0","major":"23","minor":"04","fix":"0"}}}

I deployed the /etc/httpd/conf.d/10-centreon.conf file available on the package and only adapted it using the https protocol.


21 replies

Userlevel 2
Badge +7

Same issue with https://<centreon>/centreon/api/latest/it-edition-extensions/login_page

Badge +5

Same for us on our test server, upgraded from 22.10.7, also have HTTPS customisations, and the above two URLs and also https://<centreon>/centreon/administration/extensions/manager does not work and just shows a blank page

 

Accept-Type: application/json; charset=utf-8
2023-05-02 09:21:03 - DEBUG - == Info: TLSv1.3 (IN), TLS handshake, [no content] (0):
2023-05-02 09:21:03 - DEBUG - == Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
2023-05-02 09:21:03 - DEBUG - == Info: TLSv1.3 (IN), TLS handshake, [no content] (0):
2023-05-02 09:21:03 - DEBUG - == Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
2023-05-02 09:21:03 - DEBUG - == Info: TLSv1.3 (IN), TLS app data, [no content] (0):
2023-05-02 09:21:03 - DEBUG - => Recv header: HTTP/1.1 404 Not Found
2023-05-02 09:21:03 - DEBUG - => Recv header: Date: Tue, 02 May 2023 07:21:03 GMT
2023-05-02 09:21:03 - DEBUG - => Recv header: Server: Apache
2023-05-02 09:21:03 - DEBUG - => Recv header: Cache-Control: no-cache, private
2023-05-02 09:21:03 - DEBUG - => Recv header: Api-Version: 23.04
2023-05-02 09:21:03 - DEBUG - => Recv header: Upgrade: h2,h2c
2023-05-02 09:21:03 - DEBUG - => Recv header: Connection: Upgrade
2023-05-02 09:21:03 - DEBUG - => Recv header: Transfer-Encoding: chunked
2023-05-02 09:21:03 - DEBUG - => Recv header: Content-Type: application/json
2023-05-02 09:21:03 - DEBUG - => Recv header: 
2023-05-02 09:21:03 - DEBUG - => Recv data: 95
{"code":404,"message":"No route found for \"GET https:\/\/<centreon>\/centreon\/api\/latest\/auto-discovery\/scheduling\/jobs\""}
0

 

I just spotted this in the Apache logs, will look into it to see if it helps to find he problem:

 

[Tue May 02 09:28:36.449519 2023] [mpm_event:notice] [pid 1033:tid 140081380907328] AH00492: caught SIGWINCH, shutting down gracefully
[Tue May 02 09:28:39.602406 2023] [suexec:notice] [pid 7966:tid 139820604209472] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue May 02 09:28:39.656151 2023] [ssl:warn] [pid 7966:tid 139820604209472] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue May 02 09:28:39.658228 2023] [lbmethod_heartbeat:notice] [pid 7966:tid 139820604209472] AH02282: No slotmem from mod_heartmonitor
[Tue May 02 09:28:39.665550 2023] [mpm_event:notice] [pid 7966:tid 139820604209472] AH00489: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k configured -- resuming normal operations
[Tue May 02 09:28:39.665628 2023] [core:notice] [pid 7966:tid 139820604209472] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Ok, so I fixed the blank page issue for extensions manager by clearing the browser cache, but the others still throw errors.

Userlevel 6
Badge +18

Hi, did you follow this procedure to upgrade ? https://docs.centreon.com/docs/upgrade/upgrade-from-22-10/

 

If you have a blank page, may be because you don’t update php-pecl-gnupg package:

dnf update php-pecl-gnupg

Then clean symphony cache:

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

 And restart php-fpm and Apache:

systemctl reload php-fpm httpd

 

Badge +5

Hi, did you follow this procedure to upgrade ? https://docs.centreon.com/docs/upgrade/upgrade-from-22-10/

 

Yes

Userlevel 2
Badge +7

Hi,

In my case, the package is up to date.

The only things I changed is the group membership of the user www-data which are not available in Alma8.

 

I changed with :

usermod -a -G apache centreon-broker
usermod -a -G centreon-broker apache

I clean symphony cache and reload php-fpm and httpd and the auto-discovery api seams not working:

2023-05-03 09:08:52 - ERROR - [autodiscovery] -class- host discovery - cannot get host discovery jobs - request error [code: '404'] [message: 'No route found for "GET https://XXXXX/centreon/api/latest/auto-discovery/scheduling/jobs"']

 

Badge +5

Hi,

In my case, the package is up to date.

The only things I changed is the group membership of the user www-data which are not available in Alma8.

 

I changed with :

usermod -a -G apache centreon-broker
usermod -a -G centreon-broker apache

I clean symphony cache and reload php-fpm and httpd and the auto-discovery api seams not working:

2023-05-03 09:08:52 - ERROR - [autodiscovery] -class- host discovery - cannot get host discovery jobs - request error [code: '404'] [message: 'No route found for "GET https://XXXXX/centreon/api/latest/auto-discovery/scheduling/jobs"']

 

Same here as it’s the same “apache” for RHEL8, but somehow it does not surprise me that the Centreon documentation never fits reality - worst one I came across was a plugin which was just a copy/paste of another plugin but none of the text was changed.

Userlevel 6
Badge +18

Hi, I asked to our documentation writers team to improve this part.

Do you have Centreon AutoDiscovery module installed ? If you don’t use it, you can remove it or disable this Centreon gorgone sub module in /etc/centreon-gorgone/config.d/41-autodiscovery.yaml file and restart gorgoned process

Userlevel 2
Badge +7

I don't use it on my test platform.
However, the installation of this version a few days after its availability makes it possible to anticipate the problems that we could encounter during the production’s migration.
So if the problem is proven, deleting the feature will only hide it :)

Userlevel 6
Badge +18

@Pascal to facilitate the installation of Centreon for IT-100 users, we install additional modules but they may not be used by everyone. This can add errors in the logs but by functional problems. You just have to uninstall the "excess" modules.

Userlevel 2
Badge +7

Am I to understand that automatic host discovery is no longer available for the IT-100 platform?

If so, it is strange to report that the API is not available.

Service auto-discovery seams work.

Will deleting the /etc/centreon-gorgone/config.d/41-autodiscovery.yaml file result in no longer processing host discovery, service discovery or both?

Userlevel 6
Badge +18

Hi @Pascal , no discovery still present with IT-100.

what I wanted to say is that when you install Centreon, the packages related to the discovery functionalities are automatically installed. If through the interface ("Administration > Extensions > Manager" menu), the features are not installed, then you may get the error message on the APIs because they are not loaded.

Userlevel 2
Badge +7

Hi @Laurent thanks for this confirmation :)

But, in my case, IT-100 is valid and the extension is deployed :

 

In fact I tried to remove the extension and reinstall it.

Now, api /auto-discovery/scheduling/jobs is now available and works.

But, I lose all my active discovery rules.

I hope not to have to do this operation during the migration of my production. It will be problematic to lose all my discovery rules.

Userlevel 6
Badge +18

If you have errors during your migration, try to rebuild cache:

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

If this operation fails, remove cache, then rebuild it using previous command:

rm -Rf /var/cache/centreon/symfony/*

 

Userlevel 3
Badge +4

Hello could you try to launch this command 

sudo -u apache php /usr/share/centreon/bin/console debug:router | grep scheduling

If your cache is correctly refreshed you should see the following result

 

 

# sudo -u apache php /usr/share/centreon/bin/console debug:router | grep scheduling
  autodiscovery.scheduling.findDiscoveryJobs                               GET      ANY      ANY    /{base_uri}api/{version}/auto-discovery/scheduling/jobs 

 

Badge +3

Hi,

I am still getting this error No route found for "GET /api/latest/auto-discovery/scheduling/jobs"

Is there any solution on how to fix this issue ?

Badge +3

No update on getting this resolved ??

Userlevel 3
Badge +4

Hello, after investigation we certainly have found the root cause of this issue. It will be fixed soon, before waiting for the patch here is a workaround:

 

Go to /usr/share/centreon/www/modules/centreon-autodiscovery-server/routes

 

You should see two files:

CentreonAutoDiscovery.yaml and CentreonAutoDiscovery.yaml.wait.

 

the CentreonAutoDiscovery.yaml is probably empty or different than  CentreonAutoDiscovery.yaml.wait.

  • remove CentreonAutoDiscovery.yaml
  • Rename CentreonAutoDiscovery.yaml.wait to CentreonAutoDiscovery.yaml
  • Clear the cache: sudo -u apache php /usr/share/centreon/bin/console cache:clear

The problem should be resolved.

Badge +5

I have followed every instruction above and I still have blank pages all over my server - both Monitoring and Reporting seem to work, but for Configuration and Administration every menu item is blank. In fact I think the last suggestion of yaml files may have made things worse, I no longer see route errors in the F12 console, but 500 errors.

Badge

Hello,

 

The workaround given by Jérémy Jaouen works fine.

Now, we have the autodiscover working as it should.

 

Philippe

Badge +1

Hello,

 

Since the upgrade I’ve the same issue as Pascal mentioned in my error.log :

AH01071: Got error 'PHP message: ERROR: No route found for "GET https://<centreon>/centreon/api/latest/it-edition-extensions/login_page"

I followed all instructions above but the problem is still here.

Does anyone have any other hints ?

 

Damien

Badge +1

So me too with a new install 23.04.6

have blank pages all over my server - both Monitoring and Reporting seem to work, but for Configuration and Administration every menu item is blank. 

Reply