Blank WebUI

Hello,

Fist of all, English is not my language, sorry for the mistakes I will probably make.

I’m setting up librenms on a Fedora Server and until last friday, I could access the WebUI.
Now, I just have a blank page. on librenms.mydomain.tld/install.php I have the “access denied” message.
I put die "test’; at the beginning of the ./index.php page and the text “test” is displayed on librenms.mydomain.tld:80.

I corrected the ownership of the files in the folder librenms.
Right now, firewalld and selinux are disabled for testing purpose.

Here’s the validate.php result.

====================================
Component | Version
--------- | -------
LibreNMS  | 1.49-89-g62113ebde
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.2.16
MySQL     | 10.3.12-MariaDB
RRDTool   | 1.7.1
SNMP      | NET-SNMP 5.8
====================================

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  Some devices have not been polled in the last 5 minutes. You may have performance issues.
        [FIX]:
        Check your poll log and see: http://docs.librenms.org/Support/Performance/
        Devices:
         localhost
<REDACTED>
          and 57 more...
[FAIL]  Discovery has not completed in the last 24 hours.
        [FIX]:
        Check the cron job to make sure it is running and using discovery-wrapper.py

librenms1|599x327

If you need more info than what I provided, please ask.

BR

Did you recently updated php?

Thanks for your reply.

I’m using PHP 7.2.16. I installed it two weeks ago while doing the installation of librenms.
It’s still the same version.

It tried to connect to librenms.domain.tld/login
That’s the error message I’ve got.

Error while loading this URI : Could not load the source for http://librenms.<REDACTED>/login.
[Exception... "Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIInputStream.available]"  nsresult: "0x80470002 (NS_BASE_STREAM_CLOSED)"  location: "JS frame :: resource://devtools/shared/DevToolsUtils.js :: onResponse :: line 607"  data: no]
Stack: onResponse@resource://devtools/shared/DevToolsUtils.js:607:25
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
Line: 607, column: 0

Still the same issue. I can’t access the web interface.
I have no idea what is wrong with this install.
I disabled selinux and firewalld, I have the librenms icon on the tab and I can connect to the port with telnet but the page is deseperately blank.

Have you checked your webserver configuration?

Cockpit is working on port 9090. I can access it.
For Librenms, I used the default installation process for centos:

<VirtualHost *:80>
  DocumentRoot /opt/librenms/html/
  ServerName  librenms.example.com

  AllowEncodedSlashes NoDecode
  <Directory "/opt/librenms/html/">
    Require all granted
    AllowOverride All
    Options FollowSymLinks MultiViews
  </Directory>
</VirtualHost>

Did you set the server name in the config?

That’s the only thing I changed. Thing is, as I said, it worked until an auto update and since then, I can access the web page.

Does http://URL/api/v0 return anything?

Try put this at the bottom of config.php $config['php_memory_limit'] = 1024;

Post output of yum list installed | grep php
Post output of apachectl -M

Thank you.

http:///api/v0 : blank page

$config['php_memory_limit'] = 1024;

I did it but I have no idea what it should to.
I restarted httpd : nothing.
I restarted the server: nothing.

dnf list installed | grep php

php.x86_64                                  7.2.16-1.fc29                    @updates 
php-PsrLog.noarch                           1.1.0-1.fc29                     @updates 
php-cli.x86_64                              7.2.16-1.fc29                    @updates 
php-common.x86_64                           7.2.16-1.fc29                    @updates 
php-composer-ca-bundle.noarch               1.1.2-1.fc29                     @fedora  
php-composer-semver.noarch                  1.5.0-1.fc29                     @updates 
php-composer-spdx-licenses.noarch           1.5.1-1.fc29                     @updates 
php-composer-xdebug-handler.noarch          1.3.2-1.fc29                     @updates 
php-fedora-autoloader.noarch                1.0.0-4.fc29                     @fedora  
php-fpm.x86_64                              7.2.16-1.fc29                    @updates 
php-gd.x86_64                               7.2.16-1.fc29                    @updates 
php-intl.x86_64                             7.2.16-1.fc29                    @updates 
php-json.x86_64                             7.2.16-1.fc29                    @updates 
php-jsonlint.noarch                         1.7.1-3.fc29                     @fedora  
php-justinrainbow-json-schema5.noarch       5.2.8-1.fc29                     @updates 
php-mbstring.x86_64                         7.2.16-1.fc29                    @updates 
php-mysqlnd.x86_64                          7.2.16-1.fc29                    @updates 
php-pdo.x86_64                              7.2.16-1.fc29                    @updates 
php-pecl-memcache.x86_64                    3.0.9-0.10.20170802.e702b5f.fc29 @fedora  
php-pecl-zip.x86_64                         1.15.4-1.fc29                    @updates 
php-process.x86_64                          7.2.16-1.fc29                    @updates 
php-seld-phar-utils.noarch                  1.0.1-6.fc29                     @fedora  
php-snmp.x86_64                             7.2.16-1.fc29                    @updates 
php-symfony-browser-kit.noarch              2.8.49-1.fc29                    @updates 
php-symfony-class-loader.noarch             2.8.49-1.fc29                    @updates 
php-symfony-common.noarch                   2.8.49-1.fc29                    @updates 
php-symfony-config.noarch                   2.8.49-1.fc29                    @updates 
php-symfony-console.noarch                  2.8.49-1.fc29                    @updates 
php-symfony-css-selector.noarch             2.8.49-1.fc29                    @updates 
php-symfony-debug.noarch                    2.8.49-1.fc29                    @updates 
php-symfony-dependency-injection.noarch     2.8.49-1.fc29                    @updates 
php-symfony-dom-crawler.noarch              2.8.49-1.fc29                    @updates 
php-symfony-event-dispatcher.noarch         2.8.49-1.fc29                    @updates 
php-symfony-expression-language.noarch      2.8.49-1.fc29                    @updates 
php-symfony-filesystem.noarch               2.8.49-1.fc29                    @updates 
php-symfony-finder.noarch                   2.8.49-1.fc29                    @updates 
php-symfony-http-foundation.noarch          2.8.49-1.fc29                    @updates 
php-symfony-http-kernel.noarch              2.8.49-1.fc29                    @updates 
php-symfony-polyfill.noarch                 1.9.0-1.fc29                     @fedora  
php-symfony-process.noarch                  2.8.49-1.fc29                    @updates 
php-symfony-var-dumper.noarch               2.8.49-1.fc29                    @updates 
php-symfony-yaml.noarch                     2.8.49-1.fc29                    @updates 
php-xml.x86_64                              7.2.16-1.fc29                    @updates 

httpd -M

Loaded Modules:

 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 brotli_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 cache_socache_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 macro_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 request_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_redis_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 watchdog_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 lua_module (shared)
 mpm_event_module (shared)
 proxy_module (shared)
 lbmethod_bybusyness_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_heartbeat_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_connect_module (shared)
 proxy_express_module (shared)
 proxy_fcgi_module (shared)
 proxy_fdpass_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_hcheck_module (shared)
 proxy_scgi_module (shared)
 proxy_uwsgi_module (shared)
 proxy_wstunnel_module (shared)
 systemd_module (shared)
 cgid_module (shared)
 http2_module (shared)
 proxy_http2_module (shared)

There’s something strange though.
When I do lynx localhost:80 I get an 403 error.

Can you also php -m

As a test you could change the DocumentRoot /opt/test/
create /opt/test/index.php and insert <?php phpinfo(); ?>

find apache user ps aux | egrep '(apache|httpd)'
chown -R aboveuser:aboveuser /opt/test

restart apache

navigate to your server_name as the URL, then if that works, then try it with librenms:librenms permissions

php -m

[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
memcache
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib
[Zend Modules]

create /opt/test/index.php and insert <?php phpinfo(); ?> (+ restart httpd)
Test: OK I see the phpinfo.

ps aux | egrep '(apache|httpd)'

apache    1250  0.0  0.8 318772 17016 ?        S    15:16   0:00 php-fpm: pool www
apache    1251  0.0  0.9 318904 18692 ?        S    15:16   0:00 php-fpm: pool www
apache    1252  0.0  0.8 318772 17016 ?        S    15:16   0:00 php-fpm: pool www
apache    1253  0.0  0.5 318772 11844 ?        S    15:16   0:00 php-fpm: pool www
apache    1254  0.0  0.5 318772 11844 ?        S    15:16   0:00 php-fpm: pool www
root      3113  0.0  0.5  33172 11416 ?        Ss   16:24   0:00 /usr/sbin/httpd -DFOREGROUND
apache    3114  0.0  0.3  43484  6412 ?        S    16:24   0:00 /usr/sbin/httpd -DFOREGROUND
apache    3115  0.0  0.4 1560008 8572 ?        Sl   16:24   0:00 /usr/sbin/httpd -DFOREGROUND
apache    3116  0.0  0.4 1691144 8572 ?        Sl   16:24   0:00 /usr/sbin/httpd -DFOREGROUND
apache    3117  0.0  0.4 1560008 8572 ?        Sl   16:24   0:00 /usr/sbin/httpd -DFOREGROUND
root      3457  0.0  0.0 215744   956 pts/0    S+   16:30   0:00 grep -E --color=auto (apache|httpd)

ps aux | egrep '(librenms)'

librenms   858  0.0  0.0 144520   636 ?        Ssl  15:16   0:00 /usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -B -R -j /var/tmp -l unix:/run/rrdcached.sock -t 4 -F -b /opt/librenms/rrd/
root      3463  0.0  0.0 215744   828 pts/0    S+   16:30   0:00 grep -E --color=auto (librenms)

chown -R aboveuser:aboveuser /opt/test (+ restart httpd)
Test: OK I see the phpinfo

librenms:librenms permissions (+ restart httpd)
Test: OK I see the phpinfo

So, it means there’s an access right issue with /opt/librenms/ then, right?
I did that according to the manual.

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/

Not if it was successful with librenms:librenms. If this failed then it would point to librenms not being in the web server group.

The Php info webpage says the correct version aswell 7.2 ?

Yes. It’s PHP Version 7.2.16 for librenms:librenms.

I can’t see anything wrong there,

Change the DocumentRoot back to /opt/librenms/html/ and restart apache.

In /opt/librenms run php artisan key:generate

In /opt/librenms/.env file,
Ensure APP_KEY is set.
Insert APP_DEBUG=true

Any information now in the webpage?

If no,
/opt/librenms/html/index.php
after <?php at the top of the file, insert.

error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set("display_errors", 1);

Any information now ?

Then try:

sudo chmod -R 777 /opt/librenms/bootstrap/cache

sudo chmod -R 777 /opt/librenms/storage

After debugging, run this in /opt/librenms

git checkout -- html/index.php
./daily.sh
./validate.php

Change the DocumentRoot back to /opt/librenms/html/ and restart apache. /opt/librenms/html/

Done.

/opt/librenms run php artisan key:generate
Task successful.

In /opt/librenms/.env file,
Ensure APP_KEY is set.
Ok
Insert APP_DEBUG=true
Still a blank page.

**error_reporting(E_ALL);**
**ini_set('error_reporting', E_ALL);**
**ini_set("display_errors", 1);**

Still nothing.
**sudo chmod -R 777 /opt/librenms/bootstrap/cache**
**sudo chmod -R 777 /opt/librenms/storage**

Done and done.

git checkout – html/index.php
./daily.sh
./validate.php
No output after the command. I don’t know if something should have happened.

I don’t get it, everything is fine, error_log is telling me I can access my apache server, if I add echo ‘test’; at the begining of index.php, it display the text. But I there’s nothing from librenms.
I even tried http:///api/v0 and it displays test.

./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.50-33-g36e709eba
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.2.16
MySQL     | 10.3.12-MariaDB
RRDTool   | 1.7.1
SNMP      | NET-SNMP 5.8
====================================

[OK]    Composer Version: 1.8.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  Some devices have not been polled in the last 5 minutes. You may have performance issues.
        [FIX]:
        Check your poll log and see: http://docs.librenms.org/Support/Performance/
        Devices:
         localhost
         and 57 more...
[FAIL]  Discovery has not completed in the last 24 hours.
        [FIX]:
        Check the cron job to make sure it is running and using discovery-wrapper.py
[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
         html/index.php
         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’m not very confident in doing ./scripts/github-remove.

We broke it a little bit from debugging.

Run through this again

chown -R librenms:librenms /opt/librenms
./scripts/github-remove -d
./daily.sh
./validate.php
git status
curl http://localhost (or if using SSL, curl https://localhost --insecure)

Can you help to post outputs from each command,

chown -R librenms:librenms /opt/librenms
OK

./scripts/github-remove -d
OK

./daily.sh

Re-running /opt/librenms/daily.sh as librenms user
Updating to latest codebase                        OK
Updating Composer packages                         OK
Updated from 36e709eba to 54c7ed3d0                OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK

./validate.php

====================================
Component | Version
--------- | -------
LibreNMS  | 1.50-34-g54c7ed3d0
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.2.16
MySQL     | 10.3.12-MariaDB
RRDTool   | 1.7.1
SNMP      | NET-SNMP 5.8
====================================

[OK]    Composer Version: 1.8.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  Some devices have not been polled in the last 5 minutes. You may have performance issues.
    [FIX]:
    Check your poll log and see: http://docs.librenms.org/Support/Performance/
    Devices:
     localhost
     and 57 more...
[FAIL]  Discovery has not completed in the last 24 hours.
    [FIX]:
    Check the cron job to make sure it is running and using discovery-wrapper.py

git status

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

curl

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <head>
                <title>Test Page for the Apache HTTP Server on Fedora</title>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                <style type="text/css">
                        
[...]

</html>

That curl output was not what I expected.

Whoops forgot its vhosts,

curl your set server_name

librenms.mydomain.tld

Wait, either way, I still get the apache default page.
Il checked and the /etc/httpd/conf.d/librenms.conf is correct but it doesn’t seem to point to /opt/librenms/html/index.php.

That’s new.

tail on access_log give me error 500. I need to check the man pages.