API ports message": "Server Error"

Hello,

The API call curl -H ‘X-Auth-Token: YOURAPITOKENHERE’ https://foo.example/api/v0/ports/323 isn’t working.
I’m getting the error message “message”: “Server Error”

Could you help me ?

Thanks community

Output of ./validate.php

==========================================
Component | Version
--------- | -------
LibreNMS  | 26.9.0-dev.79+33721d1c8f (2026-09-07T07:16:15+00:00)
DB Schema | 2026_07_30_162514_add_device_refresh_config_permission (397)
PHP       | 8.5.10
Python    | 3.11.2
Database  | MariaDB 10.11.18-MariaDB-0+deb12u1
RRDTool   | 1.7.2
SNMP      | 5.9.3
===========================================

[OK]    Composer Version: 2.9.8
[OK]    Dependencies up-to-date.
[OK]    Database Connected
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is unavailable
[OK]    No errors found with polling frequencies.
[OK]    rrd_dir is writable
[OK]    rrdtool version ok
[WARN]  Your local git contains modified files, this could prevent automatic updates.
	[FIX]: 
	You can fix this with ./scripts/github-remove
	Modified Files:
	 app/Http/Controllers/Maps/MapDataController.php
	 app/View/Components/Device/PageTabs.php
	 composer.json
	 composer.lock
	 html/js/librenms.js
	 resources/views/map/fullscreen.blade.php
	 rrd/.gitignore

What was the last working version of LibreNMS?

26.8.1

Anything in the logs that might be useful for us?

I set APP_DEBUG=true 
`{
    "message": "LibreNMS\\Cache\\PermissionsCache::canAccessDevice(): Argument #1 ($device) must be of type App\\Models\\Device|int, null given, called in /applis/librenms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 363",
    "exception": "TypeError",
    "file": "/applis/librenms/LibreNMS/Cache/PermissionsCache.php",
    "line": 61,
    "trace": [
        {
            "file": "/applis/librenms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php",
            "line": 363,
            "function": "canAccessDevice",
            "class": "LibreNMS\\Cache\\PermissionsCache",
            "type": "->"
        },
        {
            "file": "/applis/librenms/includes/html/functions.inc.php",
            "line": 125,
            "function": "__callStatic",
            "class": "Illuminate\\Support\\Facades\\Facade",
            "type": "::"
        },
        {....

`

I tested different curl commands

  • …/323/ip
  • …/323/transceiver
  • and …/323/description is the only one that works.

curl -H ‘X-Auth-Token: YOURAPITOKENHERE’ https://foo.example/api/v0/ports/323/descrption

{
    "status": "ok",
    "port_description": "DOC\/16\/A4"

Hello,

Updated this morning by ./daily.sh, and the issue persists

Version 26.8.1 - Thu Sep 03 2026 16:13:39 GMT+0200
Schéma de base de données 2026_09_13_120000_close_stuck_device_outages (399)
Serveur Web Apache/2.4.68 (Debian)
PHP 8.5.10
Python 3.11.2
Database MariaDB 10.11.18-MariaDB-0+deb12u1
Laravel 12.64.0
RRDtool 1.7.2
Net-SNMP 5.9.3

looks like you went backwards in versions, that is unsupported.
My guess is the port you are referencing is orphaned and the parent device was deleted.

Thanks for your message @murrant.

The graphical interface is a bit tricky, and the ./validate command doesn’t return the same version of Librenms and its configuration.

librenms@v-librenms-0:~$ ./validate.php 
===========================================
Component | Version
--------- | -------
LibreNMS  | 26.9.0-dev.134+de72f95838 (2026-09-15T20:30:46+00:00)
DB Schema | 2026_09_13_120000_close_stuck_device_outages (399)
PHP       | 8.5.10
Python    | 3.11.2
Database  | MariaDB 10.11.18-MariaDB-0+deb12u1
RRDTool   | 1.7.2
SNMP      | 5.9.3
===========================================

vs

I tried the curl command on several switches and several ports:
I’m sure there’s a port available at https://librenms.hub.fr/device/device=814/tab=port/port=19382/

curl -H ‘X-Auth-Token: tokensecret’ https://librenms.hub.fr/api/v0/ports/19382 returns

{“message”: “Server Error”}

???:face_with_monocle:

Thanks

That should not be possible to show separate versions. You must have something odd going on. I would get that figured out before worrying about the port thing.

I just checked, could you confirm this for me ?

The commit: 18a775268b "Dev version should always be 0 minor version” (#20391) actually changed the development versioning logic.

The constant remains as intended: public const VERSION = ‘26.8.1’; but validate.php constructs the development version from Git: 26.9.0-dev.146+9ab10f8277

The 26.8.1 displayed in “About” is not the version actually installed in my Git checkout. It is the base version constant used by LibreNMS for this development branch.

Thanks

image

the const VERSION never changes, except with main release. Displayed version should be dev version in all locations you an view it.

Great, thanks.

Which version of Librenms are you using? Could you test to see if curl works for you?

curl -H ‘X-Auth-Token: token’ ``https://librenms.hub.fr/api/v0/ports/3xx → Error

and

curl -H ‘X-Auth-Token: token’ ``https://librenms.hub.fr/api/v0/ports/3xx/description → OK

Thanks

Incident resolved by changing the token