Sqlite: cannot open file at line - android

This error happened occasionally when I did some user/stress test on Android. Files under /data disapppeared and system server crashed after this error occurred. I am curious about the name of database "contacts2.db-mj7742599A4". Normally it should be contacts2.db. What does "*.db-mj7742599A4" mean? Anyone can help please?
02-28 19:21:43.161 660 695 E SQLiteLog: (14) cannot open file at line 30174 of [00bb9c9ce4]
02-28 19:21:43.169 660 695 E SQLiteLog: (14) os_unix.c:30174: (2) open(/data/data/com.android.providers.contacts/databases/contacts2.db-mj7742599A4) -
02-28 19:21:43.520 397 409 I am_crash: [660,android.process.acore,572933,android.database.sqlite.SQLiteCantOpenDatabaseException,unable to open database file (code 14),SQLiteConnection.java,-2]
02-28 19:21:43.536 397 5671 I am_crash: [397,system_server,-1,java.lang.IllegalArgumentException,NULL,StatFs.java,-2]

Related

Android emulator (v28.0.23) unable to make HTTP requests

I am running a NativeScript-Vue application (TNS Android v5.1.0) on Mojave v10.14.3 with Android Studio v3.3.1 and Android emulator v28.0.23.
The Android emulator I am using (Nexus 6, API 25, Android 7.1.1 (Google APIs), x86) loses ability to make HTTP requests. The request hangs for a couple of minutes and eventually times out. I am using axios as the HTTP client to consume a remote C#.NET API (this is a client's API so I do not have access to it directly).
I found this SO post and tried most of the solutions. Some of them seemed to work, but then after a few minutes, the problem reoccurs.
Solutions I have tried:
Wiped data from emulator via AVD manager
Cold booted emulator via AVD manager
Created a new emulator via AVD manager
Set emulator proxy status to "No proxy" instead of using Android Studio's default proxy settings
Ran adb kill-server
Added 8.8.8.8 and 8.8.4.4 as DNS servers for my Mac
Started emulator with a specified DNS server, e.g. $ANDROID_HOME/emulator/emulator -avd Nexus_6_API_25 -dns-server 8.8.8.8,8.8.4.4
Attempted on Genymotion emulator (same issue)
Set WiFi as first in the Network Service order
Rebooting system; works for a few minutes then issue reoccurs
Additional information:
I am using WiFi and have not recently switched from LAN.
Chrome doesn't have internet access either.
The application works as expected on the iOS simulator and on physical android devices.
I installed Mojave recently, however the issue existed previously, although not as frequently it seemed.
JDK-8 and Android-SDK were installed via Homebrew following the NativeScript docs here.
I am fairly new to mobile development, please let me know if any more information is needed.
Does anyone know how I can fix this issue? I have limited access to a physical device so getting this fixed would be a tremendous help. Thanks!
HTTP Request example:
// api/config.js
import axios from "axios";
export default axios.create({
baseURL: "https://testapi.org",
headers: {
"Content-Type": "application/json",
}
});
// store/modules/auth.js
import api from "api/config.js";
const actions = {
login: async function(context, payload) {
try {
const response = await api.post("/api/account/login", payload);
context.dispatch("setUser", response.data.user);
} catch (error) {
console.log(error);
}
}
};
export default {
namespace: true,
actions
};
Logcat output:
02-28 14:12:40.742 1722 1816 D ConnectivityService: NetworkAgentInfo [MOBILE (LTE) - 100] validation failed
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: Error sending ping
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: java.net.SocketTimeoutException: SSL handshake timed out
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.google.android.gms.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.google.android.gms.org.conscrypt.NativeSsl.doHandshake(:com.google.android.gms#13280022#13.2.80 (040700-211705629):8)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms#13280022#13.2.80 (040700-211705629):15)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.Connection.connectTls(Connection.java:235)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.Connection.connectSocket(Connection.java:199)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.Connection.connect(Connection.java:172)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:329)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at bsc.a(SourceFile:230)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at bsf.run(SourceFile:174)
02-28 14:12:48.271 2939 3095 E GoogleConversionReporter: at java.lang.Thread.run(Thread.java:761)
02-28 14:12:49.375 2651 2932 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
02-28 14:12:49.376 2651 2932 W Conscrypt: at java.lang.reflect.Method.invoke(Native Method)
02-28 14:12:49.376 2651 2932 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms#13280022#13.2.80 (040700-211705629):13)
02-28 14:12:49.376 2651 2932 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
02-28 14:12:49.376 2651 2932 W Conscrypt: at libcore.io.Posix.setsockoptTimeval(Native Method)
02-28 14:12:49.376 2651 2932 W Conscrypt: at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:157)
02-28 14:12:50.171 2651 2930 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
02-28 14:12:50.171 2651 2930 W Conscrypt: at java.lang.reflect.Method.invoke(Native Method)
02-28 14:12:50.171 2651 2930 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms#13280022#13.2.80 (040700-211705629):13)
02-28 14:12:50.172 2651 2930 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
02-28 14:12:50.172 2651 2930 W Conscrypt: at libcore.io.Posix.setsockoptTimeval(Native Method)
02-28 14:12:50.172 2651 2930 W Conscrypt: at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:157)
02-28 14:12:50.283 2651 2929 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
02-28 14:12:50.284 2651 2929 W Conscrypt: at java.lang.reflect.Method.invoke(Native Method)
02-28 14:12:50.284 2651 2929 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms#13280022#13.2.80 (040700-211705629):13)
02-28 14:12:50.284 2651 2929 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
02-28 14:12:50.284 2651 2929 W Conscrypt: at libcore.io.Posix.setsockoptTimeval(Native Method)
02-28 14:12:50.284 2651 2929 W Conscrypt: at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:157)
02-28 14:12:51.482 2651 3200 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
02-28 14:12:51.482 2651 3200 W Conscrypt: at java.lang.reflect.Method.invoke(Native Method)
02-28 14:12:51.482 2651 3200 W Conscrypt: at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms#13280022#13.2.80 (040700-211705629):13)
02-28 14:12:51.482 2651 3200 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
02-28 14:12:51.482 2651 3200 W Conscrypt: at libcore.io.Posix.setsockoptTimeval(Native Method)
02-28 14:12:51.482 2651 3200 W Conscrypt: at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:157)
02-28 14:13:05.945 5154 5156 I art : Do partial code cache collection, code=30KB, data=30KB
02-28 14:13:05.946 5154 5156 I art : After code cache collection, code=30KB, data=30KB
02-28 14:13:05.946 5154 5156 I art : Increasing code cache capacity to 128KB
02-28 14:13:14.458 2363 5301 E WakeLock: GCM_HB_ALARM release without a matched acquire!

SQLite exception when downloading file with DownloadManager

My app downloads .mp3 files one by one with DownloadManager. Usually it works as expected. But sometimes download hangs and a progress bar stops updating inside the DownloadManager notification. If I click on the notification at the moment - my app crashes with SQLiteCantOpenDatabaseException:
04-19 17:18:11.167 4533-29108/android.process.media E/SQLiteLog: (14) cannot open file at line 30059 of [b3bb660af9]
04-19 17:18:11.177 4533-29108/android.process.media E/SQLiteLog: (14) os_unix.c:30059: (24) open(/data/data/com.android.providers.downloads/databases/downloads.db-journal) -
04-19 17:18:11.177 4533-29108/android.process.media E/SQLiteLog: (14) cannot open file at line 30059 of [b3bb660af9]
04-19 17:18:11.177 4533-29108/android.process.media E/SQLiteLog: (14) os_unix.c:30059: (24) open(/data/data/com.android.providers.downloads/databases/downloads.db-journal) -
04-19 17:18:11.177 4533-29108/android.process.media E/SQLiteLog: (14) statement aborts at 11: [SELECT _id, bypass_recommended_size_limit, uri FROM downloads WHERE (_id = ?)] unable to open database file
04-19 17:18:11.177 4533-29108/android.process.media E/SQLiteQuery: exception: unable to open database file (code 14); query: SELECT _id, bypass_recommended_size_limit, uri FROM downloads WHERE (_id = ?)
04-19 17:18:11.437 4533-4551/android.process.media E/SQLiteLog: (14) cannot open file at line 30059 of [b3bb660af9]
04-19 17:18:11.447 4533-4551/android.process.media E/SQLiteLog: (14) os_unix.c:30059: (24) open(/data/data/com.android.providers.downloads/databases/downloads.db-journal) -
04-19 17:18:11.447 4533-4551/android.process.media E/SQLiteLog: (14) cannot open file at line 30059 of [b3bb660af9]
04-19 17:18:11.447 4533-4551/android.process.media E/SQLiteLog: (14) os_unix.c:30059: (24) open(/data/data/com.android.providers.downloads/databases/downloads.db-journal) -
04-19 17:18:11.447 4533-4551/android.process.media E/SQLiteLog: (14) statement aborts at 49: [SELECT _id, _data AS local_filename, mediaprovider_uri, destination, title, description, uri, status, hint, mimetype AS media_type, total_bytes AS total_size, lastmod AS last_modified_
04-19 17:18:11.447 4533-4551/android.process.media E/SQLiteQuery: exception: unable to open database file (code 14); query: SELECT _id, _data AS local_filename, mediaprovider_uri, destination, title, description, uri, status, hint, mimetype AS media_type, total_bytes AS total_size, lastmod AS last_modified_timestamp, current_bytes AS bytes_so_far, allow_write, errorMsg, notificationpackage, 'placeholder' AS local_uri, 'placeholder' AS reason, entity, file_create_time, downloading_current_speed, download_surplus_time, xl_accelerate_speed, downloaded_time, xl_vip_status, xl_vip_cdn_url, xl_task_open_mark, download_task_thumbnail, apk_package_name, errorMsg, notificationpackage, download_file_hash, download_apk_install_way, download_extra, download_speedup_time, download_speedup_status, download_speedup_mode FROM downloads WHERE ((status='192') AND deleted != '1') ORDER BY _id DESC
04-19 17:18:11.457 4533-4551/android.process.media E/DatabaseUtils: Writing exception to parcel
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:845)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:146)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:135)
at android.database.CursorToBulkCursorAdaptor.getBulkCursorDescriptor(CursorToBulkCursorAdaptor.java:145)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:122)
at android.os.Binder.execTransact(Binder.java:446)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: android.database.sqlite.SQLiteException: unable to open database file (code 14)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at android.content.ContentResolver.query(ContentResolver.java:501)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at android.content.ContentResolver.query(ContentResolver.java:436)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at com.android.providers.downloads.marketRelease.XLDownloadManager$Query.runQuery(XLDownloadManager.java:1319)
04-19 17:18:11.457 16692-28705/android.process.mediaUI W/System.err: at com.android.providers.downloads.marketRelease.XLDownloadManager.query(XLDownloadManager.java:1471)
I know that DownloadManager should manage all the downloads and restart them in case of download failure. I don't use SQLite in my app so I believe that DownloadManager is the one who causes the problem.
So what crashes DownloadManager? Can I prevent it from crashing from my code? And is there way to prevent my app from crashing as well?

