Skip Menu |

This queue is for tickets about the Net-Amazon-EC2 CPAN distribution.

Report information
The Basics
Id: 67748
Status: resolved
Priority: 0/
Queue: Net-Amazon-EC2

People
Owner: Nobody in particular
Requestors: andrew [...] pimlott.net
Cc:
AdminCc:

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



Subject: get_console_output fails when there is no output
Date: Mon, 25 Apr 2011 13:25:51 -0700
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Andrew Pimlott <andrew [...] pimlott.net>
When EC2 returns no output for get_console_output (which is often, since the console output seems to be refreshed very infrequently), Net::Amazon::EC2 throws a "Premature end of base64 data" warning and returns garbage. If I dump $xml at line 2508, I see: 0 HASH(0xb36a648) 'Errors' => undef 'instanceId' => 'i-7a207815' 'output' => HASH(0xb36d8f8) empty hash 'requestId' => '4b2745e9-fdd1-4bee-87d8-878b4d2af374' 'timestamp' => '2011-04-25T20:13:40.000Z' 'xmlns' => 'http://ec2.amazonaws.com/doc/2009-11-30/' So obviously $xml->{output} is not text. Probably, the empty hashref comes from a heuristic in the XML de-serializer, but it is wrong. Andrew
On Mon Apr 25 16:52:51 2011, andrew@pimlott.net wrote: Show quoted text
> When EC2 returns no output for get_console_output (which is often, since > the console output seems to be refreshed very infrequently), > Net::Amazon::EC2 throws a "Premature end of base64 data" warning and > returns garbage. If I dump $xml at line 2508, I see: > > 0 HASH(0xb36a648) > 'Errors' => undef > 'instanceId' => 'i-7a207815' > 'output' => HASH(0xb36d8f8) > empty hash > 'requestId' => '4b2745e9-fdd1-4bee-87d8-878b4d2af374' > 'timestamp' => '2011-04-25T20:13:40.000Z' > 'xmlns' => 'http://ec2.amazonaws.com/doc/2009-11-30/' > > So obviously $xml->{output} is not text. Probably, the empty hashref > comes from a heuristic in the XML de-serializer, but it is wrong. > > Andrew
Thanks for the report. I'll check into this.
On Mon Apr 25 16:52:51 2011, andrew@pimlott.net wrote: Show quoted text
> When EC2 returns no output for get_console_output (which is often, since > the console output seems to be refreshed very infrequently), > Net::Amazon::EC2 throws a "Premature end of base64 data" warning and > returns garbage.
I changed this to check if $xml->{output} is defined and has a length, and if so, decode the base64 otherwise return undef. This is going into 0.25