Software caused connection abort Client receive - java

I'm making an app in Android studio and I'm getting an IOException which is unpredictable nor have I managed to replicate it.
W/TcpProtocolLayer: Connection to /x.x.x.x:x closed.
W/System.err: java.io.IOException: Software caused connection abort
W/System.err: at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
W/System.err: at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
W/System.err: at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
W/System.err: at sun.nio.ch.IOUtil.read(IOUtil.java:192)
W/System.err: at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:421)
W/System.err: at x.x.protocol.layer.TcpProtocolLayer.receive(TcpProtocolLayer.java:254)
W/System.err: at x.x.protocol.layer.TcpProtocolLayer.receive(TcpProtocolLayer.java:201)
W/System.err: at x.x.protocol.layer.DatagramProtocolLayer.receive(DatagramProtocolLayer.java:133)
W/System.err: at x.x.protocol.ProtocolStack.receive(ProtocolStack.java:190)
W/System.err: at x.x.protocol.Socket.receive(Socket.java:85)
I've been trying to wrap my head around it and I just can't seem to understand why this would happen, for legal reasons I can't show the code where it's happening but I can describe it.
The phone sends a message to a server and the server responds. This part is always successful and never fails. Then the phone waits for the server to send another message for a confirmation, and this is where it the exception happens. It might throw the exception instantly it might throw it after 10 seconds. I should also say that 90% of the time the code works just fine and no exception is thrown and it processes the information just fine. Then the 10% of the unpredictable attempts this happens and breaks the app completely. I've watched out for it not to be a Async Thread error ,and I've concluded it isn't and the Socket is opened at the moment of this happening. If anyone has any answer I'd be happy to hear it because this problem has been haunting me for a month already and I can't fix it

Related

IllegalStateException: The file system on the device is in a bad state. WorkManager cannot access the app's internal data store

My app is not going to open. When i try to open app it immediately close with below crash.
It is happening in only one device Redmi note 10s.(Android 11)
It seems issue with Workmanager, but didn't found any solution
The file system on the device is in a bad state. WorkManager cannot access the app's internal data store.Error Message: The file system on the device is in a bad state. WorkManager cannot access the app's internal data store.StackTracejava.lang.IllegalStateException: The file system on the device is in a bad state. WorkManager cannot access the app's internal data store.
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:120)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/data/user/0/study.pedagogy.android/no_backup/androidx.work.workdb': Directory /data/user/0/study.pedagogy.android/no_backup doesn't exist
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:252)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:205)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:505)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:918)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:898)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:762)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:751)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:373)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:145)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:106)
at androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:622)
at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:399)
at androidx.work.impl.model.SystemIdInfoDao_Impl.getWorkSpecIds(SystemIdInfoDao_Impl.java:120)
at androidx.work.impl.background.systemjob.SystemJobScheduler.reconcileJobs(SystemJobScheduler.java:284)
at androidx.work.impl.utils.ForceStopRunnable.cleanUp(ForceStopRunnable.java:199)
at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:165)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
... 4 more
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:224)
... 23 more

java.net.SocketTimeoutException at peak traffic on Production

We have been facing this issue on Prodcution. Now this issue occurs whenever a notification is rolled out to all the Mobile Apps and Desktop Apps. In the notification one image is there which is cached at CDN(Akamai). So a lot of users are getting the following exception. I tried to figure out the issue but a lot of people say it might be due to
network issue on the device but my question is DNS of XXXX.XXXX.com has been resolved to akamai ip (117.239.141.27). So, that should not be a problem. Moreover I had a work with Akamai guys they couldn't find any issue at their end. So, I have following questions:
1) How do i figure out what is causing the issue? Secondly, does anyone has faced the similar issue on production at peak traffic?
2) As mentioned in the below stack track which i got from crashlytics. In few cases we are getting private client ip (192.168.1.33) why is it so?
Shouln't public ip of client should be logged in the crashlytics.
Caused by java.net.SocketTimeoutException: failed to connect to XXXX.XXXX.com/117.239.141.27 (port 80) from /192.168.1.33 (port 50974) after 15000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:185)
at libcore.io.IoBridge.connect(IoBridge.java:129)
at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
at java.net.Socket.connect(Socket.java:621)
at com.android.okhttp.internal.Platform.connectSocket(Platform.java:145)
at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:1416)
at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:1368)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:219)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:142)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:104)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:392)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:325)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:488)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:434)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:565)
at com.squareup.picasso.UrlConnectionDownloader.load(UrlConnectionDownloader.java:125)
at com.squareup.picasso.NetworkRequestHandler.load$71fa0c91(NetworkRequestHandler.java:6)
at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:72)
at com.XXXXX.XXXXX.utils.AppNotificationHandler.getTabCategoryIdForScreen(AppNotificationHandler.java:82)
at com.XXXXX.XXXXX.utils.AppNotificationHandler.handleExtras(AppNotificationHandler.java:806)
at com.XXXXX.XXXXX.fcm.FCMIntentService.onMessageReceived(FCMIntentService.java:112)
at com.google.firebase.messaging.FirebaseMessagingService.zzd(FirebaseMessagingService.java:394)
at com.google.firebase.iid.zzg.run(zzg.java:26)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.gms.common.util.concurrent.zza.run(zza.java:7)
at java.lang.Thread.run(Thread.java:764)

NullPointerException shown in Real-time crashes page of Google Play developer dashboard

Anyone can help on where the problem may be? at the moment I really have no idea where to look.
java.lang.NullPointerException:
at com.google.android.gms.internal.im.zzc(im.java:0)
at com.google.android.gms.internal.im.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at <OR>.zza(im.java:0)
at com.google.android.gms.internal.aaw.run(aaw.java:0)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
The problem was firebase remote config. I actually didn't create the remote_config in firebase dashboard yet and looks like in some limited cases the local default values xml file isn't working properly.
After adding the remote config variable in Firebase dashboard, the crash report stopped.

SSL connection using pgjdbc-ng as Java driver for Postgres

I'm facing a great problem in connecting to a Postgres database using https://github.com/impossibl/pgjdbc-ng/. I need this lib because I need to get asynchronous notification from the database.
I'm trying to connect to a remote database using SSL an I'm doing this:
Class.forName("com.impossibl.postgres.jdbc.PGDriver");
String url = "jdbc:pgsql://host:5432/db"
+ "?ssl.mode=Require";
Connection conn = DriverManager.getConnection(url, "username", "pwd");
But, when I try to do that I get an IllegalStateException. This is the stack trace:
java.sql.SQLException: Connection Error: java.lang.IllegalStateException
at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:189)
at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:77)
at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:52)
at java.sql.DriverManager.getConnection(DriverManager.java:179)
at it.polito.mobile.testpostgres.MainActivity$1.doInBackground(MainActivity.java:60)
at it.polito.mobile.testpostgres.MainActivity$1.doInBackground(MainActivity.java:35)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.io.IOException: java.lang.IllegalStateException
at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.translateConnectionException(ProtocolFactoryImpl.java:285)
at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:199)
at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:90)
at com.impossibl.postgres.system.BasicContext.<init>(BasicContext.java:130)
at com.impossibl.postgres.jdbc.PGConnectionImpl.<init>(PGConnectionImpl.java:185)
at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:180)
... 11 more
Caused by: java.lang.IllegalStateException
at io.netty.handler.ssl.SslHandler$LazyChannelPromise.executor(SslHandler.java:1491)
at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:388)
at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:283)
at io.netty.util.concurrent.DefaultPromise.syncUninterruptibly(DefaultPromise.java:225)
at io.netty.util.concurrent.DefaultPromise.syncUninterruptibly(DefaultPromise.java:32)
at com.impossibl.postgres.protocol.v30.ProtocolFactoryImpl.connect(ProtocolFactoryImpl.java:132)
... 15 more
Before, I was using the standard library org.postgresql.Driver and everything worked fine...
Does anybody know how to help me?
Thank you so much!
Marco

Which mysql timeout do I must modify?

I've set up on my Raspberry Pi a Glassfish server (4) and a MySQL, to launch my webservices for my Android Application.
Everything is okay after a lot of problems !
But one question stay in my mind for me, why every day I'm trying to execute a query with my app, I must restart my glassfish to have a result (I have a 500 Internal Server Error).
I've searched on the net, and I think it's a timeout from MySQL, who close the connection between him and Glassfish, so I want to know what I must doing to solve this problem ?
Thanks by advance !
EDIT
Stack Trace :
example.webservices.exceptions.ServiceException: L'appel au webservice a rencontré une erreur 500 : could not execute query
at example.webservices.accessservice.UserAccessService.isUserExists(UserAccessService.java:52)
at example.androidapp.asynctasks.VerifyUserTask.doInBackground(VerifyUserTask.java:38)
at example.androidapp.asynctasks.VerifyUserTask.doInBackground(VerifyUserTask.java:20)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)

Categories

Resources