Problem with cacti upgrading (0.8.8d to 0.8.8f)

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

Moderators: Developers, Moderators

Post Reply
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Hi,

I tried to upgrade cacti 0.8.8d to 0.8.8f. After upgrading I got blank page in web browser and several errors in Apache log:

Code: Select all

[Tue Jul 21 10:33:04.623620 2015] [:error] [pid 36309] [client 94.XXX.XXX.244:55144] PHP Warning:  include(0_8_8f_to_0_8_8f.php): failed to open stream: No such file or directory in /usr/local/share/cacti/install/index.php on line 471, referer: http://noc.xxx.net/cacti/install/index.php
[Tue Jul 21 10:33:04.623688 2015] [:error] [pid 36309] [client 94.XXX.XXX.244:55144] PHP Warning:  include(): Failed opening '0_8_8f_to_0_8_8f.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/local/share/cacti/install/index.php on line 471, referer: http://noc.xxx.net/cacti/install/index.php
[Tue Jul 21 10:33:04.623707 2015] [:error] [pid 36309] [client 94.XXX.XXX.244:55144] PHP Fatal error:  Call to undefined function upgrade_to_0_8_8f() in /usr/local/share/cacti/install/index.php on line 472, referer: http://noc.xxx.net/cacti/install/index.php
How can I fix it?


P.S.
System information:

Code: Select all

FreeBSD 9.3 (amd64)
User avatar
Happiness0
Cacti User
Posts: 63
Joined: Wed Oct 29, 2014 5:01 am
Contact:

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by Happiness0 »

The messages mean they are some missing files in your cacti installation. How did you upgrade cacti?
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Happiness0 wrote:The messages mean they are some missing files in your cacti installation. How did you upgrade cacti?
I'm using portupgrade:

Code: Select all

--->  Upgrading 'cacti-0.8.8d' to 'cacti-0.8.8f' (net-mgmt/cacti)
--->  Building '/usr/ports/net-mgmt/cacti'
===>  Cleaning for cacti-0.8.8f
===>  License GPLv2 accepted by the user
===>   cacti-0.8.8f depends on file: /usr/local/sbin/pkg - found
=> cacti-0.8.8f.tar.gz doesn't seem to exist in /var/ports/distfiles/.
=> Attempting to fetch http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz
fetch: http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz: size mismatch: expected 2594481, actual 2594409
=> Attempting to fetch ftp://ftpmirror.uk/freebsd-ports/cacti/cacti-0.8.8f.tar.gz
cacti-0.8.8f.tar.gz                           100% of 2533 kB  992 kBps 00m03s
===> Fetching all distfiles required by cacti-0.8.8f for building
===>  Extracting for cacti-0.8.8f
=> SHA256 Checksum OK for cacti-0.8.8f.tar.gz.
===>  Patching for cacti-0.8.8f
===>  Applying FreeBSD patches for cacti-0.8.8f
/bin/rm -f -r /var/ports/basejail/usr/ports/net-mgmt/cacti/work/cacti-0.8.8f/log /var/ports/basejail/usr/ports/net-mgmt/cacti/work/cacti-0.8.8f/rra
===>   cacti-0.8.8f depends on shared library: libmysqlclient.so.18 - found (/usr/local/lib/mysql/libmysqlclient.so.18)
===>  Configuring for cacti-0.8.8f
===>  Staging for cacti-0.8.8f
===>   cacti-0.8.8f depends on executable: rrdtool - found
===>   cacti-0.8.8f depends on file: /usr/local/include/php/main/php.h - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/mysql.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/session.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/sockets.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/snmp.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/xml.so - found
===>   Generating temporary packing list
===> Creating users and/or groups.
/bin/mkdir -p /var/ports/basejail/usr/ports/net-mgmt/cacti/work/stage//usr/local/share/cacti
/bin/mkdir -p /var/ports/basejail/usr/ports/net-mgmt/cacti/work/stage/var/log/cacti
/bin/mkdir -p /var/ports/basejail/usr/ports/net-mgmt/cacti/work/stage/var/db/cacti/rra
/bin/mkdir -p /var/ports/basejail/usr/ports/net-mgmt/cacti/work/stage/var/db/cacti/scripts
/bin/cp -R /var/ports/basejail/usr/ports/net-mgmt/cacti/work/cacti-0.8.8f/* /var/ports/basejail/usr/ports/net-mgmt/cacti/work/stage//usr/local/share/cacti
if [ -f /usr/local/share/cacti/include/db-settings.php ]; then  echo "=======================================================================";  echo "WARNING! You have to move DB settings from";  echo "/usr/local/share/cacti/include/db-settings.php file to";  echo "/usr/local/share/cacti/include/config.php and remove db-settings.php";  fi
====> Compressing man pages (compress-man)
--->  Backing up the old version
--->  Uninstalling the old version
[Reading data from pkg(8) ... - 284 packages found - done]
--->  Deinstalling 'cacti-0.8.8d'
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	cacti-0.8.8d

The operation will free 6 MiB.
[noc.terabit.net.ua] [1/1] Deinstalling cacti-0.8.8d...
==> You should manually remove the "cacti" user.
[noc.terabit.net.ua] [1/1] Deleting files for cacti-0.8.8d: 100%
[Reading data from pkg(8) ... - 283 packages found - done]
--->  Installing the new version via the port
===>  Installing for cacti-0.8.8f
===>   cacti-0.8.8f depends on executable: rrdtool - found
===>   cacti-0.8.8f depends on file: /usr/local/include/php/main/php.h - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/mysql.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/session.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/sockets.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/snmp.so - found
===>   cacti-0.8.8f depends on file: /usr/local/lib/php/20100525-zts/xml.so - found
===>   cacti-0.8.8f depends on shared library: libmysqlclient.so.18 - found (/usr/local/lib/mysql/libmysqlclient.so.18)
===>   Registering installation for cacti-0.8.8f
[noc.terabit.net.ua] Installing cacti-0.8.8f...
===> Creating users and/or groups.
Using existing group 'cacti'.
Using existing user 'cacti'.
=======================================================================
Cacti is now installed. If you intall it for the first time,
you may have to follow this steps to make it work correctly:

1. Create the MySQL database, a cacti user, and initialize:
   a) CREATE DATABASE cacti;
   b) Create a mysql user/password for cacti:
      CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'password';
      FLUSH PRIVILEGES;
   c) Add GRANTS:
      GRANT ALL ON cacti.* TO 'cacti'@'localhost';
      FLUSH PRIVILEGES;
   d) Import the default cacti database:
      mysql --database=cacti -ucacti -p < /usr/local/share/cacti/cacti.sql

 NOTE:
   * Cacti does not LOCK TABLES.

2. Edit /usr/local/share/cacti/include/config.php from the template
   config.php.orig.

   PHP requires the time zone to be explicitly set rather that rely on
   the system time zone, otherwise poller complains. I added the
   following line to my config.php:

   date_default_timezone_set('America/Los_Angeles');

3. Add the following line to cron for cacti:
*/5 * * * * /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1

4. Example Apache 2.4 configuration:

   LoadModule php5_module  libexec/apache22/libphp5.so

   <FilesMatch "\.php$">
       SetHandler application/x-httpd-php
   </FilesMatch>
   <FilesMatch "\.phps$">
       SetHandler application/x-httpd-php-source
   </FilesMatch>

   DirectoryIndex index.php

   DocumentRoot "/usr/local/share/cacti"

   Alias /cacti "/usr/local/share/cacti/"
   Alias /Cacti "/usr/local/share/cacti/"

   <Directory "/usr/local/share/cacti">
      Require all granted
      AllowOverride None
      Order Allow,deny
      Allow from all
   </Directory>

5. Open a Cacti login page in your web browser and login with
   admin/admin.

If you update cacti, open a login page and an updating process will
start automatically.

NOTEs as of 10Aug2014:

1) Cacti now better supports hier(7)

   a) Cacti log files are now found under /var/log/cacti where you can
      manage them using newsyslog.
   b) Cacti RRD files are now found under /var/db/cacti/rra.

   If you have an existing Cacti installation these paths are also
   found in Cacti's SQL database and MUST be updated. These two SQL
   commands should do the trick:

   UPDATE settings SET value='/var/log/cacti/log' \
     WHERE name='path_cactilog';

   UPDATE poller_item SET rrd_path=\
     REPLACE(rrd_path,'/usr/local/share/cacti/rra','/var/db/cacti/rra') \
     WHERE rrd_path REGEXP '^/usr/local/share/cacti/rra';

2) The PERL paths in the Cacti PERL scripts have been updated to
   /usr/local/bin.

Other Erratas:
Mount linprocfs in /compat/linux/proc will alow most scripts to work.

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

===>  Cleaning for cacti-0.8.8f
--->  Cleaning out obsolete shared libraries
There are no errors during upgrading... Unfortunately it can't finish upgrading process via master in web browser.
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

duplicate deleted
User avatar
Happiness0
Cacti User
Posts: 63
Joined: Wed Oct 29, 2014 5:01 am
Contact:

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by Happiness0 »

Something weird during the download

Code: Select all

fetch: http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz: size mismatch: expected 2594481, actual 2594409
You should remove the line include(0_8_8f_to_0_8_8f.php); in http://noc.xxx.net/cacti/install/index.php or in
/usr/local/share/cacti/install/index.php, or add the file /usr/local/share/cacti/install/0_8_8f_to_0_8_8f.php and put something like this in it.

Code: Select all

<?php
function upgrade_to_0_8_8f() {

}
?>
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Happiness0 wrote:Something weird during the download

Code: Select all

fetch: http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz: size mismatch: expected 2594481, actual 2594409
Can you check file size at http://www.cacti.net/downloads/ ?
Happiness0 wrote: You should remove the line include(0_8_8f_to_0_8_8f.php); in http://noc.xxx.net/cacti/install/index.php or in
/usr/local/share/cacti/install/index.php, or add the file /usr/local/share/cacti/install/0_8_8f_to_0_8_8f.php and put something like this in it.

Code: Select all

<?php
function upgrade_to_0_8_8f() {

}
?>
I never did such things during upgrade cacti. I think it should be part of cacti.
User avatar
Happiness0
Cacti User
Posts: 63
Joined: Wed Oct 29, 2014 5:01 am
Contact:

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by Happiness0 »

2 594 409 byte.
I never did such things during upgrade cacti. I think it should be part of cacti.
Try to upgrade using this process : http://www.cacti.net/downloads/docs/html/upgrade.html. What I understand of your problem is that portupgrade is trying to apply patches for FreeBSD and the patches are looking for the file 0_8_8f_to_0_8_8f.php
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Happiness0 wrote:2 594 409 byte.
I never did such things during upgrade cacti. I think it should be part of cacti.
What I understand of your problem is that portupgrade is trying to apply patches for FreeBSD and the patches are looking for the file 0_8_8f_to_0_8_8f.php
Why do you think so?

In my opinion the upgrade problem depends by mismatched file size at http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz and content of file /usr/local/share/cacti/install/index.php.
User avatar
Happiness0
Cacti User
Posts: 63
Joined: Wed Oct 29, 2014 5:01 am
Contact:

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by Happiness0 »

Because if you download cacti here http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz and you check the file install/index.php, their is no line

Code: Select all

include ("0_8_8f_to_0_8_8f.php");
And this is this line that makes you errors and a blank page IMO, so I guess FreeBSD is adding this line in the upgrade process. And a file 0_8_8f_to_0_8_8f.php is a non sense. You should either create it in install/ and putting in it what i've written above, or find & remove the line with the include statement in install/index.php.
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Happiness0 wrote:Because if you download cacti here http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz and you check the file install/index.php, their is no line

Code: Select all

include ("0_8_8f_to_0_8_8f.php");
And this is this line that makes you errors and a blank page IMO, so I guess FreeBSD is adding this line in the upgrade process. And a file 0_8_8f_to_0_8_8f.php is a non sense. You should either create it in install/ and putting in it what i've written above, or find & remove the line with the include statement in install/index.php.
Thanks. I'll try to check it.
sigi
Posts: 12
Joined: Mon May 19, 2008 1:42 am
Location: Switzerland, Meiringen

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by sigi »

Seems to be a known issue not a FreeBSD Port issue:

i simply copied
cp 0_8_8e_to_0_8_8f.php 0_8_8f_to_0_8_8f.php

later i found this:


http://bugs.cacti.net/view.php?id=2605

Maybe we should inform the ports maintainer...
User avatar
4flatline
Posts: 7
Joined: Wed Apr 04, 2012 3:06 am

Re: Problem with cacti upgrading (0.8.8d to 0.8.8f)

Post by 4flatline »

Problem has been solved in cacti-0.8.8f_1.
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests