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

AMAZON_AWS_S3_PKG "Duplicate Headers" #83

Open
jeffreykemp opened this issue Feb 12, 2023 · 6 comments
Open

AMAZON_AWS_S3_PKG "Duplicate Headers" #83

jeffreykemp opened this issue Feb 12, 2023 · 6 comments
Assignees

Comments

@jeffreykemp
Copy link

jeffreykemp commented Feb 12, 2023

Recently my code started failing with an error "Duplicate Headers" being returned from AWS, e.g. when uploading an object using AMAZON_AWS_S3_PKG.

Note: I was able to resolve this by editing the package to remove the bits that set the "Host" header. I don't know why that fixed it but it seems to work fine without this.

  --l_header_names(1) := 'Host';
  --l_header_values.extend;
  --l_header_values(1) := g_aws_host_s3;`

(this edit required adjusting the array indices for the other headers)
@Jeremiah-England
Copy link

@mortenbra
Copy link
Owner

mortenbra commented Feb 13, 2023

Thanks for the feedback!

I also started noticing this some weeks ago (actually, I can pinpoint the problem quite exactly to start appearing on February 24, 2023). I've had the same code running every day for many years doing backups, on the same "client" (database), so obviously this was something that changed on the AWS side. I looked at their docs and blogs, but could not find any mentions.

I would variously see the error "Your request contains duplicate headers." returned from AWS, at other times I would just get "ORA-29273: HTTP request failed" lower down the stack. From what I could observe, uploading very small files would still work, while larger files fail.

If the permanent fix is indeed to remove the "Host" header, I think I'll do a small refactoring of how the headers are set and commit a new version to Git when I have some free time.

@mortenbra mortenbra self-assigned this Feb 13, 2023
@mrtrollex
Copy link

thanks!
same error for me,i removed host header and reindexed rest of headers.

But now im getting - SignatureDoesNotMatch error

Does somebody have fix for that?
Thanks

@mrtrollex
Copy link

i found out that changing
'HTTP/1.1');
in

utl_http.begin_request(get_url(p_bucket_name, l_key),
                                           'PUT',
                                           'HTTP/1.1');

to

utl_http.begin_request(get_url(p_bucket_name, l_key),
                                          'PUT',
                                          'HTTP/1.0');

also fixes duplicate header error, because 1.1 is automatically setting host header
but it still doesnt fix my SignatureDoesNotMatch error

@mortenbra
Copy link
Owner

thanks! same error for me,i removed host header and reindexed rest of headers.

But now im getting - SignatureDoesNotMatch error

Does somebody have fix for that? Thanks

Are you calling amazon_aws_auth_pkg.init() first?

@mrtrollex
Copy link

thanks! same error for me,i removed host header and reindexed rest of headers.
But now im getting - SignatureDoesNotMatch error
Does somebody have fix for that? Thanks

Are you calling amazon_aws_auth_pkg.init() first?

Yes and my credentials are correct, i think its about not correct headers in signature? Not so sure..

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

No branches or pull requests

4 participants