stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.72k stars 1.57k 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)

HeminWon commented 2 weeks ago

error info

SQLite/Statement.swift:218: Fatal error: 'try!' expression unexpectedly raised an error: disk I/O error (code: 10)

I am calling the code this way, and it works fine under normal circumstances. However, when I use third-party login and return from the third-party service, I encounter a crash.image

image

image