Open minatmalek opened 2 weeks ago
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. File size is around 10GB, it always fails at the 1 hour mark (around 45% of the upload)
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.
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