plainblack.com
Username Password
search
Bookmark and Share
View All Tickets
statistics doesn't take into account proxy settings  (#2882)
Issue

Hello.

Noticed that /WebGUI/Operation/Statistics.pm does not seems to take into account proxy settings. It doesn't use LWP, so I don't know how to fix it in the code.

When I view the statistics I see:

 

WebGUI Build Version:7.2.1-stable
Latest version available:500 Can't connect to update.webgui.org:80 (connect: Connection refused)
Assets:1276
Packages:5
Templates:202
Active Sessions:28
Users:7
Groups:173

I've talked with support many times, and have established with them that my proxy settings are correct. I've posted other related proxy issues as well. Please let me know if I can try any code fixes for this.

Thanks! 

LN 

Solution Summary
Comments
perlDreamer
0
1/16/2007 4:30 pm
Are you still having this problem?
elnino
0
1/16/2007 5:21 pm

Yes. I didn't know if it was fixed in any of the betas.. I'm still running 7.2.1 ans waiting for the next stable release. But I'll be happy to try the of the betas since our site isn't quite live yet.

 LN 

perlDreamer
0
1/23/2007 4:42 pm

According to my research into this, this lookup is done by WebGUI::Cache.pm, in the setByHttp method.

Line 219 (at least in head it's 219) has the env_proxy method call required to enable following proxy information.  The line was added back in the 7.1 series, so you should have it.

Would you please check that out?

elnino
0
1/23/2007 5:18 pm

I have 7.2.1, and YES, In lib/WebGui/Cache.pm, I do see env_proxy on line 219.

Very strange, I followed the code from the Statistics.pm to the Cache.pm file, and I'd come to the same conclusions. But I've been only looking at Perl for a couple of months. 

<time elapses>

OH!! I just tried:

w3m http://update.webgui.org/latest-version.txt

and I was able to get to the file. 

but when I tried  

w3m http://update.webgui.org/latest-version.txt:80 I got a "the requested URL /latest-versin.txt:80 was not found on this server"

 Maybe that helps? Maybe you can't use ports for non HTML pages?  I've never heard of that.

What a bugger!!!  FYI, I've also tried clearing the cache, to force it to renew the information, but with no luck.

perlDreamer
0
1/23/2007 5:30 pm

You might be on to something with the non-html page, but your second url is wrong.   It should be:

 w3m http://update.webgui.org:80/latest-version.txt

The port goes on the end of the hostname, not the URL.

Would you try that and see if it works, please? 

elnino
0
1/23/2007 5:42 pm

Dang. I'm lower on sleep than I thought. 

web4> w3m http://update.webgui.org/latest-version.txt

Works just fine. =( 

 

What I find interesting is that it gets to the point in the code that it's providing the link to the download file, which is found in the WebGui/Operations/Statistics.pm file. Line 121. So maybe the <if> statement is incorrect?

LN 

perlDreamer
0
1/23/2007 5:52 pm

Doing this over email is slow.  Can you hop onto WebGUI's IRC channel?

#webgui on irc.freenode.net 

perlDreamer
0
1/23/2007 6:01 pm

In the meantime, inside WebGUI::Cache::setByHTTP, trying commenting out this line:

         $userAgent->timeout(30);

That will force it to use the default timeout, which is longer. 

elnino
0
1/23/2007 6:05 pm
Oh. Boy, When it comes to those things, I have no idea what I'm doing. I'll see what I can do,  Are you going to be around for the next half hour?
perlDreamer
0
1/23/2007 6:12 pm

No, I'm about ready to head home.

How about this?  On this page

http://www.webgui.org

There is a big button labeled IRC.  It will bring up a Java IRC client.  I don't suppose that you have a JRE installed?

elnino
0
1/23/2007 6:29 pm
yes, I have JRE (what version do I need?) installed, but the screen came up and I couldn't type anywhere, and then I clicked on the little cz in the bottom right, and chatzilla came up, and it kept timing out when I did a /attach irc.freenode.net. I suspect either our network guy took that away from us, or I'm doing something wrong. Sorry... I guess I'll have to ask my nephew... Have good evening. I suspect you're probably gone by now.
perlDreamer
0
3/6/2007 6:36 pm

I'm hoping that in the last few months that you may have upgraded and the bug has gone away.

Any such luck? 

elnino
0
8/4/2008 1:39 am

Hi. meant to report on this long ago, error still persists. I just upgraded to 7.4.40 and bug still exists. Tried commenting out timeout line in /Cache.pm with no change of error message.

Ive had problems before with env_proxy, and was able to fix testEnvironment.pl. testEnvironoment still works, so I compared the code between the two and modified Cache.pm to do pretty much the same thing, but still doens't get the latest version. I was sure to clear my cache via command line between changes as well. The error I get: "500 Can't connect to update.webgui.org:80 (connect: Connection refused)" is linking to something that is a bit unexpected. It's linking to:

http://update.webgui.org/500%20Can't%20connect%20to%20update.x.x/webgui-500%20Can't%20connect%20to%20update.webgui.org:80%20(connect:%20Connection%20refused).tar.gz

 Maybe that helps.

elnino
0
8/4/2008 2:06 am

I literally copied and pasted the testenvironment code into Operation/Statistics.pm:

    my $currentversionUserAgent = new LWP::UserAgent;
        $currentversionUserAgent->env_proxy;
        $currentversionUserAgent->agent("WebGUI-Check/2.1");
    $currentversionUserAgent->timeout(30);
    $currentversionUserAgent->env_proxy();
    my $header = new HTTP::Headers;
    my $referer = "http://".`hostname`."/webgui-cli-version";
    chomp $referer;
    $header->referer($referer);
    my $currentversionRequest = new HTTP::Request (GET => $url, $header);
    my $currentversionResponse = $currentversionUserAgent->request($currentversionRequest);
    my $version = $currentversionResponse->content;
    chomp $version;


and commented out al the caching code all the way upto the output statements, and I'm STILL getting can not connect. But all my httpproxes work, my testEnvironment work fine thru my proxy. I would have thought this would be easy, but I'm going to have to leave this one to the pros.

elnino
0
8/4/2008 2:12 am

ok. I figured out where the "weird" link is coming from. 

From what I can see, Operation/Statistics.pm calls Cache->new. Cache->new tries to do a FileCache, it fails, returns an error message.  Operation/Statistics.pm stores the error message to $version, skips over the "if (not defined $version) {" check, does NOT call Cache/setByHTTP, but instead prints out what it got from Cache-new, hence my weird hyperlink.

This is where I'm not quite sure what I'm seeing: Operation/Statistics.pm is calling Cache->new with a namespace of "URL" which doesn't seem to be handled. I would think that "URL" should be handled and call setByHTTP. But it doesnt.

Am I close? =)

Graham
0
8/4/2008 11:38 am

How do you have the proxy set?  Are you certain Apache is getting the proxy environment settings?  Try using the SetEnv directive in your modperl config to set the proxy settings.

elnino
0
8/4/2008 1:08 pm

Yep, I'm 100% convinced that the env is set properly. testEnvironment.pl works, my http proxy pages work, rss feeds work.

My env is:

PROXY=proxy.comtrol.com
PROXYPORT=9732
NO_PROXY=localhost, 127.0.0.1, 204.73.219.0, .comtrol.com
no_proxy=localhost, 127.0.0.1, 204.73.219.0, .comtrol.com
ftp_proxy=http://proxy.comtrol.com:9732
FTP_PROXY=http://proxy.comtrol.com:9732
https_proxy=http://proxy.comtrol.com:9732
HTTPS_PROXY=http://proxy.comtrol.com:9732
HTTP_PROXY=http://proxy.comtrol.com:9732
http_proxy=http://proxy.comtrol.com:9732

But I can try setting up setEnv. What conf files do I put those in?mod_perl.conf file?

Graham
0
8/4/2008 2:07 pm

Either modperl.conf or the vhost config file for your site.

perlmonkey2
0
8/5/2008 10:13 am

 Did using setEnv correct the problem?

Details
Ticket Status Closed  
Rating0.0 
Submitted Byelnino 
Date Submitted2007-01-03 
Assigned To unassigned  
Date Assigned2010-09-02 
Assigned By 
Severity Cosmetic (misspelling, formatting problems)  
What's the bug in?  
WebGUI / WRE Version 7.2.1  
URLbugs/tracker/statistics-doesnt-take-into-account-proxy-settings
Keywords
Ticket History
© 2010 Plain Black Corporation | All Rights Reserved