Unable to generate a URL for the named route "heartbeat" NC 29

Nextcloud version (eg, 29.0.5): 29.0.2
Operating system and version (eg, Ubuntu 29.04): Ubuntu 22.04.LTS
Apache or nginx version (eg, Apache 2.4.25): nginx 1.27.0
PHP version (eg, 8.3): 8.1.29

The issue you are facing:

Repeating entries (info level) in the Nextcloud log with:

“RouteNotFoundException” Unable to generate a URL for the named route “heartbeat” as such route does not exist.

Is this the first time you’ve seen this error? (Y/N):

Steps to replicate it:

  1. Just using Nextcloud

The output of your Nextcloud log in Admin > Logging:

[no app in context] Info: Unable to generate a URL for the named route "heartbeat" as such route does not exist.
	GET /settings/ajax/checksetup
	from a.b.c.d by my_username at 10 juni 2024 15:17:47

There are no errors in nginx log, PHP log, or any other log that I’ve been able to find.

Doing a sudo -u nextcloudweb php -f /var/www/nextcloud/occ setupchecks -v gives no errors.

Because of this bug perhaps a problem with the app Log Reader. @kesselb

Hmm… thank for your reply :+1:

But I haven’t configured 'log_type', and according to config.sample.php, the default is 'log_type' => 'file'

Isn’t the Log Reader almost required? I mean, if you want to check logs from within NC :thinking:

On my test system i have disabled the log reader. The Nextcloud still works but then i can not see the protocol https:/cloud.server.tld/index.php/settings/admin/logging. Perhaps also a way to stop seeing errors. :wink:

Unfortunately, I don’t know any better than what the issue says.

!!! -that’s not even regarded as a real mistake by the system.

I understand that, but as a long-time sysadmin, “Unable to…” <anything> is typically a sign of something not quite right.

I mean, if it’s not even an issue, why log it at all? Or log it as something other than an RouteNotFoundException. But that’s probably just me.

The usual reason for this error is that an app is not loaded an server or another app tries to generate a url to a page provided by the page.

However “heartbeat” belongs to the server itself and is a bit weird because a route definition does not exist for it.

We could avoid the info message by a fake route like below or using a different endpoint the http request.

Index: core/routes.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
diff --git a/core/routes.php b/core/routes.php
--- a/core/routes.php	(revision bab91258e3a25ea4cfe6c537f689a1d4254fc433)
+++ b/core/routes.php	(date 1718099899712)
@@ -11,5 +11,7 @@
 /** @var $this OCP\Route\IRouter */
 // Core ajax actions
 // Routing
+$this->create('heartbeat', '/heartbeat');
 $this->create('core_ajax_update', '/core/ajax/update.php')
1 Like

Please log an issue at Issues · nextcloud/server · GitHub

Fixed by fix(settings): define a 'heartbeat' route, so SecurityHeaders can handle redirected root by smokris · Pull Request #45228 · nextcloud/server · GitHub and is scheduled for 28.0.7 and 29.0.3.