Issue libperfservice hotplug/cmd couldn't be open

I'm new on eclipse and android and I want for my first app do a wifi connection between the smartphone and an ip camera, unfortunately my app crash if when I want to see the stream of the camera.
My logcat said that:
03-06 18:11:26.879: E/(680): Could not open '/data/data/hotplug/cmd'<br/>
03-06 18:11:26.879: E/(680): error : 2, No such file or directory
[Edit k3b 2017-08-09]
I have the same issue on my andriod-4.4 my logcat contain this
08-09 20:38:40.436 1883-2035/? I/libPerfService: 1: set: 1
[ 08-09 20:38:40.436 1883:0x7f3 E/ ]
Could not open '/data/data/hotplug/cmd'
[ 08-09 20:38:40.436 1883:0x7f3 E/ ]
error : 2, No such file or directory
googleing "libPerfService" for found androidStudio log doesn't work
11-02 02:29:48.792 1014-1231/? I/libPerfService: 1: set freq: 1950000
11-02 02:29:48.792 1014-1231/? I/libPerfService: 1: set: 4
found https://census.tsyrklevich.net/file_permissions//system/lib/libperfservice.so with no description
Does anybody know where libPerfService comes from? is this a maleware waiting for command? I have not found any defintion for it.

After reboot, a android SQLite file locksettings.db-shm was found unlabeled

