class RRDGraph redeclared.

204 views
Skip to first unread message

Srini

unread,
Mar 12, 2012, 6:12:51 AM3/12/12
to scalr-...@googlegroups.com
Hi

I installed the RRDtools and the pecl php-rrdtool yesterday to start collecting statistics.  

After setting up rrdtool / php extension and loading it all my cron jobs started failing.  When I tracked the php errors, I found a number of these messages in the php error log: PHP Fatal error:  Cannot redeclare class RRDGraph in /var/www/html/app/src/LibWebta/library/Data/RRD/class.RRDGraph.php on line 464

The problem seems to be that PHP rrdtool extension has an RRDGraph class (http://www.php.net/manual/en/class.rrdgraph.php) and the LibWebta class in scalr is also having a class called RRDGraph.  I ended up grep'ing for all instances of RRDGraph in scalr source and changing it to a different name.  It is now running fine.

Can the Scalr development team please check this and let us know?  Ideally the RRDGraph class in libwebta needs to be renamed so there is no clash with the php extension.

Regards
Srini


Srini

unread,
Mar 12, 2012, 11:20:32 PM3/12/12
to scalr-...@googlegroups.com
Couple of more issues.  For anyone ending up like me with the latest versions of PHP RRD tool, there are incompatibilities.  First was the RRDGraph class I described below.  Others are:

1. Signatures of rrd_create and rrd_update have probably changed.
2. The app/src/LibWebta/library/Data/RRD/class.RRD.php needs to be updated.
3. rrd_create() requires only 2 parameters, comment out the third (count)
4. rrd_update() requries the second argument to be of type array and not string.  Create a new array() object, push the string constructed in the Udpate() function into the array and call the rrd_update() with the array as the second parameter

With these changes the RRDTool starts collecting all the required statistics :)

Regards
Srini

mavinman

unread,
Mar 14, 2012, 12:08:16 PM3/14/12
to scalr-discuss
Can we get a reply from a scalr engineer about an offiical fix for
this? I've had this issue as well, and don't want to find/replace the
whole project.

Sebastian Stadil

unread,
Mar 14, 2012, 2:47:50 PM3/14/12
to scalr-...@googlegroups.com
Hi Josh,

Have you considered getting a support contract for issues such as this one?

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To post to this group, send email to scalr-...@googlegroups.com.
To unsubscribe from this group, send email to scalr-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scalr-discuss?hl=en.




--


Follow us: Twitter - Facebook - Blog

mavinman

unread,
Mar 14, 2012, 3:14:54 PM3/14/12
to scalr-discuss
No, not really. But I'll think about it depending on how many issues
like this arise.

I think I'm a little confused as to how this whole Scalr open source
process works. I (and I'm sure other developers) have no problem
fixing bugs/issues in Scalr as they arise - and understand that for
support issues I'd have to purchase a contract. The issue is that (as
far as I know) there's no source control repository or process to
submit fixes to Scalr. I don't think it would be wise for both Srini
and me to implement a zillion application wide changes in our own
local copy of Scalr if there's no way for the community to benefit
from it.

If we don't want to purchase support, are we simply supposed fix all
the problems each individually ourselves, wait until the next version
of scalr comes out, and then check to see if our problems have been
fixed?
> Follow us: Twitter <https://twitter.com/#!/scalr> -
> Facebook<https://www.facebook.com/Scalr>
>  - Blog <http://blog.scalr.net/>

Sebastian Stadil

unread,
Mar 14, 2012, 4:55:22 PM3/14/12
to scalr-...@googlegroups.com
We talked about this internally, but should have used this discussion list. We want to have stable releases on a certain cycle, made available to the public through https://scalr.net/pricing/open-source/

We're considering how to move to an open development process, but haven't come to a decision. Since it's not a revenue-pressing matter, it hasn't been prioritized like getting you guys raid support, a reporting dashboard, or integrated monitoring.

Srinivasan S

unread,
Mar 14, 2012, 8:34:10 PM3/14/12
to scalr-...@googlegroups.com
Hi Sebastian

In the interim, I can email the patched files across to you guys if needed.

Regards
Srini
Sent on my BlackBerry® from Vodafone

From: Sebastian Stadil <seba...@scalr.com>
Date: Wed, 14 Mar 2012 13:55:22 -0700
Subject: Re: class RRDGraph redeclared.

Sebastian Stadil

unread,
Mar 14, 2012, 10:16:55 PM3/14/12
to scalr-...@googlegroups.com
pat...@scalr.com as always!

Igor Savchenko

unread,
Mar 15, 2012, 2:23:18 AM3/15/12
to scalr-...@googlegroups.com
Want to mention, that this is not a bugs. It's all about configuration and proper versions of libraries. Graphic statistics working fine on scalr.net and should also work on custom setup if it correctly configure.

We will update wiki with further details about how to install and configure it.

Regards,
Igor

Nick Toursky

unread,
Mar 15, 2012, 5:01:42 AM3/15/12
to scalr-...@googlegroups.com
Srini,

What versions of rrdtool and php_rrdtool do you have installed? 

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/scalr-discuss/-/6KPBD5A1rMIJ.

Srinivasan Subramanian

unread,
Mar 15, 2012, 7:15:33 AM3/15/12
to scalr-...@googlegroups.com
rrd tool module version 1.0.5
rrdtool library version 1.4.5
 
Sent: Thursday, March 15, 2012 2:31 PM
Subject: Re: class RRDGraph redeclared.
 
Srini,
 
To unsubscribe from this group, send email to mailto:scalr-discuss%2Bunsu...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/scalr-discuss?hl=en.
--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.

mavinman

unread,
Mar 19, 2012, 12:21:49 PM3/19/12
to scalr-discuss
Any word on what versions should be used for the current scalr
release?

