0.8.7d + PIA 2.4 "upgrade" process patch errors

Support for the Plugin Architecture

Moderators: Developers, Moderators

sasifras
Cacti User
Posts: 58
Joined: Tue Nov 18, 2008 6:57 am

0.8.7d + PIA 2.4 "upgrade" process patch errors

Post by sasifras »

Not sure this in the right spot, but someone posted about this in the announce forum and I think this is the answer:

when applying PIA 2.4, the following patch errors occur:

from /include/global_constants.php.rej:

Code: Select all

***************
*** 175,178 ****
  define("SNMP_CMDPHP", 1);
  define("SNMP_WEBUI", 2);

  ?>--- 175,182 ----
  define("SNMP_CMDPHP", 1);
  define("SNMP_WEBUI", 2);

+ define('OPER_MODE_NATIVE', 0);
+ define('OPER_MODE_RESKIN', 1);
+ define('OPER_MODE_IFRAME_NONAV', 2);
+
  ?>
I think this "failure" results in the following (from the other post):
Some php warnings:

at console header:

Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /cacti-0.8.7d/include/top_header.php on line 27
Notice: Use of undefined constant OPER_MODE_RESKIN - assumed 'OPER_MODE_RESKIN' in /cacti-0.8.7d/include/top_header.php on line 28
Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /cacti-0.8.7d/include/top_header.php on line 48
Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /cacti-0.8.7d/include/top_header.php on line 55


at console home page:

Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /cacti-0.8.7d/include/bottom_footer.php on line 25
Notice: Use of undefined constant OPER_MODE_NATIVE - assumed 'OPER_MODE_NATIVE' in /cacti-0.8.7d/include/bottom_footer.php on line 26
I haven't spent much time investigating these, although I know the line numbers are "off" by 1 in the patch process (our file has these on 174, not 175), but we manually added these lines to the end of this file and things appear fine to us:

Code: Select all

define('OPER_MODE_NATIVE', 0);
define('OPER_MODE_RESKIN', 1);
define('OPER_MODE_IFRAME_NONAV', 2);
also of note, our global_constants.php is a stock file and un-editted to this point (so there shouldn't be any custom stuff in this file on our systems).

Hope this helps someone,

Sasifras
mpspind
Posts: 8
Joined: Thu Jan 10, 2008 12:46 pm

Thanks!

Post by mpspind »

I'm glad someone posted on this!! I have that exact issue, and not being too savy at debugging I reverted back. I'll give this a try. Thanks much for posting!

Anyone else feel it's a bit of a pain to upgrade Cacti? All the documentation I'm finding seems to speak to a base Cacti upgrade without Spine or plugins. As far as I can tell, it seems I need to follow the documented way to upgrade Cacti, install the PIA, install latest plugins, and install spine. That's all theoretical since I haven't been successful yet. :cry:
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That sequence is indeed correct by now.
Reinhard
rs26
Posts: 7
Joined: Tue Jan 27, 2009 6:10 am
Location: France

Post by rs26 »

I have the same problem on Cacti 0.8.7c without Spine. (default poller)

If not --dry-run, cacti is corrupted.

Hunk failed at 175.

Have you a solution ?

Regards.
sasifras
Cacti User
Posts: 58
Joined: Tue Nov 18, 2008 6:57 am

Post by sasifras »

Go into the .diff file for the PIA and find the line with "175" on it, change it to "174" and re-run. See if that dry-run's ok.
mduling
Posts: 39
Joined: Tue Mar 01, 2005 1:49 pm

patch error

Post by mduling »

You can also get the 2.4 patch to run by using '-F 3' when running the patch command. That allows more fuzz and the global constants file gets patched.

The PIA patch only works on the cacti .tar.gz file. On the cacti .zip file it fails on all patches. I think there is a line ending issue.
labiol
Posts: 4
Joined: Mon Feb 16, 2009 7:42 am

got this error too

Post by labiol »

I'm new in cacti. Fresh installation.
While patching proces ( patch -p1 -F3 -N --dry-run < cacti-plugin-0.8.7d-PA-v2.4.diff) I get
patching file include/global_constants.php
Hunk #1 succeeded at 175 with fuzz 3.

My include/global_constants.php from line 174 looks like:
define("SNMP_POLLER", 0);
define("SNMP_CMDPHP", 1);
define("SNMP_WEBUI", 2);

define('OPER_MODE_NATIVE', 0);
define('OPER_MODE_RESKIN', 1);
define('OPER_MODE_IFRAME_NONAV', 2);

?>

And now my cacti not work corretly. Broken links and no images. Any idea ?

Software version:
cacti-0.8.7d.tar.gz
cacti-plugin-0.8.7d-PA-v2.4.zip
sasifras
Cacti User
Posts: 58
Joined: Tue Nov 18, 2008 6:57 am

Post by sasifras »

And now my cacti not work corretly. Broken links and no images. Any idea ?
I'd double-check your file permissions on all files/directories.[/quote]
labiol
Posts: 4
Joined: Mon Feb 16, 2009 7:42 am

Problem solved

Post by labiol »

Problem was with pictures and links path. Cacti was installed in web server subdirectory (in my environment http://deb/cacti2) and without plugin arch. worked correctly. For example images was at http://deb/cacti2/image.png. But after the patch was applied image path changed to http://deb/image.png. Afted made subdomain all works fine. I'm new in cacti but I think it's not normal behaviour.
sasifras
Cacti User
Posts: 58
Joined: Tue Nov 18, 2008 6:57 am

Post by sasifras »

Ahh.. I think somewhere in the instructions for PIA there is a note that if your cacti installation is not in the root of the webserver you need to go modify the include/global.php file. Look for url_path line:

Code: Select all

/*
   Edit this to point to the default URL of your Cacti install
   ex: if your cacti install as at http://serverip/cacti/ this
   would be set to /cacti/
*/

$config['url_path'] = '/';
in your case, I think your url_path should be:

Code: Select all

$config['url_path'] = '/cacti2/';
labiol
Posts: 4
Joined: Mon Feb 16, 2009 7:42 am

Post by labiol »

Yes, this is the solution. Thanks for your help.
ambre
Cacti User
Posts: 64
Joined: Tue Jan 27, 2009 5:41 am

Post by ambre »

when I update cacti to 0.8.7d, The patch PA 2.4 file doesn't work .

I have many errors....

?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

ambre wrote:when I update cacti to 0.8.7d, The patch PA 2.4 file doesn't work .

I have many errors....

?
This comment helps like "0".

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ambre
Cacti User
Posts: 64
Joined: Tue Jan 27, 2009 5:41 am

Post by ambre »

TheWitness wrote:
ambre wrote:when I update cacti to 0.8.7d, The patch PA 2.4 file doesn't work .

I have many errors....

?
This comment helps like "0".

TheWitness
The patch return:

patch -p1 -N --dry-run < cacti-plugin-0.8.7d-PA-v2.4.diff
patching file auth_changepassword.php
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file auth_changepassword.php.rej
patching file auth_login.php
Reversed (or previously applied) patch detected! Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file auth_login.php.rej
patching file data_sources.php
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 404.
Hunk #3 FAILED at 538.
Hunk #4 FAILED at 685.
Hunk #5 FAILED at 979.
Hunk #6 FAILED at 1313.
Hunk #7 FAILED at 1342.
7 out of 7 hunks FAILED -- saving rejects to file data_sources.php.rej
patching file graph_image.php
Hunk #1 FAILED at 44.
1 out of 1 hunk FAILED -- saving rejects to file graph_image.php.rej
patching file graph.php
Hunk #1 FAILED at 98.
Hunk #2 FAILED at 213.
Hunk #3 FAILED at 246.
3 out of 3 hunks FAILED -- saving rejects to file graph.php.rej
patching file graphs_new.php
Hunk #1 FAILED at 479.
1 out of 1 hunk FAILED -- saving rejects to file graphs_new.php.rej
patching file graphs.php
Hunk #1 FAILED at 45.
Hunk #2 FAILED at 362.
Hunk #3 FAILED at 506.
3 out of 3 hunks FAILED -- saving rejects to file graphs.php.rej
patching file host.php
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 311.
Hunk #3 FAILED at 449.
Hunk #4 FAILED at 542.
Hunk #5 FAILED at 654.
Hunk #6 FAILED at 1116.
6 out of 6 hunks FAILED -- saving rejects to file host.php.rej
patching file include/auth.php
Hunk #1 FAILED at 31.
Hunk #2 FAILED at 78.
Hunk #3 FAILED at 86.
Hunk #4 FAILED at 94.
4 out of 4 hunks FAILED -- saving rejects to file include/auth.php.rej
patching file include/bottom_footer.php
Hunk #1 FAILED at 21.
Hunk #2 FAILED at 35.
2 out of 2 hunks FAILED -- saving rejects to file include/bottom_footer.php.rej
patching file include/global_arrays.php
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 642.
2 out of 2 hunks FAILED -- saving rejects to file include/global_arrays.php.rej
patching file include/global_constants.php
Hunk #1 FAILED at 175.
1 out of 1 hunk FAILED -- saving rejects to file include/global_constants.php.rej
patching file include/global_form.php
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 1185.
2 out of 2 hunks FAILED -- saving rejects to file include/global_form.php.rej
patching file include/global.php
Hunk #1 FAILED at 41.
Hunk #2 FAILED at 91.
Hunk #3 FAILED at 194.
Hunk #4 FAILED at 219.
4 out of 4 hunks FAILED -- saving rejects to file include/global.php.rej
patching file include/global_settings.php
Hunk #1 FAILED at 1185.
1 out of 1 hunk FAILED -- saving rejects to file include/global_settings.php.rej
The next patch would create the file include/plugins.php,
which already exists! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file include/plugins.php.rej
patching file include/top_graph_header.php
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 51.
Hunk #3 FAILED at 107.
Hunk #4 FAILED at 119.
Hunk #5 FAILED at 127.
Hunk #6 FAILED at 156.
6 out of 6 hunks FAILED -- saving rejects to file include/top_graph_header.php.rej
patching file include/top_header.php
Hunk #1 FAILED at 22.
Hunk #2 FAILED at 79.
Hunk #3 FAILED at 87.
Hunk #4 FAILED at 100.
4 out of 4 hunks FAILED -- saving rejects to file include/top_header.php.rej
patching file index.php
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 48.
2 out of 2 hunks FAILED -- saving rejects to file index.php.rej
patching file lib/api_device.php
Hunk #1 FAILED at 132.
1 out of 1 hunk FAILED -- saving rejects to file lib/api_device.php.rej
patching file lib/auth.php
Hunk #1 FAILED at 122.
Hunk #2 FAILED at 155.
2 out of 2 hunks FAILED -- saving rejects to file lib/auth.php.rej
patching file lib/functions.php
Hunk #1 FAILED at 1640.
Hunk #2 FAILED at 1653.
Hunk #3 FAILED at 1732.
3 out of 3 hunks FAILED -- saving rejects to file lib/functions.php.rej
patching file lib/html_form.php
Hunk #1 FAILED at 661.
Hunk #2 FAILED at 678.
Hunk #3 FAILED at 699.
3 out of 3 hunks FAILED -- saving rejects to file lib/html_form.php.rej
patching file lib/html.php
Hunk #1 FAILED at 86.
Hunk #2 FAILED at 143.
Hunk #3 FAILED at 177.
Hunk #4 FAILED at 263.
Hunk #5 FAILED at 702.
Hunk #6 FAILED at 713.
Hunk #7 FAILED at 742.
Hunk #8 FAILED at 763.
8 out of 8 hunks FAILED -- saving rejects to file lib/html.php.rej
The next patch would create the file lib/plugins.php,
which already exists! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/plugins.php.rej
patching file lib/poller.php
Hunk #1 FAILED at 324.
1 out of 1 hunk FAILED -- saving rejects to file lib/poller.php.rej
patching file lib/rrd.php
Hunk #1 FAILED at 557.
Hunk #2 FAILED at 1392.
Hunk #3 FAILED at 1407.
3 out of 3 hunks FAILED -- saving rejects to file lib/rrd.php.rej
patching file lib/variables.php
Hunk #1 FAILED at 183.
1 out of 1 hunk FAILED -- saving rejects to file lib/variables.php.rej
The next patch would create the file plugins/index.php,
which already exists! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file plugins/index.php.rej
The next patch would create the file plugins.php,
which already exists! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file plugins.php.rej
patching file poller.php
Hunk #1 FAILED at 73.
Hunk #2 FAILED at 263.
Hunk #3 FAILED at 407.
Hunk #4 FAILED at 458.
4 out of 4 hunks FAILED -- saving rejects to file poller.php.rej
patching file user_admin.php
Hunk #1 FAILED at 72.
Hunk #2 FAILED at 420.
Hunk #3 FAILED at 463.
Hunk #4 FAILED at 915.
Hunk #5 FAILED at 943.
Hunk #6 FAILED at 957.
6 out of 6 hunks FAILED -- saving rejects to file user_admin.php.rej
patching file utilities.php
Hunk #1 FAILED at 129.
Hunk #2 FAILED at 1645.
2 out of 2 hunks FAILED -- saving rejects to file utilities.php.rej
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Is the PA 2.4 current with the latest patches? If not, its pre-patched files should be updated so they are for those who can't use a patching utility.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests