Skip Menu |

This queue is for tickets about the Log-Dispatch-Scribe CPAN distribution.

Report information
The Basics
Id: 74114
Status: resolved
Priority: 0/
Queue: Log-Dispatch-Scribe

People
Owner: Nobody in particular
Requestors: stephon [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.05
Fixed in: (no value)



Subject: Bareword "Scribe::Thrift::ResultCode::TRY_LATER" not allowed while "strict subs" in ver 0.05
Hello, While Scribe has installed as git version 6600084 and later, it causes all the programs using Log::Dispatch::Scribe error as below: Bareword "Scribe::Thrift::ResultCode::TRY_LATER" not allowed while "strict subs" in Scribe.pm line 78 Temporary solution is to patch Scribe.pm as attachment. Would you like to fix this problem? Thanks a lot -- Stephon
Subject: Log-Dispatch-Scribe-0.05.patch.txt
--- Scribe.pm.orig 2012-01-18 16:20:25.000000000 +0800 +++ Scribe.pm 2012-01-18 16:03:03.000000000 +0800 @@ -75,7 +75,7 @@ Scribe::Thrift::LogEntry->new({ category => $cat, message => $params{message} })) if $append && @{$self->{_retry_buffer}} <= $self->{retry_buffer_size}; my $result = $self->{client}->Log($self->{_retry_buffer}); - die "TRY_LATER" if $result == Scribe::Thrift::ResultCode::TRY_LATER; + die "TRY_LATER" if $result == &Scribe::Thrift::ResultCode::TRY_LATER; $self->{_retry_buffer} = []; $looping = 0;
Hello Stephon, I am unable to reproduce the problem you have outlined. I am using the latest scribe from github, thrift-0.8.0, Log::Dispatch::Scribe 0.05 and perl 5.14.2. My test case is: perl -Ilib -MLog::Dispatch::Scribe -e 'Log::Dispatch::Scribe- Show quoted text
>new(min_level => 1)->log_message(message=>"Test")'
which generates no errors. Scribe/Thrift/Types.pm contains the line use constant TRY_LATER => 1; The issue you describe would appear to be related to 'use constant' rather than Log::Dispatch::Scribe - do you see similar errors on any other modules that use constant?
From: stephon [...] gmail.com
在 2012-一月-23 00:59:30 星期一 時,JJSCHUTZ 寫到: Show quoted text
> Hello Stephon, > > I am unable to reproduce the problem you have outlined. > > I am using the latest scribe from github, thrift-0.8.0, > Log::Dispatch::Scribe 0.05 and perl 5.14.2. My test case is: > > perl -Ilib -MLog::Dispatch::Scribe -e 'Log::Dispatch::Scribe-
> >new(min_level => 1)->log_message(message=>"Test")'
Hello JJSCHUTZ, The error occurs @ perl 5.10.1. & 5.12.4 I use the latest scribe from github, thrift-0.8.0, and Log::Dispatch::Scribe 0.05 Show quoted text
>>>perl -Ilib -MLog::Dispatch::Scribe -e 'Log::Dispatch::Scribe-
>new(min_level => 1)->log_mesessage=>"Test")'
Bareword "Scribe::Thrift::ResultCode::TRY_LATER" not allowed while "strict subs" in use at /usr/local/lib/perl5/site_perl/5.10.1/Log/Dispatch/Scribe.pm line 78. Compilation failed in require. BEGIN failed--compilation aborted. Show quoted text
>>>perl -v
This is perl, v5.10.1 (*) built for amd64-freebsd I have reinstalled perl*, thrift, and scribe, but no work...
Hello Stephon, The only way I can reproduce the problem is to comment out the constant declaration from /usr/local/share/perl5/Scribe/Thrift/Types.pm, thus I suspect that your copy of the file has something missing. The top of that file should look like this: # # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 5.6.0; use strict; use warnings; use Thrift; package Scribe::Thrift::ResultCode; use constant OK => 0; use constant TRY_LATER => 1; package Scribe::Thrift::LogEntry; ... Please check your version, and check whether you might have multiple versions installed. If the contents of your file are different then it suggests a problem with generation of the scribe interface using thrift. I generate and install these files as follows: thrift -I ../thrift-0.8.0/contrib --gen perl if/scribe.thrift sudo cp -a gen-perl/Scribe `perl -V::sitelib: | sed "s/'//g"` (The -I option gives the path to fb303) Regards, Jon Schutz http://notes.jschutz.net On Mon Jan 23 08:22:23 2012, http://stephon.myopenid.com/ wrote: Show quoted text
> 在 2012-一月-23 00:59:30 星期一 時,JJSCHUTZ 寫到:
> > Hello Stephon, > > > > I am unable to reproduce the problem you have outlined. > > > > I am using the latest scribe from github, thrift-0.8.0, > > Log::Dispatch::Scribe 0.05 and perl 5.14.2. My test case is: > > > > perl -Ilib -MLog::Dispatch::Scribe -e 'Log::Dispatch::Scribe-
> > >new(min_level => 1)->log_message(message=>"Test")'
> Hello JJSCHUTZ, > > The error occurs @ perl 5.10.1. & 5.12.4 > I use the latest scribe from github, thrift-0.8.0, and > Log::Dispatch::Scribe 0.05 >
> >>>perl -Ilib -MLog::Dispatch::Scribe -e 'Log::Dispatch::Scribe-
> >new(min_level => 1)->log_mesessage=>"Test")'
> Bareword "Scribe::Thrift::ResultCode::TRY_LATER" not allowed while > "strict subs" in use at > /usr/local/lib/perl5/site_perl/5.10.1/Log/Dispatch/Scribe.pm line 78. > Compilation failed in require. > BEGIN failed--compilation aborted.
> >>>perl -v
> This is perl, v5.10.1 (*) built for amd64-freebsd > > I have reinstalled perl*, thrift, and scribe, but no work...
Hello JJSCHUTZ, I have found that this line does not included in Scribe/Types.pm use constant TRY_LATER => 1; Because of Scribe/Types.pm does not build correctly by using if/scribe.thrift Now all work perfectly. Sorry for bothering you. Thanks for your help. -- Stephon