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

Pre-signed URL is invalid briefly after generation #1946

Closed
olokobayusuf opened this issue Jan 21, 2021 · 3 comments
Closed

Pre-signed URL is invalid briefly after generation #1946

olokobayusuf opened this issue Jan 21, 2021 · 3 comments
Assignees
Labels
bug This issue is a bug.

Comments

@olokobayusuf
Copy link

olokobayusuf commented Jan 21, 2021

Describe the bug
I've stumbled upon a very weird error. After going through the motions on #1857, I'm running into an issue where a pre-signed URL generated by the SDK is invalid when it is generated. After a short period of time, it becomes valid. This is a blocker, because the amount of time before the URL becomes valid seems to be non-deterministic, and the links are being immediately sent to microservices so they are always invalid when they arrive.

I should note that the pre-signed URL is valid for 2 hours.

SDK version number

{
  "@aws-sdk/client-s3": "^3.2.0",
  "@aws-sdk/s3-request-presigner": "^3.2.0",
}

Is the issue in the browser/Node.js/ReactNative?
Node JS

Details of the browser/Node.js/ReactNative version
v12.4.0

To Reproduce (observed behavior)

  1. Generate pre-signed URL for an image on S3
  2. Immediately try to open it in Python with Pillow:
url = ...
image = Image.open(BytesIO(get(url).content))
  1. OR: Simply open the link in your browser.
  2. Observe the signature AWS Access Denied XML page:
<Error>
  <Code>AccessDenied</Code>
  <Message>Access Denied</Message>
  <RequestId>CA8029A6C93C4CD5</RequestId>
  <HostId>j1EXY04v1UX9VMi87VBevOsfuLCcJMCIBbpbjt+/FOkm60eoMqS0HzVsssBE9XO1K7ya2nmd/9Y=</HostId>
</Error>
  1. Wait up to a minute.
  2. Retry step (2) or (3), observe that it now works.

Expected behavior
Pre-signed URL should work immediately after being generated.

Screenshots
None.

Additional context
Add any other context about the problem here.

@olokobayusuf olokobayusuf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 21, 2021
@AllanZhengYP AllanZhengYP self-assigned this Feb 10, 2021
@ajredniwja
Copy link
Contributor

Hey @olokobayusuf thanks for opening this issue, unfortunately I wasn't able to reproduce the issue. I followed some steps found here.

Is there anything you might be doing differently?

@ajredniwja ajredniwja removed the needs-triage This issue or PR still needs to be triaged. label May 24, 2021
@olokobayusuf
Copy link
Author

Hey @ajredniwja , I haven't worked on this in quite a while, so I'll close this issue for now. If it comes up again, I'll open a new issue.

@github-actions
Copy link

github-actions bot commented Jun 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants