aws-amplify/amplify-swift

AuthError: Service error

Opened this issue · 2 comments

Describe the bug

We are verifying some occurrences of AuthError: Service error.
We started facing this problem on version 2.35.3 of Amplify-ios and after updated to version 2.43.0 this is still happening.
When opening the app and dealing with the normal behavior for Auth Services (the fetchAuthSession) we sometimes get a Service Auth Error.
We also noticed this error occurring with the Logout (the signOut), even thought the Logout works as it should we sometimes get this error.

Steps To Reproduce

Steps to reproduce the behavior:
1. Opening the App
2. App deals with Auth Service (the `fetchAuthSession`)
3. This Service Error might be returned

Or

1. Logout user
2. App deals with Auth Service (the `signOut`)
3. This Service Error might be returned

Expected behavior

As expected behavior we shouldn't get a Service Auth Error.

Amplify Framework Version

2.43.0

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

5.10

CLI version

Xcode version

15.4 and also 16.0

Relevant log output

<details>
<summary>Log Messages</summary>


INSERT LOG MESSAGES HERE
```

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

Logs for >= iOS 16.7.10

Device

Logs for iPhone 8, X, 12, 12 Pro

Specific to simulators

No response

Additional context

We have some Logs retrieving this:

Get access token failed with error: AuthError: Service error occurred
Recovery suggestion: 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.

Hi @micaeloliveira-void , thanks for reaching out.
Based on the error description, it appears that the service is throwing an error that Amplify is not properly handling.

Could you please provide the verbose logs when this issue happens? That might provide additional information.

You can enable verbose logging by adding:

Amplify.Logging.logLevel = .verbose

before calling Amplify.configure()

Thanks!

Thank you for the fast reply :)
We will enable it and when our next build comes out, if this happens again I will let you know with more updates and information.