fluttercommunity / fluttercommunity/flutter_downloader

unable to open database file (Sqlite code 14), (OS error - 24:Too many open files)

Open
#427 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

Requesting too many downloads causes an exception on android


```
E/SQLiteLog(22812): (14) statement aborts at 17: [INSERT OR REPLACE INTO task(open_file_from_notification,headers,saved_dir,resumable,mime_type,file_name,progress,time_created,task_id,show_notification,url,status) VALUES (?,?,?,?,?,?
W/System.err(22812): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (Sqlite code 14), (OS error - 24:Too many open files)
W/System.err(22812): at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
W/System.err(22812): at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:818)
W/System.err(22812): at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:803)
W/System.err(22812): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
W/System.err(22812): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1729)
W/System.err(22812): at vn.hunghd.flutterdownloader.TaskDao.insertOrUpdateNewTask(TaskDao.java:54)
W/System.err(22812): at vn.hunghd.flutterdownloader.FlutterDownloaderPlugin.enqueue(FlutterDownloaderPlugin.java:182)
W/System.err(22812): at vn.hunghd.flutterdownloader.FlutterDownloaderPlugin.onMethodCall(FlutterDownloaderPlugin.java:82)
W/System.err(22812): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err(22812): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err(22812): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
W/System.err(22812): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(22812): at android.os.MessageQueue.next(MessageQueue.java:379)
W/System.err(22812): at android.os.Looper.loop(Looper.java:144)
W/System.err(22812): at android.app.ActivityThread.main(ActivityThread.java:7529)
W/System.err(22812): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(22812): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
W/System.err(22812): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with many download requests, then inspect TaskDao.java at insertOrUpdateNewTask and FlutterDownloaderPlugin.java at enqueue using the provided stack trace. Done means repeated requests no longer produce SQLite code 14 or an OS error about too many open files.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin, sqlite
Domain
database, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.