On Mar 15, 6:15 am, "Srinivasan Subramanian"
<srinivasan.subraman...@gmail.com> wrote:
>       rrd tool module version 1.0.5
>       rrdtool library version 1.4.5
>
> From: Nick Toursky
> Sent: Thursday, March 15, 2012 2:31 PM
> To: scalr-...@googlegroups.com
> Subject: Re: class RRDGraph redeclared.
>
> Srini,
>
> What versions of rrdtool and php_rrdtool do you have installed?
>
> On Tue, Mar 13, 2012 at 05:20, Srini <srinivasan.subraman...@gmail.com> wrote:
>
>   Couple of more issues.  For anyone ending up like me with the latest versions of PHP RRD tool, there are incompatibilities.  First was the RRDGraph class I described below.  Others are:
>
>   1. Signatures of rrd_create and rrd_update have probably changed.
>   2. The app/src/LibWebta/library/Data/RRD/class.RRD.php needs to be updated.
>   3. rrd_create() requires only 2 parameters, comment out the third (count)
>   4. rrd_update() requries the second argument to be of type array and not string.  Create a new array() object, push the string constructed in the Udpate() function into the array and call the rrd_update() with the array as the second parameter
>
>   With these changes the RRDTool starts collecting all the required statistics :)
>
>   Regards
>   Srini
>
>   On Monday, March 12, 2012 3:42:51 PM UTC+5:30, Srini wrote:
>     Hi
>
>     I installed the RRDtools and the pecl php-rrdtool yesterday to start collecting statistics.
>
>     After setting up rrdtool / php extension and loading it all my cron jobs started failing.  When I tracked the php errors, I found a number of these messages in the php error log: PHP Fatal error:  Cannot redeclare class RRDGraph in /var/www/html/app/src/LibWebta/library/Data/RRD/class.RRDGraph.php on line 464
>
>     The problem seems to be that PHP rrdtool extension has an RRDGraph class (http://www.php.net/manual/en/class.rrdgraph.php) and the LibWebta class in scalr is also having a class called RRDGraph.  I ended up grep'ing for all instances of RRDGraph in scalr source and changing it to a different name.  It is now running fine.
>
>     Can the Scalr development team please check this and let us know?  Ideally the RRDGraph class in libwebta needs to be renamed so there is no clash with the php extension.
>
>     Regards
>     Srini
>
>   --
>   You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
>
>   To view this discussion on the web visithttps://groups.google.com/d/msg/scalr-discuss/-/6KPBD5A1rMIJ.
>
>   To post to this group, send email to scalr-...@googlegroups.com.
>   To unsubscribe from this group, send email to mailto:scalr-discuss%2Bunsu...@googlegroups.com.
>   For more options, visit this group athttp://groups.google.com/group/scalr-discuss?hl=en.

Nicholas Simmons

unread,
Apr 12, 2012, 4:07:48 AM4/12/12
to scalr-...@googlegroups.com
I have been setting up self-hosted Scalr this week and ran into the same problem. After seeing Srini's solution of changing the code i was tempted to do that, but Igor said everything is working on the hosted side so I tried to play around with the packages i had installed.

After removing the php-rrd extension i had installed through pecl I was no longer getting the "Cannot redeclare class RRDGraph" error, and it seemed like the cron jobs were all working fine after that.

Try installing only rrdtool and don't install any php-rrd extension.

Enrico Detoma

unread,
May 2, 2012, 11:08:40 AM5/2/12
to scalr-...@googlegroups.com, srinivasan....@gmail.com
Hi Srini,
could you send me the patched files too?
I have the same problem, after installing php5-rrd package in Ubuntu 12.04.

Thank you
Regards
Enrico



Il giorno giovedì 15 marzo 2012 01:34:10 UTC+1, Srini ha scritto:
Hi Sebastian

In the interim, I can email the patched files across to you guys if needed.

Regards
Srini
Sent on my BlackBerry® from Vodafone

From: Sebastian Stadil <seba...@scalr.com>
Date: Wed, 14 Mar 2012 13:55:22 -0700

> > For more options, visit this group at
> >http://groups.google.com/group/scalr-discuss?hl=en.
>
> --
>

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To post to this group, send email to scalr-...@googlegroups.com.
To unsubscribe from this group, send email to scalr-discuss+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/scalr-discuss?hl=en.




--


Follow us: Twitter - Facebook - Blog

--
You received this message because you are subscribed to the Google Groups "scalr-discuss" group.
To post to this group, send email to scalr-...@googlegroups.com.
To unsubscribe from this group, send email to scalr-discuss+unsubscribe@googlegroups.com.

Srinivasan S

unread,
May 2, 2012, 11:09:56 AM5/2/12
to Enrico Detoma, scalr-...@googlegroups.com
Hi Enrico

Am travelling. Will mail on Saturday if that's not too late :)


Srini
Sent on my BlackBerry® from Vodafone

From: Enrico Detoma <enrico...@gmail.com>
Date: Wed, 2 May 2012 08:08:40 -0700 (PDT)

Srini

unread,
May 9, 2012, 7:36:42 AM5/9/12
to scalr-...@googlegroups.com, srinivasan....@gmail.com
I forked Scalr on github and put in my changes there.  You can get it from  https://github.com/ssrini/scalr 

1.  RRDGraph error - Files changed: 
    ./src/LibWebta/library/Data/RRD/class.RRDGraph.php
    ./cron/watchers/class.LASNMPWatcher.php
    ./cron/watchers/class.MEMSNMPWatcher.php
    ./cron/watchers/class.NETSNMPWatcher.php
    ./cron/watchers/class.CPUSNMPWatcher.php        

2.  Since my pecl rrd was also the latest, I also had php errors with rrd_create() and rrd_update().  These changes are made in the file ./src/LibWebta/library/Data/RRD/class.RRD.php.  Make these changes only based on your PECL RRD version.

Srini

Sebastian Stadil

unread,
Jun 5, 2012, 6:53:30 PM6/5/12
to scalr-...@googlegroups.com, srinivasan....@gmail.com
It would be very welcome!

On Tue, Jun 5, 2012 at 11:29 PM, francesco cislaghi <ske...@gmail.com> wrote:
i was wondering... what would it be like to have a  sort of community fork of scalr on github?
To view this discussion on the web visit https://groups.google.com/d/msg/scalr-discuss/-/RpEYcLwI5V4J.

To post to this group, send email to scalr-...@googlegroups.com.
To unsubscribe from this group, send email to scalr-discus...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/scalr-discuss?hl=en.
Reply all
Reply to author
Forward
0 new messages