./ENV is missing from both my upgraded NMS and new installs

So I started a new job recently (as the only person in the tech department) and found that my predecessors haven’t allowed an update to LibreNMS since sometime before March 2020. There were a ton of error messages in the notifications and the terminal was showing MariaDB 5.5 and Python 2.7.

I went through the update process according to other documentation on these help articles (thank you so much everyone) - python now shows 3.6 and MariaDB was up to 10.5. However, during the upgrade the ./env file someone disappeared and searching in the rrd directory, I do not see another file with that name that I can copy to recreate it (I saw that was a recommendation from another user unless I’m not understanding that correctly). The ./validate.php command is showing DB Schema is showing “Not Connected” with the updated python version, but I can’t get much more out of it than that.

In an apparently feeble attempt to figure this out, I followed documentation from NGINX and LibreNMS to start from scratch on my home servers. I followed every single step twice (two separate VMs) - just copying commands that were provided - but even still there is not ./env file and I can’t get the DB Schema connected to something so I can get this up and running again.

Is there a way to create the ./env file from the config.php file or anything I should do to possibly correct this?

At my job site the VM is CentOS 7 and at my home the VMs are CentOS 8.

(I hate to ask this, but if possible, please understand I’m new to Libre and only dabbled a bit in the Linux world)

Output from validate.php on one of my home VMs with a fresh install of LibreNMS (I’m not seeing a spot to mark the following as a block of code):

[l[email protected] ~]$ ./validate.php

Component Version
LibreNMS 21.12.1-38-g2d24b2cf9
DB Schema Not Connected (0)
PHP 7.3.20
Python 3.6.8
MySQL ?
RRDTool 1.7.0
SNMP 5.8

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

[OK] Composer Version: 2.2.5
[OK] Dependencies up-to-date.
Could not connect to database, check logs/librenms.log.
[[email protected] ~]$

Running this step should create it:
https://docs.librenms.org/Installation/Install-LibreNMS/#install-php-dependencies

Else you can simply copy it from https://github.com/librenms/librenms/blob/master/.env.example

Then you need to populate it and run php artisan config:clear

Thank you! I’ll give both suggestions a try and let you know!

So installing the PHP dependencies worked! Thank you!

Not to add to this thread though I’m still seeing the DB Schema not connected. I’ve set the permissions several times and made sure the DB name, user, and password are the same between config.php and .env (even surrounded them with single quotes in .env to match the config file) and it’s still not connecting when I run ./validate.php.

MariadDB is running and enabled, I’ve restarted after following the steps from the documentation just to be sure. SHOW DATABASES; and SHOW SCHEMAS; does show librenms in the lists.

Any thoughts?

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