-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Amplify v6 Storage - ExpiredToken After 1 Hour Upload #13307
Comments
Hello, @minatmalek 👋. Can you clarify if the upload is stopping completely when this occurs (or if the file still uploads)? Also, do you see this error happening repeatedly or is this more intermittent? It may also be helpful to know what the file size is and the amount of time it's taking to upload the file if you can share that. |
Hi @cwomack , thank you for your quick reply. I notice from the logs that the progress callback fires a couple of times after the ExpiredToken error occurred then it stops completely with a 400 error. What I also noticed from the logs is that it clears the credentials after they expire (not right before they do), I'm not sure if thats the expected behavior. |
Hi @minatmalek I can reproduce this issue thus confirm this is a bug. The team is prioritizing fixing it. We will keep you post with our progress. |
I am having the same issue in production. In my case, the user leaves the screen idle or even interacts with it. After an hour from the last refresh, the upload fails with the credentials expiring. Right now, when this happens, we force the user to logout. But that isn't right and very annoying. I am using v5 of sdk. Is there a way to work around the issue with the approach in the PR. I have been trying to refresh the credentials before the upload but not been able to do so. |
Hi @minatmalek, thanks for reporting the issue, it has been released in aws-amplify@6.3.3. |
Hi @ashwinkumar6, thank you for the support. I can confirm that the issue has been resolved in aws-amplify@6.3.3 |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Storage
Amplify Version
v6
Amplify Categories
auth, storage
Backend
Amplify CLI
Environment information
Describe the bug
I am encountering an error message "ExpiredToken: The provided token has expired" when uploading files to Amplify Storage using Amplify v6 (I tried with v5 as well). This error occurs specifically after approximately 1 hour of upload time.
Expected behavior
The file upload should complete successfully regardless of upload duration.
Reproduction steps
1- Configure Amplify project with Storage functionality using Amplify v6.
2- Initiate a file upload process to Amplify Storage.
3- Observe the upload progress for approximately 1 hour.
Code Snippet
Log output
aws-exports.js
{
"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": "us-east-1:e21c4017-5126-4feb-ac6a-XXXXXXXX",
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "us-east-1_XXXXXXXX",
"aws_user_pools_web_client_id": "XXXXXXXX",
"oauth": {},
"aws_cognito_username_attributes": [
"EMAIL"
],
"aws_cognito_social_providers": [],
"aws_cognito_signup_attributes": [
"GIVEN_NAME",
"FAMILY_NAME",
"EMAIL"
],
"aws_cognito_mfa_configuration": "OFF",
"aws_cognito_mfa_types": [
"SMS"
],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
"REQUIRES_LOWERCASE",
"REQUIRES_NUMBERS",
"REQUIRES_SYMBOLS",
"REQUIRES_UPPERCASE"
]
},
"aws_cognito_verification_mechanisms": [
"EMAIL"
],
"aws_user_files_s3_bucket": "XXXXXXXX-staging",
"aws_user_files_s3_bucket_region": "us-east-1"
}
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
The text was updated successfully, but these errors were encountered: