The following error was found when installing for the first time. Please help me.
librenms@Librenms:~$ ./validate.php
| Component | Version |
|---|---|
| LibreNMS | 23.2.0-46-gd508d2d6f (2023-03-31T04:04:06+09:00) |
| DB Schema | 2023_03_14_130653_migrate_empty_user_funcs_to_null (249) |
| PHP | 8.2.4 |
| Python | 3.8.10 |
| Database | MariaDB 10.3.38-MariaDB-0ubuntu0.20.04.1 |
| RRDTool | 1.7.2 |
| SNMP | 5.8 |
| =========================================== |
[OK] Composer Version: 2.5.5
[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] 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] rrd_dir is writable
[OK] rrdtool version ok
librenms@Librenms:~$
librenms@Librenms:~$ lnms key:rotate --generate-new-key
Old APP_KEY: base64:2HRMaEZZjSCUwwkpAs87wnWquiYs83Wnw2ef4cyy4iY=
New APP_KEY: base64:THByTH6ssOET8oMmn2ZIT8lhL6mDWZhxZywOT2MmDe4=
Document BOTH keys! In case something goes wrong set the new key in .env and use the old key as an argument to this command
This command could cause irreversible loss of data and will invalidate all browser sessions. Make sure you have backups.
I have backups and want to continue (yes/no) [no]:
> yes
Failed to decrypt validation.encryption.test, skipping
Old APP_KEY: base64:2HRMaEZZjSCUwwkpAs87wnWquiYs83Wnw2ef4cyy4iY=
New APP_KEY: base64:THByTH6ssOET8oMmn2ZIT8lhL6mDWZhxZywOT2MmDe4=
Failed to decrypt item(s). Set new key as APP_KEY and run this again with the old key as an argument.
librenms@Librenms:~$
librenms@Librenms:~$ cat .env
#APP_KEY=base64:3nCQsjapp5H+N1HxBlHsYPeyr7I7iPc8ygov89bRbJ4= ← old key
APP_KEY=base64:THByTH6ssOET8oMmn2ZIT8lhL6mDWZhxZywOT2MmDe4= ← new key
DB_HOST=localhost
DB_DATABASE=librenms
DB_USERNAME=librenms
DB_PASSWORD=password
#APP_URL=
INSTALL=true
NODE_ID=642a476610d17
VAPID_PUBLIC_KEY=BChJzn6Vr0HmwOsjydW0v9Iu4K856Wl05gBfOD29-Kx6pFY_n7k561a3l3RJNUGIu7-mSGUWFVC3NR2beuJhHzs
VAPID_PRIVATE_KEY=qV77AmVc0QMKtVJgPRFyPguFaRRjx0HdoOOfEz2IO4Y
librenms@Librenms:~$