Whoops, looks like something went wrong. Looks like database

Hi Guys,

After some trouble getting nginx to work, I was able to start the install wizard after tidying up a timezone issue with php.

I now have the above message at my librenms web page. I ran the ./validate and got the below;

[librenms@localhost ~]$ ./validate.php
====================================
Component | Version
 --------- | -------
LibreNMS  | 21.5.1-32-g20c44b85c
DB Schema | Not Connected (0)
PHP       | 7.3.20
Python    | 3.6.8
MySQL     | ?
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.8
====================================

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

Here is my /opt/librenms/.env file

     GNU nano 2.9.8                                                      /opt/librenms/.env                                                                          
     APP_KEY=base64:xzhkEnqM9GO6azNl3FophExE1v0df8hOXCWZ75/0Uos=

    #DB_HOST=127.0.0.1
    #DB_DATABASE=librenms
    #DB_USERNAME=librenms
    #DB_PASSWORD="mypassword"

    #APP_URL=
    NODE_ID=60c5daa3e4c71
    LIBRENMS_USER=librenms

Here is the start of my /opt/librenms/config.php file

## Have a look in misc/config_definitions.jsmisc/config_definitions.json!

 // This is the user LibreNMS will run as
 //Please ensure this user is created and has the correct permissions to your install
 $config['user'] = 'librenms';

 ### This should *only* be set if you want to *force* a particular hostname/port
 ### It will prevent the web interface being usable form any other hostname
 #$config['base_url']        = "/";

Do you guys see any issues?

Is the database running?

systemctl status mysqld

if so can you connect to it?

mysql -u librenms -h localhost -p librenms

Thanks, yes I can happily log into MySQL with my librenms account and the password listed in the .env file

I have a similar issue, but different output from ./validate:

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

Component Version
LibreNMS 21.6.0
DB Schema 2021_02_09_122930_migrate_to_utf8mb4 (204)
PHP 7.4.20
Python 3.8.10
MySQL 10.5.10-MariaDB-1:10.5.10+maria~bionic
RRDTool 1.7.2
SNMP NET-SNMP 5.8
====================================

[OK] Composer Version: 2.1.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
bootstrap/cache/.gitignore
logs/.gitignore
rrd/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/debugbar/.gitignore
storage/framework/cache/.gitignore
storage/framework/cache/data/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore

I was having the same issue (“oops, something went wrong…” while running on 18.04, so I upgraded to 20.04 but still can not access web ui.

Seems like my db is connected, but somehow still fails?

I updated the MariaDB:
====================================
Component | Version
--------- | -------
LibreNMS | 21.6.0
DB Schema | 2021_02_09_122930_migrate_to_utf8mb4 (204)
PHP | 7.4.20
Python | 3.8.10
MySQL | 10.5.10-MariaDB-1:10.5.10+maria~focal
RRDTool | 1.7.2
SNMP | NET-SNMP 5.8
====================================

[OK]    Composer Version: 2.1.3
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Your database is out of date!
        [FIX]:
        ./lnms migrate
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]:
        You can fix this with ./scripts/github-remove
        Modified Files:
         bootstrap/cache/.gitignore
         logs/.gitignore
         rrd/.gitignore
         storage/app/.gitignore
         storage/app/public/.gitignore
         storage/debugbar/.gitignore
         storage/framework/cache/.gitignore
         storage/framework/cache/data/.gitignore
         storage/framework/sessions/.gitignore
         storage/framework/testing/.gitignore
         storage/framework/views/.gitignore
         storage/logs/.gitignore

But still no luck. Could it be something with this?:

DB Schema 2021_02_09_122930_migrate_to_utf8mb4 (204)

what’s in logs/librenms.log anything useful?

not sure.
sort the git warning out first and try again.
./scripts/git-remove -d

Start your own post please. People are responding to you on my thread.

Sorry about that. Will do.

No worries, thanks :slight_smile:

1 Like

Hi Guys,

I am very happy to report that I have resolved this issue by recreating the /opt/librenms/.env file using the default values in this article and changing my password to suit.

https://docs.librenms.org/Support/Environment-Variables/

1 Like