LibreNMS has broken over the weekend

So trying to access Librenms web this morning, I get this error:

Whoops, looks like something went wrong. Check your librenms.log.

I can log into mmariadb with my librenms username and password but librenms does not recognize that is can:
**-bash-4.2$ ./daily.sh
Could not connect to database, check logs/librenms.log.
Updating SQL-Schema OK
Cleaning up DB OK
Could not connect to database, check logs/librenms.log.
-bash-4.2$
**
-bash-4.2$ ./validate.php

Component Version
LibreNMS 21.8.0-22-ge81ee98
DB Schema Not Connected (0)
PHP 7.4.22
Python 3.6.8
MySQL ?
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.
Could not connect to database, check logs/librenms.log.

When asking for help and support, please provide as much information as possible. This should include:

  • Steps to reproduce an issue.
  • The output of ./validate.php

If it’s an issue with the WebUI then please consider including a screenshot and the browser version you are using.

If you are having troubles with discovery/polling include the pastebin output of:

./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh

If you need to post any text longer than a few lines, please use a pastebin service such as https://p.libren.ms using non-expiring pastes.

This error is in my librenms.log:

#85 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#86 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#87 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#88 {main}
"}
~

-bash-4.2$ ./lnms migrate --pretend


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

In Connection.php line 692:

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = librenms and
table_name = migrations and table_type = ‘BASE TABLE’)

In Exception.php line 18:

SQLSTATE[HY000] [2002] No such file or directory

In PDOConnection.php line 39:

SQLSTATE[HY000] [2002] No such file or directory

-bash-4.2$

MariaDB [librenms]> show tables from librenms;
±-------------------------------+
| Tables_in_librenms |
±-------------------------------+
| access_points |
| alert_device_map |
| alert_group_map |
| alert_location_map |
| alert_log |
| alert_rules |
| alert_schedulables |
| alert_schedule |
| alert_template_map |
| alert_templates |
| alert_transport_groups |
| alert_transport_map |
| alert_transports |
| alerts |
| api_tokens |
| application_metrics |
| applications |
| authlog |
| availability |
| bgpPeers |
| bgpPeers_cbgp |
| bill_data |
| bill_history |
| bill_perms |
| bill_port_counters |
| bill_ports |
| bills |
| cache |
| cache_locks |
| callback |
| cef_switching |
| ciscoASA |
| component |
| component_prefs |
| component_statuslog |
| config |
| customers |
| customoids |
| dashboards |
| dbSchema |
| device_graphs |
| device_group_device |
| device_groups |
| device_outages |
| device_perf |
| device_relationships |
| devices |
| devices_attribs |
| devices_group_perms |
| devices_perms |
| entPhysical |
| entPhysical_state |
| entityState |
| eventlog |
| graph_types |
| hrDevice |
| ipsec_tunnels |
| ipv4_addresses |
| ipv4_mac |
| ipv4_networks |
| ipv6_addresses |
| ipv6_networks |
| isis_adjacencies |
| juniAtmVp |
| links |
| loadbalancer_rservers |
| loadbalancer_vservers |
| locations |
| mac_accounting |
| mefinfo |
| mempools |
| migrations |
| mpls_lsp_paths |
| mpls_lsps |
| mpls_saps |
| mpls_sdp_binds |
| mpls_sdps |
| mpls_services |
| mpls_tunnel_ar_hops |
| mpls_tunnel_c_hops |
| munin_plugins |
| munin_plugins_ds |
| netscaler_vservers |
| notifications |
| notifications_attribs |
| ospf_areas |
| ospf_instances |
| ospf_nbrs |
| ospf_ports |
| packages |
| pdb_ix |
| pdb_ix_peers |
| plugins |
| poller_cluster |
| poller_cluster_stats |
| poller_groups |
| pollers |
| port_group_port |
| port_groups |
| ports |
| ports_adsl |
| ports_fdb |
| ports_nac |
| ports_perms |
| ports_stack |
| ports_statistics |
| ports_stp |
| ports_vlans |
| printer_supplies |
| processes |
| processors |
| proxmox |
| proxmox_ports |
| pseudowires |
| route |
| sensors |
| sensors_to_state_indexes |
| service_templates |
| service_templates_device |
| service_templates_device_group |
| services |
| session |
| sessions |
| slas |
| state_indexes |
| state_translations |
| storage |
| stp |
| syslog |
| tnmsneinfo |
| transport_group_transport |
| ucd_diskio |
| users |
| users_prefs |
| users_widgets |
| vlans |
| vminfo |
| vrf_lite_cisco |
| vrfs |
| widgets |
| wireless_sensors |
±-------------------------------+
141 rows in set (0.001 sec)

MariaDB [librenms]>

Your .env file does not contain a valid path to a mysql server

Interesting. the .env file has not been touched:

APP_KEY=base64:JbWoH3PimQgUvWsbC38mxXP02fbfeQYeIb7cKqGhy3U=

DB_HOST=127.0.0.1
DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=redacted
#DB_SOCKET=/var/run/mysqld/mysqld.sock

#APP_URL=
NODE_ID=5af5b099713a8
DB_PORT=3306
LIBRENMS_USER=librenms
DB_DATABASE=librenms
DB_SOCKET=/var/run/mysqld/mysqld.sock

Resolved - Thanks Jellyfrog. It was an update to Mariadb. Replaced my my.cnf with generic file. I matched the rpm.saved version with the .env and I am working again.

Hi Ed

How did you resolve your issue with the mariadb? I’ve just updated Ubuntu to 20.04 and receiving the same error as you had with Librenms, see below.

====================================

Component Version
LibreNMS 21.9.0-63-g7fe8ddfb2
**DB Schema Not Connected (0)**
PHP 7.2.24-0ubuntu0.18.04.9
Python 3.8.10
**MySQL ?**
RRDTool 1.7.2
SNMP NET-SNMP 5.8

====================================

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.

Thanks