Skip to content
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

Timeout exception #59

Open
BilalZurmaati opened this issue Aug 15, 2024 · 3 comments
Open

Timeout exception #59

BilalZurmaati opened this issue Aug 15, 2024 · 3 comments

Comments

@BilalZurmaati
Copy link

Description

Getting following exception and app crashes as well.

Fatal Exception: java.net.SocketTimeoutException
failed to connect to search.bazaarghar.com/167.88.174.168 (port 443) from /192.168.1.3 (port 39918) after 2000ms

Expected Behavior

If the server is not working so I want to show some kind of error message but typesense straightaway throws this exception and app crashes.

Actual Behavior

The app crashes when on timeout exception.

Metadata

Typesense Version: 0.8.1

OS: Redmi 9C (Android 10)

@kishorenc
Copy link
Member

Aren't you able to catch this exception in your code?

@MatLeg25
Copy link

MatLeg25 commented Aug 21, 2024

@BilalZurmaati , @kishorenc
I have the same, got this output:

ERROR StatusLogger Unable to load services for service class org.apache.logging.log4j.spi.Provider
   java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.art/javalib/core-oj.jar)
  	at org.apache.logging.log4j.util.ServiceLoaderUtil.callServiceLoader(ServiceLoaderUtil.java:109)
  	at org.apache.logging.log4j.util.ServiceLoaderUtil$ServiceLoaderSpliterator.<init>(ServiceLoaderUtil.java:145)
  	at org.apache.logging.log4j.util.ServiceLoaderUtil.loadClassloaderServices(ServiceLoaderUtil.java:100)
  	at org.apache.logging.log4j.util.ServiceLoaderUtil.loadServices(ServiceLoaderUtil.java:82)
  	at org.apache.logging.log4j.util.ServiceLoaderUtil.loadServices(ServiceLoaderUtil.java:76)
  	at org.apache.logging.log4j.util.ProviderUtil.<init>(ProviderUtil.java:67)
  	at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:145)
  	at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:129)
  	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:90)
  	at org.typesense.api.ApiCall.<clinit>(ApiCall.java:33)
  	at org.typesense.api.Client.<init>(Client.java:28)
  	at io.XXXXXXX.data.remote.TypesenseClient$1.run(TypesenseClient.java:69)
  	at java.lang.Thread.run(Thread.java:1012)
  ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
  Accessing hidden method Ljava/lang/invoke/LambdaMetafactory;->metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; (blocked, linking, denied) 

    tagSocket(131) with statsTag=0xffffffff, statsUid=-1
    tagSocket(127) with statsTag=0xffffffff, statsUid=-1
  java.net.SocketTimeoutException: SSL handshake timed out
  	at com.google.android.gms.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
  	at com.google.android.gms.org.conscrypt.NativeSsl.doHandshake(:com.google.android.gms@[email protected] (190408-662270918):11)
  	at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms@[email protected] (190408-662270918):126)
  	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:379)
  	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:337)
  	at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:209)
  	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
  	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
  	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
  	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
  	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
  	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
  	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
  	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
  	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
  	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
  	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
  	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
  	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
  	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
  	at org.typesense.api.ApiCall.makeRequest(ApiCall.java:163)
  	at org.typesense.api.ApiCall.get(ApiCall.java:118)
  	at org.typesense.api.Health.retrieve(Health.java:15)
  	at io.XXXXXXX.data.remote.TypesenseClient.getConnectionState(TypesenseClient.java:98)
  	at io.XXXXXXX.data.remote.TypesenseClient$1.run(TypesenseClient.java:85)
  	at java.lang.Thread.run(Thread.java:1012)
  	```

@BilalZurmaati
Copy link
Author

Yes I did that way but I am just reporting it so that they return a failure instead of crashing the app. @kishorenc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants