stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

DB query fail with error disk I/O error (code: 10) when accessing from widget extension #1187

Open ankitagg-ms opened 1 year ago

ankitagg-ms commented 1 year ago

Build Information

We have widget which shows data present in app DB. For some users, after some time. Widget extension is not able to fetch Data from DB and throws error disk I/O error (code: 10)

It works initially when app is suspended. We think, widget shows data until first refresh. However, when it goes for refresh.. Error occurs.

Implementation has not been updated recently and has been working for all users. We are using read only DB for widgets, since it does not need to write to DB.

For one user, this issue is continuously happening.

nathanfallet commented 1 year ago

Can you provide some code to reproduce the issue? As well as the detailed error?

nathanfallet commented 1 year ago

Could it be linked to #870?

ankitagg-ms commented 1 year ago

My logs only this information about error disk I/O error (code: 10) Not able to log extended error code when using sqlite.swift sdk for ios.

I think, #870 this is different as it talks about shared group and copying database where as we are accessing same database from different connection from my widget extension

nathanfallet commented 1 year ago

In both case, a new object is instantiated by your app and the app extension (which is the widget in your case). Both access the same database, which file can be shared using Access Group (otherwise only the app/extension that created it can access it, and they will both have their own file)