Skip to content

[Bug]: Getting this exception: Request timeout has expired #861

Open
@mmanuja

Description

@mmanuja

General Info

  • I checked for similar bug report
  • I am using the latest version
  • I checked the troubleshooting page for similar problems

Version(s)

3.0.0

Kotlin Target(s) and their respective versions

JVM 17

What happened? (include your code)

I'm using the following dependencies:

supabase = "3.0.0"
auth-kt = { module = "io.github.jan-tennert.supabase:auth-kt" }
subase-postgrest = { module = "io.github.jan-tennert.supabase:postgrest-kt" }
compose-auth = { module = "io.github.jan-tennert.supabase:compose-auth" }
compose-auth-ui = { module = "io.github.jan-tennert.supabase:compose-auth-ui" }

I am getting the request timeout exception sometimes while sign-in with token through Google

  viewModel.getSupabaseAuth().signInWith(IDToken) {
                                idToken = account.idToken
                                    ?: throw IllegalStateException("ID Token is null")
                                provider = Google
                                nonce = null
                            }

I tried increasing the timeout however still getting the exception

createSupabaseClient(
            supabaseUrl = BuildConfig.SUPABASE_URL,
            supabaseKey = BuildConfig.SUPABASE_ANON_KEY
        ) {
            install(Auth){
                autoSaveToStorage = true
                flowType = FlowType.PKCE
            }
            install(Realtime)
            install(Postgrest)
            install(ComposeAuth) {
                googleNativeLogin(BuildConfig.GOOGLE_CLIENT_ID)

            }
            httpConfig {
                install(io.ktor.client.plugins.HttpTimeout) {
                    requestTimeoutMillis = 30000L
                }
            }
        }

Steps To Reproduce (optional)

  1. Call this method signInWith(IDToken) and pass token from Google account (Happening for few users)

Relevant log output (optional)

Non-fatal Exception: n5.L: Request timeout has expired [url=https://{OUR_URL}.supabase.co/auth/v1/token?grant_type=id_token, request_timeout=10000 ms]
       at io.ktor.client.plugins.HttpRequestTimeoutException.<init>(HttpRequestTimeoutException.java:195)
       at io.ktor.client.plugins.HttpTimeout$Plugin$install$1$1$killer$1.invokeSuspend(HttpTimeout.kt:165)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)



     Non-fatal Exception: F5.b: HTTP request to https://{OUR_URL}.supabase.co/auth/v1/token?grant_type=id_token (POST) failed with message: Connect timeout has expired [url=https://jwtvtseywhwvubpbmlfu.supabase.co/auth/v1/token?grant_type=id_token, connect_timeout=unknown ms]
       at io.github.jan.supabase.exceptions.HttpRequestException.<init>(HttpRequestException.java:8)
       at io.github.jan.supabase.network.KtorSupabaseHttpClient.request(KtorSupabaseHttpClient.kt:67)
       at io.github.jan.supabase.network.KtorSupabaseHttpClient$request$1.invokeSuspend(KtorSupabaseHttpClient.kt:13)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:102)
       at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
       at androidx.compose.ui.platform.AndroidUiDispatcher.access$setScheduledFrameDispatch$p(AndroidUiDispatcher.android.kt:41)
       at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
       at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:264)
       at android.app.ActivityThread.main(ActivityThread.java:8315)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions