Closed Ankish closed 5 months ago
Thanks for submitting the issue. We will investigate further and provide updates here.
We need more information to proceed with the investigation. Please reopen the ticket and include additional details, such as verbose logs, crash logs, and steps to reproduce the issue.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
@5d : Can you tell me in your SDK when does error 7 is reported, it will help me replicate it. We are seeing lot of random failures, I will switch on the log and try to provide you soon. Also error clearly indicates this should not be happening.
The error code 7 corresponds to StorageError.unknown
. Several conditions can lead to StorageError.unknown
error. To proceed with further investigation, we need at least the stack trace, logs, or steps to reproduce the issue.
Is there a way to dump AWS logs into local file , we dont have cloudwatch, Testers are able to reproduce it and will be easy if thats possible.
You can enable verbose logging to the console by doing this before calling Amplify.configure
:
Amplify.Logging.logLevel = .verbose
@5d : Yes we can switch on the logs and watch console but we cant dump to a local file. Is there a way to do that ? We need to uploads tons of videos to replicate that. What would be the best way to pass the. logs to you ?
Sorry, the default logging plugin utilizes os_log internally and it does not have an option to redirect the output stream to a file.
@5d : Isnt there a way to make All AWS logging to be logged in AWS Cloud watch with this configuration:
let loggingConstraints = LoggingConstraints(defaultLogLevel: .verbose)
let loggingConfiguration = AWSCloudWatchLoggingPluginConfiguration(logGroupName: "/ios-development-analytics", region: "us-west-2", localStoreMaxSizeInMB: 1, flushIntervalInSeconds: 60, loggingConstraints: loggingConstraints)
let loggingPlugin = AWSCloudWatchLoggingPlugin(loggingPluginConfiguration: loggingConfiguration)
loggingPlugin.enable()
try Amplify.add(plugin: loggingPlugin)```
Yes. To access the logs remotely, you can utilize our Cloudwatch logging plugin. Please refer to our Cloudwatch logging setup documentation, which provides detailed instructions. In addition to the code snippet mentioned, there are other configurations required. For instance, you will need to attach the appropriate Cloudwatch permissions to your IAM roles.
@5d
Failure log:
2024-06-06 19:51:20.566760+0530 AppX[501:15238] [AuthenticationAWSCognitoAuthPlugin] Auth state change:
{
"AuthState.configured" = {
"AuthenticationState.signedIn" = {
deviceMetadata = "[\"noData\": \"noData\"]";
signInMethod = "AWSCognitoAuthPlugin.SignInMethod.apiBased(AWSCognitoAuthPlugin.AuthFlowType.userSRP)";
signedInDate = "2024-06-06 14:10:45 +0000";
tokens = "[\"idToken\": \"ey*****NQ\", \"accessToken\": \"ey*****yQ\", \"refreshToken\": \"ey*****_w\", \"expiry\": 2024-06-07 14:10:45 +0000]";
userId = "f3********************************f1";
userName = "f3********************************f1";
};
"AuthorizationState.refreshingSession" = {
existing = userPoolAndIdentityPool;
refreshState = {
"RefreshSessionState.refreshingAWSCredentialsWithUserPoolTokens" = {
};
};
};
};
}
2024-06-06T19:51:20+0530 info CognitoIdentityClient : [Logging] Request: POST https:443
Path: /
X-Amz-Target: AWSCognitoIdentityService.GetCredentialsForIdentity,
User-Agent: aws-sdk-swift/1.0 ua/2.0 api/cognito_identity#1.0 os/ios#16.6.1 lang/swift#5.10 cfg/retry-mode#legacy,
Content-Type: application/x-amz-json-1.1,
Host: cognito-identity.us-west-2.amazonaws.com,
Content-Length: 1049
nil
2024-06-06 19:51:20.860652+0530 AppX[501:15429] [Storage] Multipart Upload Failure: StorageError: Unexpected error occurred with message: An unknown error occurred
Recovery suggestion: This should not happen. There is a possibility that there is a bug if this error persists. Please take a look at https://github.com/aws-amplify/amplify-ios/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't. Issue encountered at:
file: /Users/User1/Library/Developer/Xcode/DerivedData/AppX-fkeyylrucnmyzkeqidfpwskedqfx/SourcePackages/checkouts/amplify-swift/Amplify/Categories/Storage/Error/StorageError.swift
function: recoverySuggestion
line: 104
Caused by:
UnknownAWSHTTPServiceError(typeName: Optional("RequestTimeTooSkewed"), message: Optional("The difference between the request time and the current time is too large."), requestID: Optional("S70MY5M2RQ6HYFED"), requestID2: Optional("lJ+M4YlcnBeI7dxeA8CYnIcSEGhCOhXJ+aT81yjPrIMAX1OQJE3pWBUr7AuYXVRq583GPxSqO+zQroXJ3mO+cg=="), httpResponse:
Status Code: http_status_403
Server: AmazonS3,
Content-Type: application/xml,
x-amz-id-2: lJ+M4YlcnBeI7dxeA8CYnIcSEGhCOhXJ+aT81yjPrIMAX1OQJE3pWBUr7AuYXVRq583GPxSqO+zQroXJ3mO+cg==,
Transfer-Encoding: Identity,
Date: Thu, 06 Jun 2024 08:01:18 GMT,
x-amz-request-id: S70MY5M2RQ6HYFED)
PFA log:
Device was in airplane mode, then internet logged in, tried uploading , it fails with this error:
Hi @Ankish , Based on the error in the log, it appears that your device's time is not synchronized with the world clock. Does your testing device have automatic time correction enabled? Please refer to the Apple documentation to set the time to automatic and verify if the issue persists.
Describe the bug
Upload fails with unexpected message from AWS to log bug.
Amplify.StorageError error 7
Steps To Reproduce
Expected behavior
Should not throw unexpected error
Amplify Framework Version
2.34.1
Amplify Categories
Storage
Dependency manager
Swift PM
Swift version
5.10
CLI version
aws-amplify-cli/2.0
Xcode version
15.3
Relevant log output