Error upgrading from 1.1.37 to 1.2.1

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Author
Message
stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Error upgrading from 1.1.37 to 1.2.1

#1 Post by stormonts » Fri Jan 25, 2019 11:41 am

We are currently running 1.1.37 and trying to upgrade to 1.2.1 using the same upgrade method we have used in the past, but we are getting the following error regarding version 1.2.0 instead:

System log file is not available for writing, please enable write access Log: /usr/local/cacti-1.2.0/log/cacti.log

The steps we use to upgrade are below (the old version is in /usr/local/cacti-1.1.37 which is symlinked to /usr/local/cacti)

sudo tar zvxf cacti-1.2.1.tar.gz
sudo chown root:wheel cacti-1.2.1
cd cacti-1.2.1
sudo chown zzhoppy:wheel –R *
vi /usr/local/cacti/include/config.php (copy DB name and DB PW and update ->) /usr/local/cacti-1.2.1/include/config.php
rm -rf /usr/local/cacti-1.2.1/rra
ln -s /usr/local/cacti1x_rra /usr/local/cacti-1.2.1/rra
sudo cp -u /usr/local/cacti/scripts/* /usr/local/cacti-1.2.1/scripts
sudo cp -u -R /usr/local/cacti/plugins/* /usr/local/cacti-1.2.1/plugins
cp -u -R /usr/local/cacti/resource/* /usr/local/cacti-1.2.1/resource
sudo cp /usr/local/cacti/utils.sh /usr/local/cacti-1.2.1/
sudo chown nobody:wheel -R /usr/local/cacti-1.2.1/resource/
sudo chown nobody:wheel -R /usr/local/cacti-1.2.1/scripts/
sudo chown nobody:wheel -R /usr/local/cacti-1.2.1/log/
sudo chown nobody:wheel -R /usr/local/cacti-1.2.1/cache/
mysqldump -l -u cactiuser -p --add-drop-table cacti1x > /usr/local/cacti1.1.37.sql
rm cacti
ln -s /usr/local/cacti-1.2.1 /usr/local/cacti
Last edited by stormonts on Wed Feb 13, 2019 3:57 pm, edited 1 time in total.

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#2 Post by netniV » Fri Jan 25, 2019 5:04 pm

Check that you are not getting bit by SELinux and that the log directory and files within are writable by the user your website runs under.

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#3 Post by stormonts » Sat Jan 26, 2019 5:00 pm

SELinux is not enabled on this server.

Unless something changed regarding required permissions between 1.1.37 and 1.2.1, the permissions on the "log" directory are the same as what worked in 1.1.37.

drwxrwxr-x 2 nobody wheel 4096 Jan 26 04:13 log/

I tried adding write permissions to "other" and the problem still exists.

Why am I seeing an error about 1.2.0 when that version has never touched this server?

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#4 Post by netniV » Mon Jan 28, 2019 8:23 am

What user does your website run under? What user does your poller run under?

What groups do they belong to? ("groups <username>" usually tells you)

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#5 Post by stormonts » Mon Jan 28, 2019 9:45 am

Apache runs as "nobody" which is in the "nobody" group.

The poller runs as "cactiuser" which is in the "wheel" and "cacti" groups.

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#6 Post by netniV » Mon Jan 28, 2019 10:25 am

Do the files in the log directory also reflect the same permissions? (664 for files, 775 for directories).

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#7 Post by stormonts » Mon Jan 28, 2019 3:49 pm

There is only one file in /usr/local/cacti-1.2.1/log and it is .htaccess.

-rw-rw-r-- 1 nobody wheel 170 Jan 20 11:01 .htaccess

The contents of that file and the permissions are the exact same as the one that is in the /usr/local/cacti-1.1.37 directory that is working.

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#8 Post by stormonts » Wed Jan 30, 2019 11:25 am

I created /usr/local/cacti-1.2.0/log and it get rid of the error (not sure why that is needed, since we are going from 1.1.37 to 1.2.1 as mentioned earlier).

Now I am being directed to the login screen for 1.1.37, I enter my credentials, and then it directs me to http://util-st-01/cacti/install/install.php (which is the correct server) but the page is totally blank and I don't see the GNU agreement.

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#9 Post by stormonts » Wed Jan 30, 2019 1:36 pm

I gave up and am attempting Cacti 1.2.0. I get the same issue with being directed to a login page and then a blank page at http://util-st-01/cacti/install/install.php. Looking at cacti.error.log, there are a bunch of errors which oddly reference both 1.2.0 and 1.2.1. Is PHP 7.2.13 supported?

Code: Select all

[Wed Jan 30 13:30:41.657960 2019] [proxy_fcgi:error] [pid 18483:tid 140688289085184] [client 172.21.133.21:58197] AH01071: Got error 'PHP message: PHP Warning:  include_once(./lib/ldap.php): failed to open stream: No such file or directory in /usr/local/cacti-1.2.0/auth_login.php on line 122\nPHP message: PHP Stack trace:\nPHP message: PHP   1. {main}() /usr/local/cacti-1.2.1/install/install.php:0\nPHP message: PHP   2. include_once() /usr/local/cacti-1.2.1/install/install.php:28\nPHP message: PHP   3. require_once() /usr/local/cacti-1.2.0/include/auth.php:95\nPHP message: PHP Warning:  include_once(): Failed opening './lib/ldap.php' for inclusion (include_path='.:/usr/local/php-7.2.13/php/includes:/usr/local/php-7.2.13/lib/php:/usr/local/smarty/libs') in /usr/local/cacti-1.2.0/auth_login.php on line 122\nPHP message: PHP Stack trace:\nPHP message: PHP   1. {main}() /usr/local/cacti-1.2.1/install/install.php:0\nPHP message: PHP   2. include_once() /usr/local/cacti-1.2.1/install/install.php:28\nPHP message: PHP   3. require_once() /usr/local/cacti-1.2.0/include/auth.php:95\nPHP message: PHP Fatal error:  Uncaught Error: Call to undefined function cacti_ldap_search_dn() in /usr/local/cacti-1.2.0/auth_login.php:125\nStack trace:\n#0 /usr/local/cacti-1.2.0/include/auth.php(95): require_once()\n#1 /usr/local/cacti-1.2.1/install/install.php(28): include_once('/usr/local/cact...')\n#2 {main}\n  thrown in /usr/local/cacti-1.2.0/auth_login.php on line 125\n', referer: http://util-st-01/cacti/install/install.php

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#10 Post by netniV » Wed Jan 30, 2019 2:43 pm

It sounds like you have several issues going on here and one of them is to do with using a synlink. Any paths that Cacti has worked out (and it may well have ignored the symlink because a lot of things use REALPATH to work out the proper location) maybe wrong in the DB's settings tables.

Another issue may be due to SELinux which must have the correct context set against the folders and files in order to work. Failing to do that under CentOS 7, for example, prevents apache from even displaying the site.

You should also check the folder that your apache configuration is pointed at and make sure it's definitely the 1.2.1 folders and that Cacti has all the subfolders are present because log and install are generally created if you extract any source files.

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#11 Post by stormonts » Wed Jan 30, 2019 2:59 pm

seLinux is not running on this server so that can be ruled out.

We have always used the symlink before and it has never been an issue (and currently isn't an issue with 1.1.37). Apache is pointing to the symlinked directory

Code: Select all

<VirtualHost util-st-01:80>
ServerName util-st-01
DirectoryIndex index.html index.html.var index.php index.xml
Alias /cacti /usr/local/cacti/
<Directory /usr/local/cacti>
  Options None
  AllowOverride Authconfig Options
  Require all granted
</Directory>
ErrorLog /usr/ims/maintenance/webservers/util-st-01/logs/cacti.error_log
CustomLog /usr/ims/maintenance/webservers/util-st-01/logs/cacti.access_log combined
</VirtualHost> 
What should I check in the DB settings tables?


stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#13 Post by stormonts » Wed Jan 30, 2019 8:07 pm

Below is the output. How can I change those entries to recognize our symlinked directory (/usr/local/cacti) instead of the version specific paths?

Code: Select all

mysql> SELECT * FROM settings where value like '/usr/local/cacti%';
+---------------------------+---------------------------------------------+
| name                      | value                                       |
+---------------------------+---------------------------------------------+
| boost_png_cache_directory | /usr/local/cacti/cache/boost/               |
| path_cactilog             | /usr/local/cacti-1.2.0/log/cacti.log        |
| path_stderrlog            | /usr/local/cacti-1.2.0/log/cacti_stderr.log |
| path_stderrrlog           | /usr/local/cacti-1.2.0/log/cacti_stderr.log |
| path_webroot              | /usr/local/cacti-1.1.37                     |
| realtime_cache_path       | /usr/local/cacti/cache/realtime/            |
| spikekill_backupdir       | /usr/local/cacti/cache/spikekill/           |
+---------------------------+---------------------------------------------+
7 rows in set (0.00 sec)

netniV
Cacti Guru User
Posts: 2795
Joined: Sun Aug 27, 2017 12:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#14 Post by netniV » Thu Jan 31, 2019 3:35 am

Just update them in the database for now. One you have completed the installation, I would be curious whether they revert back to non-symlinked. We may need to examine that process.

stormonts
Cacti User
Posts: 291
Joined: Tue Mar 31, 2009 10:05 am

Re: Error about 1.2.0, but I am upgrading from 1.1.37 to 1.2

#15 Post by stormonts » Thu Jan 31, 2019 8:53 am

Progress, but I am still stuck. I updated MySQL to this:

Code: Select all

mysql> SELECT * FROM settings where value like '/usr/local/cacti%';
+---------------------------+---------------------------------------------+
| name                      | value                                       |
+---------------------------+---------------------------------------------+
| boost_png_cache_directory | /usr/local/cacti/cache/boost/               |
| path_cactilog             | /usr/local/cacti-1.2.0/log/cacti.log        |
| path_stderrlog            | /usr/local/cacti-1.2.0/log/cacti_stderr.log |
| path_stderrrlog           | /usr/local/cacti-1.2.0/log/cacti_stderr.log |
| path_webroot              | /usr/local/cacti-1.1.37                     |
| realtime_cache_path       | /usr/local/cacti/cache/realtime/            |
| spikekill_backupdir       | /usr/local/cacti/cache/spikekill/           |
+---------------------------+---------------------------------------------+
7 rows in set (0.00 sec)

mysql> UPDATE settings SET value = '/usr/local/cacti/log/cacti.log' WHERE NAME = 'path_cactilog';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> UPDATE settings SET value = '/usr/local/cacti/log/cacti_stderr.log' WHERE NAME = 'path_stderrlog';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> UPDATE settings SET value = '/usr/local/cacti/log/cacti_stderr.log' WHERE NAME = 'path_stderrrlog';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM settings where value like '/usr/local/cacti%';
+---------------------------+---------------------------------------+
| name                      | value                                 |
+---------------------------+---------------------------------------+
| boost_png_cache_directory | /usr/local/cacti/cache/boost/         |
| path_cactilog             | /usr/local/cacti/log/cacti.log        |
| path_stderrlog            | /usr/local/cacti/log/cacti_stderr.log |
| path_stderrrlog           | /usr/local/cacti/log/cacti_stderr.log |
| path_webroot              | /usr/local/cacti-1.1.37               |
| realtime_cache_path       | /usr/local/cacti/cache/realtime/      |
| spikekill_backupdir       | /usr/local/cacti/cache/spikekill/     |
+---------------------------+---------------------------------------+
7 rows in set (0.00 sec)
I then update the symlink to point /usr/local/cacti to /usr/local/cacti-1.2.1.
When I go to http://util-st-01/cacti, I am re-directed to http://util-st-01/cacti/install and I see the License Agreement. I check the Accept box and then click Begin. I am then taken to the screen shown below but there is no way forward after that.
checks.png
checks.png (37.4 KiB) Viewed 1335 times

Post Reply