I'm developing on Android 5.0 now, and I get these logs several times just after the device rebooted in low-power state(I'm not sure if low-power is relevant here).
I don't familiar with SQLite, but I have gone through the flow of ext4 file create, read, and how does selinux label the inode, and I don't see how can a ext4 file inode's xattr be corrupted.
In normal, it should appear like this:
u:object_r:system_data_file:s0 locksettings.db-shm
u:object_r:system_data_file:s0 locksettings.db-wal
I'll paste logs later.
Any help is appreciated..Thank you
---Scenario 1:--
**kmsg:**
<12>[ 26.034851s][pid:2758,cpu3,logd.auditd]type=1400 audit(1425430396.379:7):
avc: denied { write } for pid=3244 comm="system_server" name="locksettings.db- shm" dev="mmcblk0p40" ino=430823 scontext=u:r:system_server:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
**logcat:**
08:53:16.369 3244 3244 E SQLiteLog: (14) cannot open file at line 28606 of [9491ba7d73]
E SQLiteLog: (14) os_unix.c:28606: (13) open(/data/system/locksettings.db-shm) -
E SQLiteLog: (14) unable to open database file
E SQLiteLog: (14) cannot open file at line 28606 of [9491ba7d73]
E SQLiteLog: (14) os_unix.c:28606: (13) open(/data/system/locksettings.db-shm) -
E SQLiteDatabase: Failed to open database '/data/system/locksettings.db'.
E SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file(Sqlite code 14): , while compiling: PRAGMA journal_mode,(OS error - 13:Permission denied)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:291)
E SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
--Scenario 2:--
**kmsg:**
11:58:55.334 <6>[ 26.980468s][pid:3299,cpu4,system_server]SELinux: Context is not valid (left unmapped).
11:58:55.334 <12>[ 26.980743s][pid:2844,cpu0,logd.auditd]type=1400 audit(1425009535.319:5): avc: denied { write } for pid=3299 comm="system_server" name="locksettings.db-wal" dev="mmcblk0p40" ino=16423 scontext=u:r:system_server:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
11:58:55.334 <12>[ 26.986572s][pid:2844,cpu0,logd.auditd]type=1400 audit(1425009535.319:6): avc: denied { write } for pid=3299 comm="system_server" name="locksettings.db-wal" dev="mmcblk0p40" ino=16423 scontext=u:r:system_server:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
**logcat:**
11:58:55.319 3299 3299 E SQLiteLog: (283) recovered 10 frames from WAL file /data/system/locksettings.db-wal

phonegap sqlitelog error

I'm trying to execute my android application using phonegap but I'm having the following error when I execute a plugin that i created:
15:33:12.912: E/SQLiteLog(2249): (14) cannot open file at line
30174 of [00bb9c9ce4] 10-31 15:33:12.912: E/SQLiteLog(2249): (14)
os_unix.c:30174: (2) open(/CachedGeoposition.db) - 10-31
15:33:12.912: D/WebKit(2249): ERROR: 10-31 15:33:12.921:
D/WebKit(2249): SQLite database failed to load from
/CachedGeoposition.db 10-31 15:33:12.921: D/WebKit(2249): Cause -
unable to open database file 10-31 15:33:12.921: D/WebKit(2249):
external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) :
bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
By the way, I'm not using a sqlite database

Categories

Resources