Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocDB/RDS Filters errors #394

Open
msven opened this issue Sep 1, 2020 · 0 comments
Open

DocDB/RDS Filters errors #394

msven opened this issue Sep 1, 2020 · 0 comments

Comments

@msven
Copy link

msven commented Sep 1, 2020

I'm hitting an issue when calling DescribeDBInstances in the RDS or DocDB service with Filters. Below is a simple script to reproduce (you don't need to have any actual AWS resources created to reproduce).

#!/usr/bin/env perl

use Modern::Perl;
use Paws;

my $paws = Paws->new;
my $docdb = $paws->service('DocDB', region => 'us-east-1', max_attempts => 1); 

my $results = $docdb->DescribeDBInstances(
    Filters => [
        {
            Name => 'db-cluster-id',
            Values => [ 'test-cluster' ]
        }
    ]   
);

When I run the above script I get the following error

$ ./test.pl 
An internal error has occurred. Please try your query again at a later time.

Trace begun at /usr/local/share/perl5/Paws/Net/XMLResponse.pm line 45
Paws::Net::XMLResponse::process('Paws::Net::XMLResponse=HASH(0x42178e8)', 'Paws::DocDB::DescribeDBInstances=HASH(0x42b1dc8)', 'Paws::Net::APIResponse=HASH(0x43aeda8)') called at /usr/local/share/perl5/Paws/Net/Caller.pm line 46
Paws::Net::Caller::caller_to_response('Paws::Net::Caller=HASH(0x194ebc0)', 'Paws::DocDB=HASH(0x1955310)', 'Paws::DocDB::DescribeDBInstances=HASH(0x42b1dc8)', 'Paws::Net::APIResponse=HASH(0x43aeda8)') called at /usr/local/share/perl5/Paws/Net/RetryCallerRole.pm line 19
Paws::Net::RetryCallerRole::do_call('Paws::Net::Caller=HASH(0x194ebc0)', 'Paws::DocDB=HASH(0x1955310)', 'Paws::DocDB::DescribeDBInstances=HASH(0x42b1dc8)') called at /usr/local/share/perl5/Paws/DocDB.pm line 138
Paws::DocDB::DescribeDBInstances('Paws::DocDB=HASH(0x1955310)', 'Filters', 'ARRAY(0x35a5440)') called at test.pl line 9

After some digging, it appears that the wrong http call parameters are being generated and after making the following change I don't hit the error anymore (and if you have AWS resource you will get results).

diff ./lib/Paws/DocDB/Filter.pm /usr/local/share/perl5/Paws/DocDB/Filter.pm 
4c4
<   has Values => (is => 'ro', isa => 'ArrayRef[Str|Undef]', request_name => 'Values', traits => ['NameInRequest'], required => 1);
---
>   has Values => (is => 'ro', isa => 'ArrayRef[Str|Undef]', request_name => 'Value', traits => ['NameInRequest'], required => 1);

( The difference in the line is request_name => 'Values' vs Value )

I'm not sure if the above hack is really the fix or if there is some other issue going on here and the above just happens to make things work.

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant