Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


0.8.7d + PIA 2.4 "upgrade" process patch errors
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Architecture
Author Message
sasifras
Cacti User


Joined: 18 Nov 2008
Posts: 54

PostPosted: Fri Feb 13, 2009 10:22 am    Post subject: 0.8.7d + PIA 2.4 "upgrade" process patch errors Reply with quote

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:

***************
*** 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):

Quote:

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:

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
Back to top
mpspind



Joined: 10 Jan 2008
Posts: 8

PostPosted: Fri Feb 13, 2009 3:12 pm    Post subject: Thanks! Reply with quote

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.
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 17009
Location: Muenster, Germany

PostPosted: Fri Feb 13, 2009 3:39 pm    Post subject: Reply with quote

That sequence is indeed correct by now.
Reinhard
Back to top
rs26



Joined: 27 Jan 2009
Posts: 7
Location: France

PostPosted: Mon Feb 16, 2009 10:32 am    Post subject: Reply with quote

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.
Back to top
sasifras
Cacti User


Joined: 18 Nov 2008
Posts: 54

PostPosted: Mon Feb 16, 2009 10:53 am    Post subject: Reply with quote

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.
Back to top
mduling



Joined: 01 Mar 2005
Posts: 26

PostPosted: Mon Feb 16, 2009 11:39 am    Post subject: patch error Reply with quote

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.
Back to top
labiol



Joined: 16 Feb 2009
Posts: 4

PostPosted: Tue Feb 17, 2009 2:36 am    Post subject: got this error too Reply with quote

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
Back to top
sasifras
Cacti User


Joined: 18 Nov 2008
Posts: 54

PostPosted: Tue Feb 17, 2009 7:19 am    Post subject: Reply with quote

Quote:

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]
Back to top
labiol



Joined: 16 Feb 2009
Posts: 4

PostPosted: Tue Feb 17, 2009 3:00 pm    Post subject: Problem solved Reply with quote

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.
Back to top
sasifras
Cacti User


Joined: 18 Nov 2008
Posts: 54

PostPosted: Tue Feb 17, 2009 3:39 pm    Post subject: Reply with quote

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:

/*
   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:

$config['url_path'] = '/cacti2/';
Back to top
labiol



Joined: 16 Feb 2009
Posts: 4

PostPosted: Tue Feb 17, 2009 4:33 pm    Post subject: Reply with quote

Yes, this is the solution. Thanks for your help.
Back to top
ambre
Cacti User


Joined: 27 Jan 2009
Posts: 64

PostPosted: Wed Mar 18, 2009 10:20 am    Post subject: Reply with quote

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

I have many errors....

?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 13135
Location: MI, USA

PostPosted: Wed Mar 18, 2009 11:15 am    Post subject: Reply with quote

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
Back to top
ambre
Cacti User


Joined: 27 Jan 2009
Posts: 64

PostPosted: Thu Mar 19, 2009 3:11 am    Post subject: Reply with quote

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
Back to top
BSOD2600
Cacti Moderator


Joined: 08 May 2004
Posts: 9568
Location: WA, USA

PostPosted: Thu Mar 19, 2009 3:25 am    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin Architecture All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group