Bug 437558 - rrdtool-php rrd_update not working right
Summary: rrdtool-php rrd_update not working right
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: rrdtool
Version: el5
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jarod Wilson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-14 21:16 UTC by Kevin Fenzi
Modified: 2008-04-06 03:54 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-04-06 03:54:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kevin Fenzi 2008-03-14 21:16:25 UTC
Given a php script with: 

     $ret =
rrd_update("$rrdbasedir/$dec.rrd","N:$rssi:$sq:$sna:$rxoct:$rxpack:$txoct:$txpack");
         if ( $ret == 0 )
              {
                 $err = rrd_error();
                echo "Update error: $err\n";
                }

When valid values are passed in, an error is generated: 

Update error: opening 'update': No such file or directory

I don't think this is any error in the above code, but something odd with the
EPEL-5 rrdtool-php package. Any ideas where this error is coming from or what is
causing it?

Comment 1 Jarod Wilson 2008-03-15 23:25:48 UTC
I seem to recall that I forgot to spin 1.2.27 for epel, and epel is still at
1.2.23 or 1.2.24... Pretty sure the php bits themselves remain unchanged between
the two versions, but if you could, try bumping to 1.2.27 and see if it doesn't
help...

Comment 2 Jarod Wilson 2008-03-15 23:36:46 UTC
Just submitted 1.2.27 builds for both EL4 and EL5...

Comment 3 Kevin Fenzi 2008-03-16 00:52:35 UTC
Those packages give me: 

error: Failed dependencies:
        php-api = %{php_apiver} is needed by rrdtool-php-1.2.27-1.el5.i386

On trying to install. ;( 

If I ignore the failed dep (with --nodeps), they generate the same error as the
older ones. ;( 


Comment 4 Jarod Wilson 2008-03-16 01:23:06 UTC
(In reply to comment #3)
> Those packages give me: 
> 
> error: Failed dependencies:
>         php-api = %{php_apiver} is needed by rrdtool-php-1.2.27-1.el5.i386
> 
> On trying to install. ;( 

D'oh. Fixing.

> If I ignore the failed dep (with --nodeps), they generate the same error as the
> older ones. ;( 

Damn. I got nothin' right now. We probably need to ping Tobi.


Comment 5 Kevin Fenzi 2008-03-17 18:53:14 UTC
Yeah, I poked around with it some more, and it's in the php bindings for sure. 
Manually running 'rrdtool update ...' with the same args as the php version of
rrd_update works fine. So, somewhere the update is picking up a 'update' file
instead of the real one.

In rrdtool.c.php:

 		argv[0] = "dummy";
 		argv[1] = estrdup("update");
		argv[2] = estrdup(file->value.str.val);
		argv[3] = estrdup(opt->value.str.val);

So it's passing 'dummy update FILE VALUE', perhaps the args to rrd_update have
changed? 


Comment 6 Kevin Fenzi 2008-03-20 22:50:21 UTC
Ok, should we talk with upstream about this one? 
Can you do that? Or would you like me to try and do so? 

Or do you have any further ideas? 

Comment 7 Jarod Wilson 2008-03-24 02:59:24 UTC
I got nothin', and don't actually use the php bits for anything myself. That.
and I've got a fair amount of other things I need to work on this week, so if
you could chase this upstream, that would be great.

Actually, I really ought to hand this package over to someone else, I don't
really use any of the bits period for anything anymore...

Comment 8 Kevin Fenzi 2008-04-01 21:14:31 UTC
Filed an upstream ticket: 
http://oss.oetiker.ch/rrdtool-trac/ticket/150

Which got closed as invalid, as they don't ship any official php bindings. ;( 

I also just dropped an email to the mailing list upstream... 

If you have any ideas, please let me know. ;( 

Comment 9 Kevin Fenzi 2008-04-06 02:49:11 UTC
The following patch (From Sean Reifschneider <jafo>) fixes this for me: 

*** rrdtool-1.2.27/php4/rrdtool.c.old	Fri Apr  4 17:43:53 2008
--- rrdtool-1.2.27/php4/rrdtool.c	Fri Apr  4 17:44:26 2008
***************
*** 373,379 ****
  		argv[3] = estrdup(opt->value.str.val);
  
  		optind = 0; opterr = 0;
! 		if ( rrd_update(3, &argv[1]) != -1 )
  		{
  			RETVAL_TRUE;
  		}
--- 373,379 ----
  		argv[3] = estrdup(opt->value.str.val);
  
  		optind = 0; opterr = 0;
! 		if ( rrd_update(2, &argv[2]) != -1 )
  		{
  			RETVAL_TRUE;
  		}

So, can you apply the above, and we can close this out? 
Or would you like me to apply it? 

Comment 10 Jarod Wilson 2008-04-06 03:46:02 UTC
Gah... Patched up rawhide... but does this actually impact rawhide, or did I
just break rawhide? :)

I'll toss it into el5 in a sec.

Comment 11 Jarod Wilson 2008-04-06 03:54:38 UTC
EL5 and EL4 packages building now


Note You need to log in before you can comment on or make changes to this bug.