Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Weird error log messages from GLinks

Quote Reply
Weird error log messages from GLinks
Hell,

Recently my website has been migrated form the provider to the new server, and since then my error log is full with messages like:

Code:
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at /home/zaaron/public_html/www.domain.com/path/to/admin/bases.pm line 43., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at (eval 5) line 55., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com
Done a sample search on google and seems the problem is that defined is deprecated in newer perl versions (my server's perl currently is v5.12.3)

Everything seems to work fine but if I try to use debugging mode in GLinks for some reason it is absolute hell, and even without debugging enabled error log grows super fast cos this happens on every request and appearance of define keyword in code :(

GT Help :(

Somebody else noticed such thing or I'm the only one screwed from cutting edge tech :(

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Try editing the file and changing:
Code:
unless (defined %{"$base\::"}) {
to:
Code:
unless (%{"$base\::"}) {

Adrian
Quote Reply
Re: [brewt] Weird error log messages from GLinks In reply to
Thanks Adrian,

Done that and there is some improvement, however these 2 are stay, and there is no pointer in which file is line 55.

Quote:
[Tue May 10 00:44:29 2011] [error] [client IP] defined(%hash) is deprecated at (eval 5) line 55., referer: http://www.domain.com
[Tue May 10 00:44:29 2011] [error] [client IP] \t(Maybe you should just omit the defined()?), referer: http://www.domain.com

As far I understand, the perl developers have turned on deprecation warnings by default for people to notice and correct their code, but in fact the code works just fine.

Can I disable these deprecation warnings system wide?

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Found it :)

Line: 757 in GT/Template.pm

Code:
or defined &{$package . '::AUTOLOAD'} and defined %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}

Can I safely change it? to:

Code:
or defined &{$package . '::AUTOLOAD'} and %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Sorry about the delay, here's a patch that should fix all instances of it:
Code:
Index: bases.pm
===================================================================
RCS file: library/bases.pm,v
retrieving revision 1.9
diff -u -r1.9 bases.pm
--- bases.pm 13 Jan 2004 01:35:15 -0000 1.9
+++ bases.pm 13 May 2011 23:55:30 -0000
@@ -39,7 +39,7 @@
|;
eval $dcl;
die "$@: $dcl" if $@ && $@ !~ /^Can't locate .*? at \(eval /;
- unless (defined %{"$base\::"}) {
+ unless (%{"$base\::"}) {
require Carp;
Carp::croak(
qq|Base class package "$base" is empty.
Index: GT/Template.pm
===================================================================
RCS file: library/GT/Template.pm,v
retrieving revision 2.171
diff -u -r2.171 Template.pm
--- GT/Template.pm 18 Aug 2010 07:51:42 -0000 2.171
+++ GT/Template.pm 13 May 2011 23:55:30 -0000
@@ -753,7 +753,7 @@
delete $INC{"$pkg.pm"};
}
elsif (defined(&{$package . '::' . $func})
- or defined &{$package . '::AUTOLOAD'} and defined %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}
+ or defined &{$package . '::AUTOLOAD'} and %{$package . '::COMPILE'} and exists ${$package . '::COMPILE'}{$func}
) {
$ok = 1;
$code = \&{$package . '::' . $func};
Index: GT/SQL/Base.pm
===================================================================
RCS file: library/GT/SQL/Base.pm,v
retrieving revision 1.71
diff -u -r1.71 Base.pm
--- GT/SQL/Base.pm 14 May 2009 23:34:42 -0000 1.71
+++ GT/SQL/Base.pm 13 May 2011 23:55:30 -0000
@@ -587,7 +587,7 @@
if ($@) {
push @err, $@;
# In case the module had compile errors, %class:: will be defined, but not complete.
- undef %{$class . '::'} if defined %{$class . '::'};
+ undef %{$class . '::'} if %{$class . '::'};
}
else {
$ok = 1;

Adrian
Quote Reply
Re: [brewt] Weird error log messages from GLinks In reply to
Thanks Adrian,

That's much better now :)
However, this patch fails on patching Template.pm and Base.pm files, mine are respectively - Template.pm: 2.170 and Base.pm: 1.70 and I'm running GLinks 3.3.0 with all available updates installed from GT Update.

Anyway. Thanks again, fixed both files manually.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Hi Eupos,

How did you end up actually fixing this as I have the same problem following an upgrade in server/perl etc?

I am running 3.30 as well and I see your attempt at patching did not work (not that I know how to do that in any event!!).

Not sure where this code plugs into the .pm files in question.

Any help would be greatly appreciated.

Regards,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] Weird error log messages from GLinks In reply to
Hi Clint,

Just search for the corresponding lines in the three modules and replace them manually. :)

Basically you have to find the lines prefixed with "-" and change them with the line prefixed with "+".

Hope this helps.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Thanks Boris,

all sorted.

All the best,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] Weird error log messages from GLinks In reply to
NP, You are welcome :)

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Weird error log messages from GLinks In reply to
Does anyone else have an issue with GT/Base.pm (not GT/SQL/Base.pm), on line 231?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
For future reference, it also seems like we have to patch GT/MIMETypes.pm, with:

Code:
defined(%MIME_EXT) or mime_ext();

to:

Code:
%MIME_EXT or mime_ext();

and also

Code:
defined(%MIME_TYPE) or mime_type();

to:

Code:
%MIME_TYPE or mime_type();

It only seems to kick up a fuss with mod_perl, but maybe that's because its more picky =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
Hi Andy,

Thanks for sharing.
Once more the point there should be at least some updated files for all who still use GLinks with all those minor changes.
Just wanted to bring it up again Angelic

Cheers

Niko

Last edited by:

el noe: Apr 5, 2017, 8:29 AM
Quote Reply
Re: [el noe] Weird error log messages from GLinks In reply to
I've been doing quite a few moves of GLinks to newer version of Perl, so decided I would just make a fixed lib set, and put it here.

If anyone is having this error, please download the attached ZIP file, decompress, and then upload to your /cgi-bin/admin folder. This assumes you are on version 3.3.0, so if you are on an older version, please backup the existing files in case it breaks stuff!

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Apr 7, 2017, 2:49 AM
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
Thanks!
Quote Reply
Re: [el noe] Weird error log messages from GLinks In reply to
Does anyone else get issues now when trying to do stuff like:

Code:
<%Plugins::Tools::foo()%>

...and it says:

Code:
Error: No subroutine 'Plugins::Tools::foo' in 'Plugins/Tools.pm'

I can't work out why it's not working :/ (the error is coming from the same area's we tweaked, so I'm wondering if something still isn't quite right)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
Hi Andy,

I guess you have
Code:
package Plugins::Tools
in your Tools.pm
No idea where your error comes from but I will try to reproduce it and take a look at it.

Cheers

Niko

Last edited by:

el noe: Apr 25, 2017, 12:46 AM
Quote Reply
Re: [el noe] Weird error log messages from GLinks In reply to
Hi,

You get the same issue with the standard GLinks span bar function in category.html :) I was just giving it as an example. It seems that any time you try and call a plugin from the templates now, it gives this error. For example:

Code:
<%Plugins::ULTRAGlobals::Trim("test",0,10)%>

Would give me an error telling me that it doesn't exist, even though the plugin does (and works fine on the "unfixed" GT::Template).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
OK, did you take a look at one of the compiled template files?
Maybe there is something "strange"?

Regards

Niko
Quote Reply
Re: [el noe] Weird error log messages from GLinks In reply to
Eugh, it was me being dumb :) In my mod_perl startup.pl script, I loaded the GLinks libs:

Code:
use lib '/home/fatpeter/web/site.com/cgi-bin/hotels/admin';

But failed to also load:

Code:
use lib '/home/fatpeter/web/site.com/cgi-bin/community/lib';

Oops! Seems ok now :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird error log messages from GLinks In reply to
Happy to hear that the problem is soved :)
Quote Reply
Re: [el noe] Weird error log messages from GLinks In reply to
For anyone else who may come across this issue as well, I just found another "bug" :) On the site where I took these modules from, I forced the whole site into utf8. Due to some weird stuff going on, I hard-code some "binmode" bits in, and overwrote the charset. While this works fine on my site, it just caused me grief on another site I'm upgrading

So if you are not running under full utf8, you will need to open up GT/CGI.pm, and find:

Code:
$charset = "utf-8";

Comment that out.

Then find

Code:
binmode(STDOUT, ":utf8");

...and do the same. I just spent hours on a really weird bug (static pages were iso-8859-1, but the dynamic pages on the proxy pass were utf8... but I couldn't work out why... this is why! w00t)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!