Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

crash: when block chain start ,some time crash #596

Open
mengqutaoyuan opened this issue Mar 28, 2022 · 4 comments
Open

crash: when block chain start ,some time crash #596

mengqutaoyuan opened this issue Mar 28, 2022 · 4 comments

Comments

@mengqutaoyuan
Copy link

Thread 15: Fatal error: 'try!' expression unexpectedly raised an error: SQLite error 14: unable to open database file - while executing SELECT * FROM sqlite_master LIMIT 1

this code

public var lastBlock: Block? { try! dbPool.read { db in try Block.order(Block.Columns.height.desc).fetchOne(db) } }
crash

@ealymbaev
Copy link
Member

This kind of error is thrown when the app cannot open database file. We had encountered this issue in our EthereumKit some time ago. It have been occurring when there were a lot of database files.

We could not find any reasonable description or solution of this kind of issues, and most likely it seems like the OS restricts accessing database files randomly.

Finally in EthereumKit we have refactored the code and decreased the number of database files. After that the issue seems to have disappeared.

As for BitcoinKit - there are no many database files though. Is this issue reproducible for you?

@13adahan
Copy link

Hi, i have the same issue...
Screenshot 2022-03-31 at 19 52 41

@ealymbaev
Copy link
Member

I have tried running Example app on my side with no issues. Are you running on simulator or device? If on device, what device is this?

@13adahan
Copy link

13adahan commented Apr 4, 2022

@ealymbaev sometimes it happens. but now it does not happen the most of time. I had a project that was built on the example folder, but now it crashes with the same error here #595, is there a way I can update the project without rebuilding it from zero? what parts of code do I have to change? I saw that the last update was on the podfile.lock file so I copied and pasted on my podfile.lock and it did not work, I downloaded both the podfile.lock and the podifle and put it on my old example folder tried to pod install but it gave me an error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants