Skip to content
New issue

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

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

Already on GitHub? # to your account

botocore | RDS | downloadlogfile doesn't work ometimes have problem with processing specific log files, for example if log file contain non printable sign #910

Closed
gidimariastorm opened this issue May 5, 2016 · 2 comments

Comments

@gidimariastorm
Copy link

Hi,
I have a problem using both aws-cli(latest version) and boto3. Both are botocore based.

I've opened a ticket to aws support and he told me:

I understand that you are having unexpected behaviour when trying to display the slow query log for your instance and are encountering the following error message "A** client error (InvalidParameterValue) occurred when calling the DownloadDBLogFilePortion operation: This file contains binary data and should be downloaded instead of viewed**.".

It appears that you are hitting a known issue with downloading log files that contain non printable sign

This error my boto3 command is the following:

rds=boto3.client('rds',SOURCE_REGION,aws_access_key_id=DEFAULT_ACCESS_KEY,aws_secret_access_key=DEFAULT_SECRET_KEY)

log_file=rds.download_db_log_file_portion(DBInstanceIdentifier="my-rds",LogFileName‌​="slowquery/my-slowquery.log")

the boto3.client is a wrapper that calls the client function of botocore.

If think that the problem is here https://github.com/boto/botocore/blob/7384364df5b7f438678ad0777f07ce37c39e9f59/botocore/data/rds/2014-09-01/service-2.json

because the LogFileData is "string"

I have to say that the most part of time the function works. Can you fix the problem? I

Giuseppe

@kyleknap
Copy link
Contributor

kyleknap commented May 5, 2016

I am a little confused. Let me see if I understand. You are running this:

rds=boto3.client('rds', SOURCE_REGION,
                           aws_access_key_id=DEFAULT_ACCESS_KEY,
                           aws_secret_access_key=DEFAULT_SECRET_KEY
)
log_file=rds.download_db_log_file_portion(
    DBInstanceIdentifier="my-rds",LogFileName‌​="slowquery/my-slowquery.log")

But that is causing the following error?

"A** client error (InvalidParameterValue) occurred when calling the DownloadDBLogFilePortion operation: This file contains binary data and should be downloaded instead of viewed**."

If so, that is looking like the error is coming from the service. You can confirm this as well by adding the line ``boto3.set_stream_logger('botocore') to that client call and you should see RDS responding with that error. If it was an issue with the model, I would expect that boto3 should be receiving a successful HTTP response from rds and then boto3 having encoding issues. Could you possibly confirm where the error is propagating from?

@kyleknap
Copy link
Contributor

Closing due to inactivity.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants