HTTP 500 error

Errors after running ./daily and ./validate

:/opt/librenms$ ./validate.php
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0

Component Version
LibreNMS 1.49-15-g57be00b
DB Schema 2019_02_10_220000_add_dates_to_fdb (132)
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1
MySQL 5.7.25-0ubuntu0.16.04.2
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: incorrect column (sensors/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/state_index_id)
[FAIL] Database: missing index (sensors_to_state_indexes/state_index_id)
[FAIL] Database: extra index (sensors_to_state_indexes/sensors_to_state_indexes_ibfk_1)
[FAIL] Database: incorrect column (state_indexes/state_index_id)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE sensors CHANGE sensor_id sensor_id int(10) unsigned NOT NULL auto_increment;
ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes DROP INDEX sensors_to_state_indexes_ibfk_1;
ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);
ALTER TABLE state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL auto_increment;
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/php_mbstring.dll’ - /usr/lib/php/20160303/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[FAIL] Some folders have incorrect file permissions, this may cause issues.
[FIX]:
sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Files:
/opt/librenms/storage/framework/views/02f85731f51d6b7c1b55345259b2b95d7916c612.php

Also the site is not loading 0 i get this error is currently unable to handle this request.

HTTP ERROR 500

Check your php.ini you seem to have enabled an extension with a dll file extension, but those are for Windows.

Thanks you was totally right , that has fixed the error , but still get 500 errors. :frowning:

I am still getting 500 errors

:/opt/librenms$ ./validate.php

Component Version
LibreNMS 1.49-20-g30bcc8d
DB Schema 2019_02_10_220000_add_dates_to_fdb (132)
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1
MySQL 5.7.25-0ubuntu0.16.04.2
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: incorrect column (sensors/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/state_index_id)
[FAIL] Database: missing index (sensors_to_state_indexes/state_index_id)
[FAIL] Database: extra index (sensors_to_state_indexes/sensors_to_state_indexes_ibfk_1)
[FAIL] Database: incorrect column (state_indexes/state_index_id)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE sensors CHANGE sensor_id sensor_id int(10) unsigned NOT NULL auto_increment;
ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes DROP INDEX sensors_to_state_indexes_ibfk_1;
ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);
ALTER TABLE state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL auto_increment;

Can some point me in the direction of where to look , this started after i ran git pull , and daily.

Thanks

Dave

Also I get this

mysql> use librenms
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> ALTER TABLE sensors CHANGE sensor_id sensor_id int(10) unsigned NOT NULL auto_increment;
ERROR 1833 (HY000): Cannot change column ‘sensor_id’: used in a foreign key constraint ‘sensors_to_state_indexes_sensor_id_foreign’ of table ‘librenms.sensors_to_state_indexes’
mysql> ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);
ALTER TABLE state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL auto_increment;
ERROR 1832 (HY000): Cannot change column ‘sensor_id’: used in a foreign key constraint ‘sensors_to_state_indexes_sensor_id_foreign’
mysql> ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL ;
ERROR 1832 (HY000): Cannot change column ‘state_index_id’: used in a foreign key constraint ‘sensors_to_state_indexes_ibfk_1’
mysql> ALTER TABLE sensors_to_state_indexes DROP INDEX sensors_to_state_indexes_ibfk_1;
ERROR 1553 (HY000): Cannot drop index ‘sensors_to_state_indexes_ibfk_1’: needed in a foreign key constraint
mysql> ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> ALTER TABLE state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL auto_increment;
ERROR 1833 (HY000): Cannot change column ‘state_index_id’: used in a foreign key constraint ‘sensors_to_state_indexes_ibfk_1’ of table ‘librenms.sensors_to_state_indexes’
mysql>

Also I am seeing this error in the logs.

[stacktrace]
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(598): Laravel\Dusk\DuskServiceProvider->register()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\Foundation\Application->register(Object(Laravel$
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(574): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfigu$
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(211): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Obj$
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(297): Illuminate\Foundation\Application->bootstrapWith(Array)
#6 /opt/librenms/LibreNMS/Util/Laravel.php(47): Illuminate\Foundation\Console\Kernel->bootstrap()
#7 /opt/librenms/includes/init.php(96): LibreNMS\Util\Laravel::bootCli()
#8 /opt/librenms/alerts.php(31): require(’/opt/librenms/i…’)
#9 {main}
"}


Still can’t access the GUI , what is the best way to proceed

./validate.php

Component Version
LibreNMS 1.49-20-g30bcc8d
DB Schema 2019_02_10_220000_add_dates_to_fdb (132)
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1
MySQL 5.7.25-0ubuntu0.16.04.2
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: incorrect column (sensors/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/state_index_id)
[FAIL] Database: incorrect column (state_indexes/state_index_id)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on Discord (LibreNMS) or the community site (Report database schema issues here - LibreNMS Community):
[FIX]:
Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE sensors CHANGE sensor_id sensor_id int(10) unsigned NOT NULL auto_increment;
ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int(10) unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL ;
ALTER TABLE state_indexes CHANGE state_index_id state_index_id int(10) unsigned NOT NULL auto_increment;

Thanks

Also looking in error logs in apache I see this,

[Wed Mar 06 14:03:40.642746 2019] [:error] [pid 2443] [clientx.x.x.x.x1771] PHP Parse error: syntax error, unexpected ‘=’ in /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 388

That error is because you are using an older version of PHP.

Thanks

I will update

Just for your webserver. The CLI version (7.1) is fine.

What version should I be using , i might have to get the sysadmins to update it. Thanks.