Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WebService-Amazon-Route53 CPAN distribution.

Report information
The Basics
Id: 77407
Status: resolved
Priority: 0/
Queue: WebService-Amazon-Route53

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

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



Subject: Infinite Looping for function "find_hosted_zone" with accounts having more than 100 hosted zones
Error Message: Use of uninitialized value $marker in substitution (s///) at /home/anand/trunk/cpan/cpan-5.010/lib/perl5/WebService/Amazon/Route53.pm line 430. If there are more than 100 hosted zones the last $zone is not able to be accessed for the getting the new $marker. this leads to an infinite loop with the above error message being repeated. this is because the $zone is reference whose scope ceases to exist outside the foreach loop. I am suggesting the following fix through which I am able to find zones more than 100 on the Route53. The fix starts at line 402 for the sub "find_hosted_zone". Please verify and correct it. File name: Route53.pm Module: WebService::Amazon::Route53 + Add the line - Remove the line @@ -402,32 +402,37 @@ sub find_hosted_zone { my $found_zone = 0; my $marker; - + my $last_zone; + my $zone; ZONES: while (1) { my $zones = $self->list_hosted_zones(max_items => 100, marker => $marker); - + if (!defined $zones) { # We can assume $self->{error} is already set return undef; } - my $zone; foreach $zone (@$zones) { if ($zone->{name} eq $args{'name'}) { $found_zone = $zone; last ZONES; } + %{$last_zone} = %{$zone}; } if (@$zones < 100) { # Less than 100 zones have been returned -- no more zones to get last ZONES; } else { # Get the marker from the last returned zone - ($marker = $zone->{'id'}) =~ s!^/hostedzone/!!; + ($marker = $last_zone->{'id'}) =~ s!^/hostedzone/!!; }
On Thu May 24 14:06:00 2012, anand8125 wrote: Show quoted text
> I am suggesting the following fix through which I am able to find zones > more than 100 on the Route53. The fix starts at line 402 for the sub > "find_hosted_zone". Please verify and correct it.
I used a slightly simpler fix. Thank you very much for reporting the problem and for suggesting a solution. The updated version is on its way to CPAN.