Validate App Key Error

System corrupted original librenms directory, so I installed from git. Now I’m receiving an app key error when validating. I’ve run the suggested “lnms key:rotate” and checked the keys in “.env”. I’ve also generated new keys with ./lnms key:generate, but can’t seem to get the keys to match.

Any insight?

Output of ./validate.php:

===========================================
Component | Version
--------- | -------
LibreNMS  | 22.9.0-63-g3e3752eb7 (2022-10-17T12:18:38-05:00)
DB Schema | 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP       | 8.1.11
Python    | 3.9.2
Database  | MariaDB 10.5.15-MariaDB-0+deb11u1
RRDTool   | 1.7.2
SNMP      | 5.9
===========================================

[OK]    Composer Version: 2.4.3
[OK]    Dependencies up-to-date.
[FAIL]  APP_KEY does not match key used to encrypt data. APP_KEY must be the same on all nodes.
        [FIX]:
        If you rotated APP_KEY, run lnms key:rotate to resolve.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]
[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]    rrdtool version ok
[OK]    Connected to rrdcached

I’m in the same boat. Aside from that error in validate, everything seems to be working. I’m not sure what data has been encrypted.

Well shucks. As you say, everything appears to be working fine. I’m not sure what’s happening here.

Hopefully we’ll hear from someone with insight.

Right now it is just one piece of test data to see how much users fail at backing up APP_KEY.

Eventually it should be all credentials (snmp, etc).

And how are we to know we should backup APP_KEY, along with our rrd data, Libre config, php dependencies in a separate directory and sideloaded application data? It would seem the real test of failure isn’t on the user…

Thanks

That is good question and one reason, why APP_KEY isn’t used for any real data yet.

The docs do suggest backing up the following things:

  • database dump
  • .env
  • config.php
  • rrd files (if you want graph data)

APP_KEY is in .env

It needs to be visible in more spots. Like at install with a big warning that says do NOT lose this key.

Same problem here, didn’t show an advice to save .env, had to reinstall after a disk failure.

Is there a way to reinitialize that app_key as it is not yet used ? (tried the lnms key:rotate --generate-new-key without any success).

Or do I have to do a new installation starting with an empty database ?

I don’t want to populate my instance (which already have 140 devices) with more devices and discover in a few months that I have to start from zero because app_key will now be really used.

Thanks for your help !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.